Class LineStyleType

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

public class LineStyleType
extends java.lang.Object
This class contains extensible enum for lineStyle or borderStyle property. Line style can be either solid, dashed or double. Used for lineStyle of LineElement or borderStyle of ShapedElement.
Author:
unknown, finterly
  • Field Summary

    Fields
    Modifier and Type Field Description
    static LineStyleType DASHED  
    static LineStyleType DOUBLE  
    private java.lang.String name  
    private static java.util.Map<java.lang.String,​LineStyleType> nameToLineStyleType  
    static LineStyleType SOLID  
  • Constructor Summary

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

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

    Methods inherited from class java.lang.Object

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

    • nameToLineStyleType

      private static java.util.Map<java.lang.String,​LineStyleType> nameToLineStyleType
    • SOLID

      public static final LineStyleType SOLID
    • DASHED

      public static final LineStyleType DASHED
    • DOUBLE

      public static final LineStyleType DOUBLE
    • name

      private java.lang.String name
  • Constructor Details

    • LineStyleType

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

    • register

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

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

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

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

      public static LineStyleType[] getValues()
      Returns the line style type values of all LineStyleType as an array.
      Returns:
      lineStyleTypes the list of all registered LineStyleType.
    • toString

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