Package org.pathvisio.libgpml.model.type
Class StateType
java.lang.Object
org.pathvisio.libgpml.model.type.StateType
public class StateType
extends java.lang.Object
This class contains extensible enum for state types.
NB: State type is in the GPML2013a schema, but was never implemented/written
for GPML2013a files.
- Author:
- finterly
-
Field Summary
Fields Modifier and Type Field Description static StateTypeEPIGENETIC_MODIFICATIONstatic StateTypeGENETIC_VARIANTprivate java.lang.Stringnameprivate static java.util.Map<java.lang.String,StateType>nameToStateTypestatic StateTypePROTEIN_MODIFICATIONstatic StateTypeUNDEFINED -
Constructor Summary
Constructors Modifier Constructor Description privateStateType(java.lang.String name)The constructor is private. -
Method Summary
Modifier and Type Method Description static StateTypefromName(java.lang.String name)Returns the StateType from given string name.java.lang.StringgetName()Returns the name key for this StateType.static java.lang.String[]getNames()Returns the names of all registered StateTypes as an array.static StateType[]getValues()Returns the state type values of all StateTypes as an array.static StateTyperegister(java.lang.String name)Returns a StateType from a given string identifier name.java.lang.StringtoString()Returns a string representation of this StateType.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
nameToStateType
-
UNDEFINED
-
PROTEIN_MODIFICATION
-
GENETIC_VARIANT
-
EPIGENETIC_MODIFICATION
-
name
private java.lang.String name
-
-
Constructor Details
-
StateType
private StateType(java.lang.String name)The constructor is private. StateType cannot be directly instantiated. Use create() method to instantiate StateType.- Parameters:
name- the key of this StateType.- Throws:
java.lang.NullPointerException- if name is null.
-
-
Method Details
-
register
Returns a StateType from a given string identifier name. If the StateType doesn't exist yet, it is created to extend the enum. The method makes sure that the same object is not added twice.- Parameters:
name- the string key.- Returns:
- the StateType for given name. If name does not exist, creates and returns a new StateType.
-
getName
public java.lang.String getName()Returns the name key for this StateType.- Returns:
- name the key for this StateType.
-
fromName
Returns the StateType from given string name.- Parameters:
name- the string key.- Returns:
- the StateType with given string name.
-
getNames
public static java.lang.String[] getNames()Returns the names of all registered StateTypes as an array.- Returns:
- names the names of all registered StateTypes in order of insertion.
-
getValues
Returns the state type values of all StateTypes as an array.- Returns:
- stateTypes the list of all registered StateTypes.
-
toString
public java.lang.String toString()Returns a string representation of this StateType.- Overrides:
toStringin classjava.lang.Object- Returns:
- name the identifier of this StateType.
-