Package pal.misc
Class SimpleIdGroup
java.lang.Object
pal.misc.SimpleIdGroup
- All Implemented Interfaces:
Serializable
,IdGroup
,Nameable
Default implementation of IdGroup interface.
Memory-inefficient to allow fast whichIdNumber calls.
- Version:
- $Id: SimpleIdGroup.java,v 1.8 2001/11/26 03:59:24 matt Exp $
- Author:
- Alexei Drummond
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface pal.misc.IdGroup
IdGroup.Utils
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleIdGroup
(int size) Constructor taking the size of the group.SimpleIdGroup
(int size, boolean createIDs) Constructor taking the size of the group.SimpleIdGroup
(String[] labels) Constructor taking an array of strings.SimpleIdGroup
(Identifier[] id) Constructor taking an array of identifiers.Impersonating Constructor.SimpleIdGroup
(IdGroup a, int toIgnore) Impersonating Constructor.SimpleIdGroup
(IdGroup a, IdGroup b) Constructor taking two separate id groups and merging them. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of identifiers in this groupgetIdentifier
(int i) Returns the ith identifier.getName()
Return the name of this IdGroup.final String
getName
(int i) Convenience method to return the name of identifier ivoid
setIdentifier
(int i, Identifier id) Sets the ith identifier.void
Sets the name of this IdGroup.toString()
Returns a string representation of this IdGroup in the form of a bracketed list.int
whichIdNumber
(String name) Return index of identifier with name or -1 if not found
-
Constructor Details
-
SimpleIdGroup
public SimpleIdGroup(int size) Constructor taking the size of the group. -
SimpleIdGroup
Constructor taking an array of strings. -
SimpleIdGroup
public SimpleIdGroup(int size, boolean createIDs) Constructor taking the size of the group.- Parameters:
size
- - the number of idscreateIDs
- - if true creates default Identifiers. Otherwise leaves blank (for user to fill in)
-
SimpleIdGroup
Constructor taking an array of identifiers. -
SimpleIdGroup
Constructor taking two separate id groups and merging them. -
SimpleIdGroup
Impersonating Constructor. -
SimpleIdGroup
Impersonating Constructor.- Parameters:
toIgnore
- - will ignore the identifier at the index specified by toIgnore
-
-
Method Details
-
getIdCount
public int getIdCount()Returns the number of identifiers in this group- Specified by:
getIdCount
in interfaceIdGroup
-
getIdentifier
Returns the ith identifier.- Specified by:
getIdentifier
in interfaceIdGroup
-
getName
Convenience method to return the name of identifier i -
setIdentifier
Sets the ith identifier.- Specified by:
setIdentifier
in interfaceIdGroup
-
whichIdNumber
Return index of identifier with name or -1 if not found- Specified by:
whichIdNumber
in interfaceIdGroup
-
toString
Returns a string representation of this IdGroup in the form of a bracketed list. -
getName
Return the name of this IdGroup. -
setName
Sets the name of this IdGroup.
-