pal.misc
Class Identifier

java.lang.Object
  |
  +--pal.misc.Identifier
All Implemented Interfaces:
Comparable, Nameable, java.io.Serializable

public class Identifier
extends java.lang.Object
implements java.io.Serializable, Comparable, Nameable

An identifier for some sampled data. This will most often be for example, the accession number of a DNA sequence, or the taxonomic name that the sequence represents, et cetera.

See Also:
Serialized Form

Field Summary
static Identifier ANONYMOUS
           
 
Constructor Summary
Identifier()
           
Identifier(java.lang.String name)
           
 
Method Summary
 int compareTo(java.lang.Object c)
          Returns a number representing the ordering relationship that the object has with the given object.
 boolean equals(java.lang.Object c)
          Returns true if this object is equal to the given object.
 java.lang.String getName()
          get the name of this object.
static java.lang.String[] getNames(Identifier[] ids)
          Translates an array of identifiers into an array of strings
static java.lang.String[] getNames(Identifier[] ids, int toIgnore)
          Translates an array of identifiers into an array of strings, with optional removal of particular identifier
static java.lang.String[] getNames(IdGroup ids)
          Translates an IdGroup into an array of strings
static java.lang.String[] getNames(IdGroup ids, int toIgnore)
          Translates an IDgroup into an array of strings, with optional removal of particular identifier
 void setName(java.lang.String s)
          set the name of this object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANONYMOUS

public static Identifier ANONYMOUS
Constructor Detail

Identifier

public Identifier()

Identifier

public Identifier(java.lang.String name)
Method Detail

toString

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

compareTo

public int compareTo(java.lang.Object c)
Description copied from interface: Comparable
Returns a number representing the ordering relationship that the object has with the given object. A negative number indicates that the object is "smaller" than the parameter, a positive number means it is "larger" and zero indicates that the objects are equal.
Specified by:
compareTo in interface Comparable

equals

public boolean equals(java.lang.Object c)
Description copied from interface: Comparable
Returns true if this object is equal to the given object.
Specified by:
equals in interface Comparable
Overrides:
equals in class java.lang.Object

getName

public java.lang.String getName()
Description copied from interface: Nameable
get the name of this object.
Specified by:
getName in interface Nameable
Following copied from interface: pal.misc.Nameable
Returns:
name of this object.

setName

public void setName(java.lang.String s)
Description copied from interface: Nameable
set the name of this object.
Specified by:
setName in interface Nameable
Following copied from interface: pal.misc.Nameable
Parameters:
name - the new name.

getNames

public static final java.lang.String[] getNames(Identifier[] ids)
Translates an array of identifiers into an array of strings

getNames

public static final java.lang.String[] getNames(Identifier[] ids,
                                                int toIgnore)
Translates an array of identifiers into an array of strings, with optional removal of particular identifier
Parameters:
toIgnoreIndex - the index of an idetifier to ignore, if <0 no element is ignored

getNames

public static final java.lang.String[] getNames(IdGroup ids)
Translates an IdGroup into an array of strings

getNames

public static final java.lang.String[] getNames(IdGroup ids,
                                                int toIgnore)
Translates an IDgroup into an array of strings, with optional removal of particular identifier
Parameters:
toIgnoreIndex - the index of an idetifier to ignore, if <0 no element is ignored