org.jicarilla.collections
Class DefaultNode

java.lang.Object
  extended byorg.jicarilla.collections.DefaultNode
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, Node, java.io.Serializable

public class DefaultNode
extends java.lang.Object
implements Node, java.lang.Cloneable, java.io.Serializable

An implementation of Node which is backed by a List. When you don't provide a backing list, an ArrayList will be used.

Version:
$Id: DefaultNode.java,v 1.2 2004/01/04 16:10:17 lsimons Exp $
Author:
Leo Simons
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
DefaultNode(java.lang.String name)
           
DefaultNode(java.lang.String name, java.util.List children)
           
DefaultNode(java.lang.String name, java.util.List children, java.util.Map attributes)
           
 
Method Summary
 boolean addChild(Node n)
           
 boolean addChildren(java.util.Collection c)
           
 Node[] childrenToArray()
           
 Node[] childrenToArray(java.lang.Object[] o)
           
 java.util.List childrenToList()
           
 void clear()
           
 boolean containsChild(Node n)
           
 boolean containsChildren(java.util.Collection c)
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
protected  boolean equalAttributes(Node n)
           
protected  boolean equalChildren(Node n)
           
protected  boolean equalContents(Node n)
           
protected  boolean equalNames(Node n)
           
 boolean equals(java.lang.Object o)
           
protected  boolean equalSizes(Node n)
           
 java.lang.Object get(java.lang.Object key)
           
 java.lang.Object getContents()
           
 java.lang.String getName()
           
 int hashCode()
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map t)
           
 java.lang.Object remove(java.lang.Object key)
           
 boolean removeChild(Node n)
           
 boolean removeChildren(java.util.Collection c)
           
 java.lang.Object setContents(java.lang.Object o)
           
 java.lang.String setName(java.lang.String s)
           
 int size()
           
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNode

public DefaultNode(java.lang.String name)

DefaultNode

public DefaultNode(java.lang.String name,
                   java.util.List children)

DefaultNode

public DefaultNode(java.lang.String name,
                   java.util.List children,
                   java.util.Map attributes)
Method Detail

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Map

equalAttributes

protected boolean equalAttributes(Node n)

equalChildren

protected boolean equalChildren(Node n)

equalNames

protected boolean equalNames(Node n)

equalContents

protected boolean equalContents(Node n)

equalSizes

protected boolean equalSizes(Node n)

size

public int size()
Specified by:
size in interface Node

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Node

clear

public void clear()
Specified by:
clear in interface Node

getName

public java.lang.String getName()
Specified by:
getName in interface Node

setName

public java.lang.String setName(java.lang.String s)
Specified by:
setName in interface Node

getContents

public java.lang.Object getContents()
Specified by:
getContents in interface Node

setContents

public java.lang.Object setContents(java.lang.Object o)
Specified by:
setContents in interface Node

addChild

public boolean addChild(Node n)
Specified by:
addChild in interface Node

addChildren

public boolean addChildren(java.util.Collection c)
Specified by:
addChildren in interface Node

containsChild

public boolean containsChild(Node n)
Specified by:
containsChild in interface Node

containsChildren

public boolean containsChildren(java.util.Collection c)
Specified by:
containsChildren in interface Node

childrenToArray

public Node[] childrenToArray()
Specified by:
childrenToArray in interface Node

childrenToArray

public Node[] childrenToArray(java.lang.Object[] o)
Specified by:
childrenToArray in interface Node

childrenToList

public java.util.List childrenToList()
Specified by:
childrenToList in interface Node

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface Node

removeChild

public boolean removeChild(Node n)
Specified by:
removeChild in interface Node

removeChildren

public boolean removeChildren(java.util.Collection c)
Specified by:
removeChildren in interface Node

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map

putAll

public void putAll(java.util.Map t)
Specified by:
putAll in interface java.util.Map

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map


Copyright © 2004 Leo Simons. All Rights Reserved.