public final class SampleIds
extends java.lang.Object
Class SampleIds
is a singleton class that represents a
list of sample identifiers.
SampleIds
is thread-safe.Modifier and Type | Method and Description |
---|---|
int |
getIndex(java.lang.String id)
Returns the index of the specified sample identifier.
|
int |
getIndexIfIndexed(java.lang.String id)
Returns the index of the specified sampled identifier, or returns
-1 if the specified sample identifier is not indexed. |
java.lang.String |
id(int index)
Returns the sample identifier with the specified index.
|
java.lang.String[] |
ids()
Returns the list of indexed sample identifiers as an array.
|
static SampleIds |
instance()
Returns the singleton
SampleIds instance. |
int |
size()
Returns the number of indexed sample identifiers.
|
java.lang.String |
toString()
Returns
java.util.Arrays.toString(this.ids()) . |
public static SampleIds instance()
SampleIds
instance.SampleIds
instancepublic int getIndex(java.lang.String id)
id
- a sample identifierjava.lang.IllegalArgumentException
- if id.isEmpty()
java.lang.NullPointerException
- if id == null
public int getIndexIfIndexed(java.lang.String id)
-1
if the specified sample identifier is not indexed.id
- a sample identifiers-1
if the specified sample identifier is not indexedjava.lang.IllegalArgumentException
- if id.isEmpty()
java.lang.NullPointerException
- if id == null
public int size()
public java.lang.String id(int index)
index
- a sample identifier indexjava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.size()
public java.lang.String[] ids()
this.size()
, and
it will satisfy
this.ids()[k].equals(this.id(k)) == true
for 0 <= k && k < this.size()
.public java.lang.String toString()
java.util.Arrays.toString(this.ids())
.toString
in class java.lang.Object
this