public final class ChromIds
extends java.lang.Object
Class ChromIds is a singleton class that represents a
list of chromosome identifiers.
ChromIds is thread-safe.| Modifier and Type | Method and Description |
|---|---|
int |
getIndex(java.lang.String id)
Returns the index of the specified chromosome identifier.
|
int |
getIndexIfIndexed(java.lang.String id)
Returns the index of the specified chromosome identifier, or returns
-1 if the specified chromosome identifier is not indexed. |
java.lang.String |
id(int index)
Returns the chromosome identifier with the specified index.
|
java.lang.String[] |
ids()
Returns the list of chromosome identifiers as an array.
|
static ChromIds |
instance()
Returns the singleton
ChromIds instance. |
int |
size()
Returns the number of indexed chromosomes identifiers.
|
java.lang.String |
toString()
Returns
java.util.Arrays.toString(this.ids()). |
public static ChromIds instance()
ChromIds instance.ChromIds instancepublic int getIndex(java.lang.String id)
id - a chromosome identifierjava.lang.IllegalArgumentException - if id.isEmpty()java.lang.NullPointerException - if id == nullpublic int getIndexIfIndexed(java.lang.String id)
-1 if the specified chromosome identifier is not indexed.id - a chromosome identifier.-1 if the specified chromosome identifier is not indexed.java.lang.IllegalArgumentException - if id.isEmpty()java.lang.NullPointerException - if id == nullpublic int size()
public java.lang.String id(int index)
index - a chromosome identifier index.java.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 < this.size().public java.lang.String toString()
java.util.Arrays.toString(this.ids()).toString in class java.lang.Objectthis