arlut.csd.ganymede.client
Class objectList

java.lang.Object
  |
  +--arlut.csd.ganymede.client.objectList

public class objectList
extends java.lang.Object

This class is used to keep track of a list of ObjectHandle objects from the server, storing various pieces of information about the objects, including their expiration/removal/inactive status, their current label, and more.


Field Summary
private  java.util.Vector activeHandles
           
(package private)  boolean activeSorted
           
(package private) static Compare comparator
           
(package private)  boolean containsNonEditable
           
(package private) static boolean debug
           
private  java.util.Vector handles
           
(package private)  VecSortInsert inserter
           
private  java.util.Hashtable invids
           
(package private)  boolean sorted
           
 
Constructor Summary
objectList(QueryResult result)
           
 
Method Summary
 void addObjectHandle(ObjectHandle handle)
          This method adds an object handle to this list, quickly, in sorted order.
 void augmentListWithNonEditables(QueryResult result)
          This method is used to augment an object list with non-editables.
 boolean containsNonEditable()
          This method returns true if this list contains any non-editable handles.
 java.util.Vector getLabels(boolean includeInactives)
          This method returns a sorted Vector of object labels.
 java.util.Vector getLabels(boolean includeInactives, boolean includeNonEditables)
          This method returns a sorted Vector of object labels.
 java.util.Vector getListHandles(boolean includeInactives)
          This method returns a sorted Vector of listHandles.
 java.util.Vector getListHandles(boolean includeInactives, boolean includeNonEditables)
          This method returns a sorted Vector of listHandles.
 ObjectHandle getObjectHandle(Invid invid)
          This method returns a live reference to the object handle corresponding to invid, or null if none such is in this object list.
 java.util.Vector getObjectHandles(boolean includeInactives)
          This method returns a sorted copy of an object handles vector.
 java.util.Vector getObjectHandles(boolean includeInactives, boolean includeNonEditables)
          This method returns a sorted copy of an object handles vector.
 void relabelObject(Invid invid, java.lang.String newLabel)
          This method relabels an object handle in this list.
 ObjectHandle removeInvid(Invid invid)
          This method removes object handles matching the given invid from the object list.
private  void sortHandles()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

debug

static final boolean debug

comparator

static Compare comparator

inserter

VecSortInsert inserter

handles

private java.util.Vector handles

sorted

boolean sorted

activeHandles

private java.util.Vector activeHandles

invids

private java.util.Hashtable invids

activeSorted

boolean activeSorted

containsNonEditable

boolean containsNonEditable
Constructor Detail

objectList

public objectList(QueryResult result)
Method Detail

containsNonEditable

public boolean containsNonEditable()
This method returns true if this list contains any non-editable handles.

augmentListWithNonEditables

public void augmentListWithNonEditables(QueryResult result)
This method is used to augment an object list with non-editables.

getListHandles

public java.util.Vector getListHandles(boolean includeInactives)
This method returns a sorted Vector of listHandles. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects

getListHandles

public java.util.Vector getListHandles(boolean includeInactives,
                                       boolean includeNonEditables)
This method returns a sorted Vector of listHandles. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects
includeNonEditables - if false, the list returned will not include entries for any non-editable objects

getLabels

public java.util.Vector getLabels(boolean includeInactives)
This method returns a sorted Vector of object labels. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects

getLabels

public java.util.Vector getLabels(boolean includeInactives,
                                  boolean includeNonEditables)
This method returns a sorted Vector of object labels. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects
includeNonEditables - if false, the list returned will not include entries for any non-editable objects

getObjectHandles

public java.util.Vector getObjectHandles(boolean includeInactives)
This method returns a sorted copy of an object handles vector. No adds or deletes to the returned vector will be reflected in this objectList, but any changes to the status of the individual ObjectHandle's will be reflected in the objectList.

getObjectHandles

public java.util.Vector getObjectHandles(boolean includeInactives,
                                         boolean includeNonEditables)
This method returns a sorted copy of an object handles vector. No adds or deletes to the returned vector will be reflected in this objectList, but any changes to the status of the individual ObjectHandle's will be reflected in the objectList.

relabelObject

public void relabelObject(Invid invid,
                          java.lang.String newLabel)
This method relabels an object handle in this list. Use this method rather than changing an object handle reference got by getObjectHandle() in order to let objectList maintain sort order.

addObjectHandle

public void addObjectHandle(ObjectHandle handle)
This method adds an object handle to this list, quickly, in sorted order.

getObjectHandle

public ObjectHandle getObjectHandle(Invid invid)
This method returns a live reference to the object handle corresponding to invid, or null if none such is in this object list.

removeInvid

public ObjectHandle removeInvid(Invid invid)
This method removes object handles matching the given invid from the object list. This isn't the fastest operation, but hopefully won't be too bad.
Returns:
The handle removed, or null if it wasn't found.

toString

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

sortHandles

private void sortHandles()