com.starbase.starteam
Class GroupNode

java.lang.Object
  |
  +--com.starbase.starteam.GroupNode

public class GroupNode
extends java.lang.Object

Describes a group of objects that may be a subgroup of a larger, indexable group. Maintains a range mapping into the underlying ordered collection. Each Node may be in an expanded or collapsed state. Note that it is the client's responsibility to ensure valid index ranges relative to the underlying collection.


Constructor Summary
GroupNode(java.lang.String name, int start, int length)
          Creates a GroupNode containing a set of objects in the associated indexable collection.
 
Method Summary
 void addChild(GroupNode child)
          Adds a GroupNode as a child of this GroupNode.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 GroupNode[] getChildren()
          Returns the direct subgroups of this group.
 int getDepth()
          Returns the zero-based depth of this GroupNode in the grouping hierarchy.
 int getLength()
          Returns the number of contiguous objects spanned in the underlying indexable collection.
 java.lang.String getName()
          Returns the display name of this group.
 int getNumChildren()
          Returns the number of direct subgroups of this group.
 int getNumVisibleLines()
          Returns the number of visible lines represented in this node, based on the current collapsed/expanded state of the hierarchy.
 GroupNode getParent()
          Returns the parent GroupNode.
 int getStart()
          Returns the index of the first leaf object of this node in the associated indexable collection.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean isExpanded()
          Returns true if this GroupNode is expanded.
 boolean isLeafNode()
          Returns true if this is a leaf-level GroupNode.
 void setExpanded(boolean bExpand)
          Expands or collapses this GroupNode.
 void toDebugString()
          Prints a String representation of the GroupNode, helpful for debugging.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupNode

public GroupNode(java.lang.String name,
                 int start,
                 int length)
Creates a GroupNode containing a set of objects in the associated indexable collection.

Parameters:
name - The display name for the group.
start - The index of the first object that belongs to this group in the associated indexable collection.
length - The number of contiguous objects in the associated collection that belong to this group.
Method Detail

getName

public java.lang.String getName()
Returns the display name of this group.

Returns:
the display name of this group.

getDepth

public int getDepth()
Returns the zero-based depth of this GroupNode in the grouping hierarchy.

Returns:
the zero-based depth of this GroupNode in the grouping hierarchy.

isExpanded

public boolean isExpanded()
Returns true if this GroupNode is expanded.

Returns:
true if this GroupNode is expanded.

setExpanded

public void setExpanded(boolean bExpand)
Expands or collapses this GroupNode.

Parameters:
bExpand - true = expand, false = collapse.

getNumChildren

public int getNumChildren()
Returns the number of direct subgroups of this group.

Returns:
the number of direct subgroups of this group.

getChildren

public GroupNode[] getChildren()
Returns the direct subgroups of this group.

Returns:
the direct subgroups of this group.

isLeafNode

public boolean isLeafNode()
Returns true if this is a leaf-level GroupNode.

Returns:
true if this is a leaf-level GroupNode.

getParent

public GroupNode getParent()
Returns the parent GroupNode.

Returns:
the parent GroupNode.

addChild

public void addChild(GroupNode child)
Adds a GroupNode as a child of this GroupNode.

Parameters:
child - The GroupNode to add as a child of this one.

getNumVisibleLines

public int getNumVisibleLines()
Returns the number of visible lines represented in this node, based on the current collapsed/expanded state of the hierarchy.

Returns:
the number of visible lines represented in this node, based on the current collapsed/expanded state of the hierarchy.

getStart

public int getStart()
Returns the index of the first leaf object of this node in the associated indexable collection.

Returns:
the index of the first leaf object of this node in the associated indexable collection.

getLength

public int getLength()
Returns the number of contiguous objects spanned in the underlying indexable collection.

Returns:
the number of contiguous objects spanned in the underlying indexable collection.

toDebugString

public void toDebugString()
Prints a String representation of the GroupNode, helpful for debugging.


equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.