Protege 3.4

edu.stanford.smi.protege.util
Class LazyTreeNode

java.lang.Object
  extended by edu.stanford.smi.protege.util.LazyTreeNode
All Implemented Interfaces:
TreeNode
Direct Known Subclasses:
ClsClsReferenceNode, LazyTreeRoot, ParentChildNode, ReferenceNode, SlotSubslotNode

public abstract class LazyTreeNode
extends Object
implements TreeNode

A tree node that doesn't check its children until it is asked for them. This lazy evaluation allows the system to do "load on demand" from a database.

Author:
Ray Fergerson

Constructor Summary
protected LazyTreeNode(LazyTreeNode parent, Object userObject)
           
protected LazyTreeNode(LazyTreeNode parent, Object userObject, boolean isSorted)
           
 
Method Summary
 void childAdded(Object o)
           
 void childAdded(Object o, int index)
           
 void childRemoved(Object o)
           
 Enumeration children()
           
protected  int compareTo(Object o1, Object o2)
           
protected abstract  LazyTreeNode createNode(Object o)
           
protected  void dispose()
           
static boolean equals(Object o1, Object o2)
           
 boolean getAllowsChildren()
           
 TreeNode getChildAt(int i)
           
 int getChildCount()
           
protected abstract  int getChildObjectCount()
           
protected abstract  Collection getChildObjects()
           
protected abstract  Comparator getComparator()
           
 int getIndex(Object o)
           
 int getIndex(TreeNode node)
           
 LazyTreeNode getLazyTreeNodeParent()
           
 TreeNode getParent()
           
 Object getUserObject()
           
 int getUserObjectIndex(Object o)
           
 boolean isDuplicate()
           
 boolean isLeaf()
           
 boolean isSorted()
           
protected  void loadChildObjects(Collection childObjects)
          Do not override or call this method in a subclass, unless you know what you are doing.
 void notifyChildNodeAdded(LazyTreeNode parent, int index, LazyTreeNode child)
           
 void notifyChildNodeRemoved(LazyTreeNode parent, int index, LazyTreeNode child)
           
 void notifyNodeChanged(LazyTreeNode node)
           
 void notifyNodeStructureChanged(LazyTreeNode node)
           
 void reload()
           
 void reload(Object userObject)
           
protected  void setIsLoaded(boolean isLoaded)
          Do not call this method unless you know exactly what you are doing.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyTreeNode

protected LazyTreeNode(LazyTreeNode parent,
                       Object userObject)

LazyTreeNode

protected LazyTreeNode(LazyTreeNode parent,
                       Object userObject,
                       boolean isSorted)
Method Detail

isDuplicate

public boolean isDuplicate()

childAdded

public void childAdded(Object o)

compareTo

protected int compareTo(Object o1,
                        Object o2)

childAdded

public void childAdded(Object o,
                       int index)

childRemoved

public void childRemoved(Object o)

children

public Enumeration children()
Specified by:
children in interface TreeNode

createNode

protected abstract LazyTreeNode createNode(Object o)

dispose

protected void dispose()

setIsLoaded

protected void setIsLoaded(boolean isLoaded)
Do not call this method unless you know exactly what you are doing.


getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode

getChildAt

public TreeNode getChildAt(int i)
Specified by:
getChildAt in interface TreeNode

getChildCount

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

getChildObjectCount

protected abstract int getChildObjectCount()

getChildObjects

protected abstract Collection getChildObjects()

getComparator

protected abstract Comparator getComparator()

getIndex

public int getIndex(Object o)

getIndex

public int getIndex(TreeNode node)
Specified by:
getIndex in interface TreeNode

getLazyTreeNodeParent

public LazyTreeNode getLazyTreeNodeParent()

getParent

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

getUserObject

public Object getUserObject()

getUserObjectIndex

public int getUserObjectIndex(Object o)

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode

loadChildObjects

protected void loadChildObjects(Collection childObjects)
Do not override or call this method in a subclass, unless you know what you are doing.

Parameters:
childObjects -

notifyChildNodeAdded

public void notifyChildNodeAdded(LazyTreeNode parent,
                                 int index,
                                 LazyTreeNode child)

notifyChildNodeRemoved

public void notifyChildNodeRemoved(LazyTreeNode parent,
                                   int index,
                                   LazyTreeNode child)

notifyNodeChanged

public void notifyNodeChanged(LazyTreeNode node)

notifyNodeStructureChanged

public void notifyNodeStructureChanged(LazyTreeNode node)

reload

public void reload()

reload

public void reload(Object userObject)

toString

public String toString()
Overrides:
toString in class Object

equals

public static boolean equals(Object o1,
                             Object o2)

isSorted

public boolean isSorted()

Protege 3.4

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2009 Stanford University.