org.jboss.dna.repository.sequencers
Class SequencerOutputMap

java.lang.Object
  extended by org.jboss.dna.repository.sequencers.SequencerOutputMap
All Implemented Interfaces:
Iterable<SequencerOutputMap.Entry>, org.jboss.dna.graph.sequencers.SequencerOutput

@NotThreadSafe
public class SequencerOutputMap
extends Object
implements org.jboss.dna.graph.sequencers.SequencerOutput, Iterable<SequencerOutputMap.Entry>

A basic SequencerOutput that records all information in-memory and which organizes the properties by node paths and provides access to the nodes in a natural path-order.

Author:
Randall Hauch

Nested Class Summary
 class SequencerOutputMap.Entry
          An entry in a SequencerOutputMap, which contains the path of the node and the property values on the node.
protected  class SequencerOutputMap.EntryIterator
           
 class SequencerOutputMap.PropertyValue
          A property name and value pair.
 
Constructor Summary
SequencerOutputMap(org.jboss.dna.graph.properties.ValueFactories factories)
           
 
Method Summary
 org.jboss.dna.graph.properties.ValueFactories getFactories()
          
 org.jboss.dna.graph.properties.NamespaceRegistry getNamespaceRegistry()
          
protected  List<SequencerOutputMap.PropertyValue> getProperties(org.jboss.dna.graph.properties.Path nodePath)
          Get the properties for the node given by the supplied path.
 boolean isEmpty()
          Return whether there are no entries
 Iterator<SequencerOutputMap.Entry> iterator()
          Return the entries in this output in an order with shorter paths first.
protected  List<SequencerOutputMap.PropertyValue> removeProperties(org.jboss.dna.graph.properties.Path nodePath)
           
 void setProperty(org.jboss.dna.graph.properties.Path nodePath, org.jboss.dna.graph.properties.Name propertyName, Object... values)
          
 void setProperty(String nodePath, String property, Object... values)
          
 void setReference(String nodePath, String propertyName, String... paths)
          
 int size()
          Return the number of node entries in this map.
protected  void sortValues()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequencerOutputMap

public SequencerOutputMap(org.jboss.dna.graph.properties.ValueFactories factories)
Method Detail

getFactories

public org.jboss.dna.graph.properties.ValueFactories getFactories()

Specified by:
getFactories in interface org.jboss.dna.graph.sequencers.SequencerOutput

getNamespaceRegistry

public org.jboss.dna.graph.properties.NamespaceRegistry getNamespaceRegistry()

Specified by:
getNamespaceRegistry in interface org.jboss.dna.graph.sequencers.SequencerOutput
See Also:
SequencerOutput.getNamespaceRegistry()

setProperty

public void setProperty(org.jboss.dna.graph.properties.Path nodePath,
                        org.jboss.dna.graph.properties.Name propertyName,
                        Object... values)

Specified by:
setProperty in interface org.jboss.dna.graph.sequencers.SequencerOutput

setProperty

public void setProperty(String nodePath,
                        String property,
                        Object... values)

Specified by:
setProperty in interface org.jboss.dna.graph.sequencers.SequencerOutput

setReference

public void setReference(String nodePath,
                         String propertyName,
                         String... paths)

Specified by:
setReference in interface org.jboss.dna.graph.sequencers.SequencerOutput

size

public int size()
Return the number of node entries in this map.

Returns:
the number of entries

isEmpty

public boolean isEmpty()
Return whether there are no entries

Returns:
true if this container is empty, or false otherwise

removeProperties

protected List<SequencerOutputMap.PropertyValue> removeProperties(org.jboss.dna.graph.properties.Path nodePath)

getProperties

protected List<SequencerOutputMap.PropertyValue> getProperties(org.jboss.dna.graph.properties.Path nodePath)
Get the properties for the node given by the supplied path.

Parameters:
nodePath - the path to the node
Returns:
the property values, or null if there are none

iterator

public Iterator<SequencerOutputMap.Entry> iterator()
Return the entries in this output in an order with shorter paths first.

Specified by:
iterator in interface Iterable<SequencerOutputMap.Entry>

sortValues

protected void sortValues()

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.