arlut.csd.ganymede
Class CategoryDump

java.lang.Object
  |
  +--arlut.csd.ganymede.CategoryDump
All Implemented Interfaces:
Category, CategoryNode, java.rmi.Remote

public class CategoryDump
extends java.lang.Object
implements Category, CategoryNode

This class is intended to serve as a stub to hold basic information about server side categories for the client to process locally.

Note that even though this class is implementing a remote interface, it is doing so for the purpose of providing a consistent interface for the client, not for actual remote access. Thus, we are not extending UnicastRemoteObject as we would if we were truly a remote object.


Field Summary
(package private)  java.util.Vector contents
           
private  int lastIndex
           
(package private)  java.lang.String name
           
(package private)  CategoryDump parent
           
 
Constructor Summary
CategoryDump(CategoryDump parent, char[] src, int index)
           
 
Method Summary
 void addNodeAfter(CategoryNode node, java.lang.String prevNodeName)
          This method is used to place a Category Node under us.
 void addNodeBefore(CategoryNode node, java.lang.String nextNodeName)
          This method is used to place a Category Node under us.
 java.util.Vector getBases()
          This method returns a vector of BaseDump objects, one for each base held under this base.
private  void getBases(java.util.Vector inout)
           
 Category getCategory()
          This method returns the category that this category node belongs to.
private  java.lang.String getChunk(char[] chars, int startDex)
           
 int getLastIndex()
           
 java.lang.String getName()
          Returns the name of this category.
 CategoryNode getNode(java.lang.String name)
          Returns a subcategory of name .
 java.util.Vector getNodes()
          Returns child nodes
 java.lang.String getPath()
          Returns the full path to this category, with levels in the hierarchy separated by '/'s.
 boolean isUnder(Category cat)
          This method returns true if this is a subcategory of cat.
 void moveCategoryNode(java.lang.String catPath, java.lang.String prevNodeName)
          This method can be used to move a Category from another Category to this Category, or to move a Category around within this Category.
 Category newSubCategory()
          This creates a new subcategory under this category, with displayOrder after the last item currently in the category.
 void removeNode(CategoryNode node)
          This method is used to remove a Category Node from under us.
 void removeNode(java.lang.String name)
          This method is used to remove a Category Node from under us.
 void setCategory(Category category)
          This method tells the CategoryNode what it's containing category is.
 boolean setName(java.lang.String newName)
          Sets the name of this node.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

parent

CategoryDump parent

name

java.lang.String name

contents

java.util.Vector contents

lastIndex

private int lastIndex
Constructor Detail

CategoryDump

public CategoryDump(CategoryDump parent,
                    char[] src,
                    int index)
Method Detail

getLastIndex

public int getLastIndex()

getName

public java.lang.String getName()
Returns the name of this category.
Specified by:
getName in interface Category

getPath

public java.lang.String getPath()
Returns the full path to this category, with levels in the hierarchy separated by '/'s.
Specified by:
getPath in interface Category

getBases

public java.util.Vector getBases()
This method returns a vector of BaseDump objects, one for each base held under this base.

getBases

private void getBases(java.util.Vector inout)

setName

public boolean setName(java.lang.String newName)
Sets the name of this node. The name must not include a '/' character, but all other characters are acceptable.
Specified by:
setName in interface Category

setCategory

public void setCategory(Category category)
This method tells the CategoryNode what it's containing category is.
Specified by:
setCategory in interface CategoryNode

getCategory

public Category getCategory()
This method returns the category that this category node belongs to. If this is the DBStore's root category, this will return null.
Specified by:
getCategory in interface Category

getNodes

public java.util.Vector getNodes()
Returns child nodes
Specified by:
getNodes in interface Category

getNode

public CategoryNode getNode(java.lang.String name)
Returns a subcategory of name .
Specified by:
getNode in interface Category

addNodeAfter

public void addNodeAfter(CategoryNode node,
                         java.lang.String prevNodeName)

This method is used to place a Category Node under us. This method adds a new node into this category, after prevNodeName if prevNodeName is not null, or at the end of the category if it is.

Specified by:
addNodeAfter in interface Category
Parameters:
node - Node to place under this category
prevNodeName - the name of the node that the new node is to be added after
See Also:
Category

addNodeBefore

public void addNodeBefore(CategoryNode node,
                          java.lang.String nextNodeName)

This method is used to place a Category Node under us. This method adds a new node into this category, before nextNodeName if nextNodeName is not null, or at the beginning of the category if it is.

Specified by:
addNodeBefore in interface Category
Parameters:
node - Node to place under this category
nextNodeName - the name of the node that the new node is to be added before, must not be path-qualified.
See Also:
Category

moveCategoryNode

public void moveCategoryNode(java.lang.String catPath,
                             java.lang.String prevNodeName)
This method can be used to move a Category from another Category to this Category, or to move a Category around within this Category.
Specified by:
moveCategoryNode in interface Category
Parameters:
node - Node to place under this category
prevNodeName - the name of the node that the new node is to be added after

removeNode

public void removeNode(CategoryNode node)
This method is used to remove a Category Node from under us. Note that removeNode assumes that it can recalculate the displayOrder values for other nodes in this category. This method should not be called if other nodes with prefixed displayOrder values are still to be added to this category, as from the DBStore file.
Specified by:
removeNode in interface Category

removeNode

public void removeNode(java.lang.String name)
This method is used to remove a Category Node from under us. Note that removeNode assumes that it can recalculate the displayOrder values for other nodes in this category. This method should not be called if other nodes with prefixed displayOrder values are still to be added to this category, as from the DBStore file.
Specified by:
removeNode in interface Category

newSubCategory

public Category newSubCategory()
This creates a new subcategory under this category, with displayOrder after the last item currently in the category. This method should only be called when there are no nodes left to be added to the category with prefixed displayOrder values.
Specified by:
newSubCategory in interface Category

isUnder

public boolean isUnder(Category cat)
This method returns true if this is a subcategory of cat.
Specified by:
isUnder in interface Category

getChunk

private java.lang.String getChunk(char[] chars,
                                  int startDex)