ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

org.jboss.shrinkwrap.impl.base
Class NodeImpl

java.lang.Object
  extended by org.jboss.shrinkwrap.impl.base.NodeImpl
All Implemented Interfaces:
Node

public class NodeImpl
extends Object
implements Node

The default implementation of Node

Author:
German Escobar

Constructor Summary
NodeImpl(ArchivePath path)
          Constructor This constructor will create a directory Node with the specified path.
NodeImpl(ArchivePath path, Asset asset)
          Constructor This constructor will create an asset Node with the specified path.
 
Method Summary
 void addChild(Node node)
          Adds a child to the Set of nodes.
 boolean equals(Object obj)
           
 Asset getAsset()
           
 Set<Node> getChildren()
           
 ArchivePath getPath()
           
 int hashCode()
           
 void removeChild(Node node)
          Removes a child from the Set of nodes.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeImpl

public NodeImpl(ArchivePath path)
Constructor This constructor will create a directory Node with the specified path.

Parameters:
path - The ArchivePath this Node is placed within the Archive

NodeImpl

public NodeImpl(ArchivePath path,
                Asset asset)
Constructor This constructor will create an asset Node with the specified path.

Parameters:
path - The ArchivePath this Node is placed within the Archive
asset - The Asset that this Node holds.
Method Detail

getPath

public ArchivePath getPath()
Specified by:
getPath in interface Node
Returns:
The path where this node is placed within the Archive

getAsset

public Asset getAsset()
Specified by:
getAsset in interface Node
Returns:
The Asset this node holds, null if it is a directory

getChildren

public Set<Node> getChildren()
Specified by:
getChildren in interface Node
Returns:
The child nodes of this node or, an empty set if it has no children or holds an asset. This method will never return null. The returned Set will be an immutable view.

addChild

public void addChild(Node node)
Adds a child to the Set of nodes. If already exists, nothing happens.

Parameters:
node - The Node that will be added as a child

removeChild

public void removeChild(Node node)
Removes a child from the Set of nodes. If it doesn't exists, nothing happens.

Parameters:
node - The Node that will be removed from the childs

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.