com.phoenix_int.aserver
Class PHXGroup

java.lang.Object
  extended by com.phoenix_int.aserver.PHXGroup

public class PHXGroup
extends java.lang.Object

A utility class for holding sub-variables. Internally used to manage groups of variables within the PHXSimpleSelfManager class. To create your own groups, use the PHXSimpleSelfManager.addVariable() function.

See Also:
PHXSimpleSelfManager

Constructor Summary
PHXGroup(java.lang.String name)
           
 
Method Summary
 void addGroup(PHXGroup group)
          adds a child group to the group
 void addVariable(PHXVariableInfo varInfo)
          stores a variable in the group.
 boolean contains(PHXVariableInfo varInfo)
          checks to see if a variable exists in this group
 PHXGroup getGroup(java.lang.String childName)
          retrieves a child group.
 java.util.Enumeration getGroups()
          retrieves the Enumeration of subgroups in the group.
 java.lang.String getName()
          retrieves the name of the group
 int getNumGroups()
          retrieves the number of subgroups in the group.
 int getNumVariables()
          retrieves the number of variables in the group.
 PHXVariableInfo getVariableInfo(java.lang.String varName)
          retrieves a variable from the group.
 java.util.Enumeration getVariables()
          retrieves the Enumeration of variables in the group.
 PHXGroup makeGroup(java.lang.String childName)
          creates a child group.
 void removeAllGroups()
          remove all groups from the group
 void removeAllVariables()
          removes all variables from the group
 void removeGroup(java.lang.String childName)
          remove a child group.
 void removeVariable(PHXVariableInfo varInfo)
          removes a variable
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PHXGroup

public PHXGroup(java.lang.String name)
         throws PHXInvalidNameException
Parameters:
name - the name of the group
Throws:
PHXInvalidNameException
Method Detail

getName

public java.lang.String getName()
retrieves the name of the group

Returns:
the name of the group

addGroup

public void addGroup(PHXGroup group)
              throws PHXNameAlreadyInUseException,
                     PHXInvalidNameException
adds a child group to the group

Parameters:
group - the child group
Throws:
PHXNameAlreadyInUseException
PHXInvalidNameException

getGroup

public PHXGroup getGroup(java.lang.String childName)
                  throws PHXNoSuchObjectException
retrieves a child group.

Parameters:
childName - the name of the child group
Returns:
the child group
Throws:
PHXNoSuchObjectException - thrown if the child group is not found

makeGroup

public PHXGroup makeGroup(java.lang.String childName)
                   throws PHXNameAlreadyInUseException,
                          PHXInvalidNameException
creates a child group. If the group already exists, it is retrieved

Parameters:
childName - the name of the child group
Returns:
the child group
Throws:
PHXNameAlreadyInUseException
PHXInvalidNameException

removeGroup

public void removeGroup(java.lang.String childName)
                 throws java.lang.Exception
remove a child group. If the group doesn't exist, it just returns

Parameters:
childName - the name of the child group
Throws:
java.lang.Exception

getNumGroups

public int getNumGroups()
retrieves the number of subgroups in the group.

Returns:
the number of subgroups

getGroups

public java.util.Enumeration getGroups()
retrieves the Enumeration of subgroups in the group.

Returns:
an Enumeration of PHXGroup objects

addVariable

public void addVariable(PHXVariableInfo varInfo)
                 throws PHXNameAlreadyInUseException,
                        PHXInvalidNameException
stores a variable in the group.

Parameters:
varInfo - the variable info structure
Throws:
PHXNameAlreadyInUseException
PHXInvalidNameException

getVariableInfo

public PHXVariableInfo getVariableInfo(java.lang.String varName)
                                throws PHXNoSuchObjectException
retrieves a variable from the group.

Parameters:
varName - the name of the variable to get
Returns:
the variable info structure
Throws:
PHXNoSuchObjectException - thrown if the specified variable is not found

contains

public boolean contains(PHXVariableInfo varInfo)
checks to see if a variable exists in this group

Parameters:
varName - the name of the variable to check
Returns:
true if the variable is in this group

getNumVariables

public int getNumVariables()
retrieves the number of variables in the group.

Returns:
the number of variables

getVariables

public java.util.Enumeration getVariables()
retrieves the Enumeration of variables in the group.

Returns:
an Enumeration of PHXVariableInfo objects

removeAllVariables

public void removeAllVariables()
removes all variables from the group


removeAllGroups

public void removeAllGroups()
remove all groups from the group


removeVariable

public void removeVariable(PHXVariableInfo varInfo)
removes a variable

Parameters:
varInfo - the variable structure to remove

toString

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