Package pal.misc
Class Identifier
- java.lang.Object
-
- pal.misc.Identifier
-
- All Implemented Interfaces:
java.io.Serializable,Nameable,Comparable
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.- Version:
- $Id: Identifier.java,v 1.9 2002/11/25 05:40:54 matt Exp $
- Author:
- Alexei Drummond
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static IdentifierANONYMOUS
-
Constructor Summary
Constructors Constructor Description Identifier()Identifier(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object c)Returns a number representing the ordering relationship that the object has with the given object.booleanequals(java.lang.Object c)Returns true if this object is equal to the given object.static Identifier[]getIdentifiers(java.lang.String[] names)Translates an an array of strings into an array of identifiersstatic Identifier[]getIdentifiers(IdGroup idGroup)Translates an IdGroup into an array of identifiersjava.lang.StringgetName()get the name of this object.static java.lang.String[]getNames(Identifier[] ids)Translates an array of identifiers into an array of stringsstatic java.lang.String[]getNames(Identifier[] ids, int toIgnore)Translates an array of identifiers into an array of strings, with optional removal of particular identifierstatic java.lang.String[]getNames(IdGroup ids)Translates an IdGroup into an array of stringsstatic java.lang.String[]getNames(IdGroup ids, int toIgnore)Translates an IDgroup into an array of strings, with optional removal of particular identifierstatic java.lang.String[]getNames(IdGroup ids, int[] toIgnore)Translates an IDgroup into an array of strings, with optional removal of particular identifiervoidsetName(java.lang.String s)set the name of this object.java.lang.StringtoString()
-
-
-
Field Detail
-
ANONYMOUS
public static Identifier ANONYMOUS
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object c)
Description copied from interface:ComparableReturns 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:
compareToin interfaceComparable
-
equals
public boolean equals(java.lang.Object c)
Description copied from interface:ComparableReturns true if this object is equal to the given object.- Specified by:
equalsin interfaceComparable- Overrides:
equalsin classjava.lang.Object
-
getName
public java.lang.String getName()
Description copied from interface:Nameableget the name of this object.
-
setName
public void setName(java.lang.String s)
Description copied from interface:Nameableset the name of this object.
-
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
-
getIdentifiers
public static final Identifier[] getIdentifiers(java.lang.String[] names)
Translates an an array of strings into an array of identifiers
-
getIdentifiers
public static final Identifier[] getIdentifiers(IdGroup idGroup)
Translates an IdGroup into an array of identifiers
-
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
-
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 indexes of an idetifier to ignore, does not need to be sorted
-
-