org.jboss.dna.repository.sequencers
Class SequencerOutputMap

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

@NotThreadSafe
public class SequencerOutputMap
extends java.lang.Object
implements SequencerOutput, java.lang.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.
 class SequencerOutputMap.PropertyValue
          A property name and value pair.
 
Constructor Summary
SequencerOutputMap()
           
 
Method Summary
 boolean isEmpty()
          Return whether there are no entries
 java.util.Iterator<SequencerOutputMap.Entry> iterator()
          Return the entries in this output in an order with shorter paths first.
 void setProperty(java.lang.String nodePath, java.lang.String property, java.lang.Object... values)
          Set the supplied property on the supplied node.
 void setReference(java.lang.String nodePath, java.lang.String property, java.lang.String... paths)
          Set the supplied reference on the supplied node.
 int size()
          Return the number of node entries in this map.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequencerOutputMap

public SequencerOutputMap()
Method Detail

setProperty

public void setProperty(java.lang.String nodePath,
                        java.lang.String property,
                        java.lang.Object... values)
Set the supplied property on the supplied node.

The allowable values are any of the following:

Specified by:
setProperty in interface SequencerOutput
Parameters:
nodePath - the path to the node containing the property; may not be null
property - the name of the property to be set
values - the value(s) for the property; may be empty if any existing property is to be removed

setReference

public void setReference(java.lang.String nodePath,
                         java.lang.String property,
                         java.lang.String... paths)
Set the supplied reference on the supplied node.

Specified by:
setReference in interface SequencerOutput
Parameters:
nodePath - the path to the node containing the property; may not be null
property - the name of the property to be set
paths - the paths to the referenced property, which may be absolute paths or relative to the sequencer output node; may be empty if any existing property is to be removed

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

iterator

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

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

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2008. All Rights Reserved.