Class AnnotationType

java.lang.Object
org.pathvisio.libgpml.model.type.AnnotationType

public class AnnotationType
extends java.lang.Object
This class contains extensible enum for Annotation type property.
Author:
finterly
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.lang.String name  
    private static java.util.Map<java.lang.String,​AnnotationType> nameToAnnotationType  
    static AnnotationType ONTOLOGY  
    static AnnotationType TAXONOMY  
    static AnnotationType UNDEFINED  
  • Constructor Summary

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

    Modifier and Type Method Description
    static AnnotationType fromName​(java.lang.String name)
    Returns the AnnotationType from given string name.
    java.lang.String getName()
    Returns the name key for this AnnotationType.
    static java.lang.String[] getNames()
    Returns the names of all registered AnnotationTypes as a String array.
    static AnnotationType[] getValues()
    Returns the annotation type values of all AnnotationTypes as a list.
    static AnnotationType register​(java.lang.String name)
    Returns an AnnotationType from a given string identifier name.
    java.lang.String toString()
    Returns a string representation of this AnnotationType.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • nameToAnnotationType

      private static java.util.Map<java.lang.String,​AnnotationType> nameToAnnotationType
    • UNDEFINED

      public static final AnnotationType UNDEFINED
    • ONTOLOGY

      public static final AnnotationType ONTOLOGY
    • TAXONOMY

      public static final AnnotationType TAXONOMY
    • name

      private java.lang.String name
  • Constructor Details

    • AnnotationType

      private AnnotationType​(java.lang.String name)
      The constructor is private. AnnotationType cannot be directly instantiated. Use create() method to instantiate AnnotationType.
      Parameters:
      name - the string key of this AnnotationType.
      Throws:
      java.lang.NullPointerException - if name is null.
  • Method Details

    • register

      public static AnnotationType register​(java.lang.String name)
      Returns an AnnotationType from a given string identifier name. If the AnnotationType 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 AnnotationType for given name. If name does not exist, creates and returns a new AnnotationType.
    • getName

      public java.lang.String getName()
      Returns the name key for this AnnotationType.
      Returns:
      name the key for this AnnotationType.
    • fromName

      public static AnnotationType fromName​(java.lang.String name)
      Returns the AnnotationType from given string name.
      Parameters:
      name - the string.
      Returns:
      the AnnotationType with given string name.
    • getNames

      public static java.lang.String[] getNames()
      Returns the names of all registered AnnotationTypes as a String array.
      Returns:
      names the names of all registered AnnotationTypes in order of insertion.
    • getValues

      public static AnnotationType[] getValues()
      Returns the annotation type values of all AnnotationTypes as a list.
      Returns:
      annotationTypes the list of all registered AnnotationTypes.
    • toString

      public java.lang.String toString()
      Returns a string representation of this AnnotationType.
      Overrides:
      toString in class java.lang.Object
      Returns:
      name the identifier of this AnnotationType.