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 StateType EPIGENETIC_MODIFICATION  
    static StateType GENETIC_VARIANT  
    private java.lang.String name  
    private static java.util.Map<java.lang.String,​StateType> nameToStateType  
    static StateType PROTEIN_MODIFICATION  
    static StateType UNDEFINED  
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    private StateType​(java.lang.String name)
    The constructor is private.
  • Method Summary

    Modifier and Type Method Description
    static StateType fromName​(java.lang.String name)
    Returns the StateType from given string name.
    java.lang.String getName()
    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 StateType register​(java.lang.String name)
    Returns a StateType from a given string identifier name.
    java.lang.String toString()
    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

      private static java.util.Map<java.lang.String,​StateType> nameToStateType
    • UNDEFINED

      public static final StateType UNDEFINED
    • PROTEIN_MODIFICATION

      public static final StateType PROTEIN_MODIFICATION
    • GENETIC_VARIANT

      public static final StateType GENETIC_VARIANT
    • EPIGENETIC_MODIFICATION

      public static final StateType 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

      public static StateType register​(java.lang.String name)
      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

      public static StateType fromName​(java.lang.String name)
      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

      public static StateType[] 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:
      toString in class java.lang.Object
      Returns:
      name the identifier of this StateType.