org.modeshape.graph.connector.map
Class DefaultMapNode

java.lang.Object
  extended by org.modeshape.graph.connector.map.DefaultMapNode
All Implemented Interfaces:
MapNode

public class DefaultMapNode
extends Object
implements MapNode


Constructor Summary
DefaultMapNode(UUID uuid)
           
 
Method Summary
 void addChild(int index, MapNode child)
          Inserts the specified child at the specified position in the list of children.
 void addChild(MapNode child)
          Adds the given child to the end of the list of children for this node
 void clearChildren()
          Removes all of the children for this node in a single operation.
 boolean equals(Object obj)
          
 LinkedList<MapNode> getChildren()
           
 Path.Segment getName()
          Returns the name of this node along with its SNS index within its parent's children
 MapNode getParent()
          Returns the parent of this node or null if the node is the root node for its workspace.
 Map<Name,Property> getProperties()
          Returns a map of property names to the property for the given name
 Property getProperty(ExecutionContext context, String name)
          Returns the named property
 Property getProperty(Name name)
          Returns the named property
 Set<Name> getUniqueChildNames()
          Returns the set of child names for this node
 UUID getUuid()
          Returns the UUID for this node
 int hashCode()
          
 boolean removeChild(MapNode child)
          Removes the given child from the list of children
 MapNode removeProperty(Name propertyName)
          Removes the property with the given name
 void setName(Path.Segment name)
           
 void setParent(MapNode parent)
           
 MapNode setProperties(Iterable<Property> properties, Iterable<Name> removedPropertyNames)
          Sets the given properties in a single operation, overwriting any previous properties for the same name This bulk mutator should be used when multiple properties are being set in order to allow underlying implementations to optimize their access to their respective persistent storage mechanism.
 MapNode setProperty(ExecutionContext context, String name, Object... values)
          Sets the property with the given name, overwriting any previous property for the given name
 MapNode setProperty(Property property)
          Sets the property with the given name, overwriting any previous property for the given name
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMapNode

public DefaultMapNode(UUID uuid)
Method Detail

getUuid

public UUID getUuid()
Description copied from interface: MapNode
Returns the UUID for this node

Specified by:
getUuid in interface MapNode
Returns:
the UUID for this node

getName

public Path.Segment getName()
Description copied from interface: MapNode
Returns the name of this node along with its SNS index within its parent's children

Specified by:
getName in interface MapNode
Returns:
the name of this node along with its SNS index within its parent's children

setName

public void setName(Path.Segment name)
Specified by:
setName in interface MapNode
Parameters:
name - Sets name to the specified value.

getUniqueChildNames

public Set<Name> getUniqueChildNames()
Description copied from interface: MapNode
Returns the set of child names for this node

Specified by:
getUniqueChildNames in interface MapNode
Returns:
the set of child names for this node

getParent

public MapNode getParent()
Description copied from interface: MapNode
Returns the parent of this node or null if the node is the root node for its workspace.

Specified by:
getParent in interface MapNode
Returns:
the parent of this node; may be null if the node is the root node for its workspace

setParent

public void setParent(MapNode parent)
Specified by:
setParent in interface MapNode
Parameters:
parent - Sets parent to the specified value.

getChildren

public LinkedList<MapNode> getChildren()
Specified by:
getChildren in interface MapNode
Returns:
children

getProperties

public Map<Name,Property> getProperties()
Description copied from interface: MapNode
Returns a map of property names to the property for the given name

Specified by:
getProperties in interface MapNode
Returns:
properties

addChild

public void addChild(int index,
                     MapNode child)
Description copied from interface: MapNode
Inserts the specified child at the specified position in the list of children. Shifts the child currently at that position (if any) and any subsequent children to the right (adds one to their indices).

Specified by:
addChild in interface MapNode
Parameters:
index - index at which the specified child is to be inserted
child - the child to be inserted

addChild

public void addChild(MapNode child)
Description copied from interface: MapNode
Adds the given child to the end of the list of children for this node

Specified by:
addChild in interface MapNode
Parameters:
child - the child to add to this node

clearChildren

public void clearChildren()
Description copied from interface: MapNode
Removes all of the children for this node in a single operation.

Specified by:
clearChildren in interface MapNode

removeChild

public boolean removeChild(MapNode child)
Description copied from interface: MapNode
Removes the given child from the list of children

Specified by:
removeChild in interface MapNode
Parameters:
child - the child to be removed
Returns:
true if the child was one of this node's children (and was removed); false otherwise

removeProperty

public MapNode removeProperty(Name propertyName)
Description copied from interface: MapNode
Removes the property with the given name

Specified by:
removeProperty in interface MapNode
Parameters:
propertyName - the name of the property to remove
Returns:
this map node

setProperties

public MapNode setProperties(Iterable<Property> properties,
                             Iterable<Name> removedPropertyNames)
Description copied from interface: MapNode
Sets the given properties in a single operation, overwriting any previous properties for the same name This bulk mutator should be used when multiple properties are being set in order to allow underlying implementations to optimize their access to their respective persistent storage mechanism.

Specified by:
setProperties in interface MapNode
Parameters:
properties - the properties to set or update
removedPropertyNames - the names of the properties that are to be removed; may be null if there are none
Returns:
this map node

setProperty

public MapNode setProperty(Property property)
Sets the property with the given name, overwriting any previous property for the given name

Specified by:
setProperty in interface MapNode
Parameters:
property - the property to set
Returns:
this map node

setProperty

public MapNode setProperty(ExecutionContext context,
                           String name,
                           Object... values)
Sets the property with the given name, overwriting any previous property for the given name

Specified by:
setProperty in interface MapNode
Parameters:
context - the current execution context, used to get a name factory and property factory.
name - the name of the property
values - the values for the property
Returns:
this map node

getProperty

public Property getProperty(ExecutionContext context,
                            String name)
Returns the named property

Specified by:
getProperty in interface MapNode
Parameters:
context - the current execution context, used to get a name factory
name - the name of the property to return
Returns:
the property for the given name

getProperty

public Property getProperty(Name name)
Returns the named property

Specified by:
getProperty in interface MapNode
Parameters:
name - the name of the property to return
Returns:
the property for the given name

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


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