fr.paris5.shaman.insight.operation
Class TopicNodeImpl

java.lang.Object
  |
  +--fr.paris5.shaman.insight.operation.TopicNodeImpl
All Implemented Interfaces:
java.io.Serializable, TopicNode

class TopicNodeImpl
extends java.lang.Object
implements TopicNode

Implementation of a TopicNode.

Version:
$Id: TopicNodeImpl.java,v 1.3 2002/07/25 13:18:08 caillette Exp $
Author:
Laurent Caillette
See Also:
Serialized Form

Field Summary
private  java.util.ArrayList children
           
private  TopicNode parent
           
(package private) static long serialVersionUID
           
private  Topic topic
           
 
Constructor Summary
TopicNodeImpl(Topic topic)
           
 
Method Summary
private  void addChild(TopicNode child)
           
private  void addChildren(java.util.List list, TopicNode parent)
           
 boolean descendingEquals(TopicNode other)
           
 boolean equals(java.lang.Object obj)
          Performs a recursive check for equality on the whole tree.
 TopicNode[] flatten()
           
 TopicNode getChildAt(int index)
           
 int getChildCount()
           
 TopicNode[] getChildren()
           
 int getDepth()
           
 TopicNode getParent()
           
 TopicNode getRoot()
           
 Topic getTopic()
           
 boolean hasChildren()
           
 int hashCode()
           
 boolean isRoot()
           
private  boolean nodeEquals(TopicNode other)
           
 void setParent(TopicNodeImpl parent)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID

topic

private final Topic topic

children

private final java.util.ArrayList children

parent

private TopicNode parent
Constructor Detail

TopicNodeImpl

public TopicNodeImpl(Topic topic)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Performs a recursive check for equality on the whole tree.
Overrides:
equals in class java.lang.Object
Parameters:
obj -  
Returns:
 

nodeEquals

private boolean nodeEquals(TopicNode other)

descendingEquals

public boolean descendingEquals(TopicNode other)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setParent

public void setParent(TopicNodeImpl parent)

getParent

public TopicNode getParent()
Specified by:
getParent in interface TopicNode

getTopic

public Topic getTopic()
Specified by:
getTopic in interface TopicNode

addChild

private void addChild(TopicNode child)

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface TopicNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface TopicNode

getChildAt

public TopicNode getChildAt(int index)
Specified by:
getChildAt in interface TopicNode

getChildren

public TopicNode[] getChildren()
Specified by:
getChildren in interface TopicNode

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isRoot

public boolean isRoot()
Specified by:
isRoot in interface TopicNode

getDepth

public int getDepth()
Specified by:
getDepth in interface TopicNode

getRoot

public TopicNode getRoot()
Specified by:
getRoot in interface TopicNode

addChildren

private void addChildren(java.util.List list,
                         TopicNode parent)

flatten

public TopicNode[] flatten()
Specified by:
flatten in interface TopicNode


Copyright © 2002 Laurent Caillette and l'Université René Descartes, Paris 5. All rights reserved.