Class AnchorShapeType

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

public class AnchorShapeType
extends java.lang.Object
This class contains extensible enum for Anchor type property.
Author:
unknown, finterly
  • Field Summary

    Fields
    Modifier and Type Field Description
    static AnchorShapeType CIRCLE  
    private boolean disallowLinks  
    private java.lang.String name  
    private static java.util.Map<java.lang.String,​AnchorShapeType> nameToAnchorShapeType  
    static AnchorShapeType NONE  
    static AnchorShapeType SQUARE  
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    private AnchorShapeType​(java.lang.String name)
    Constructor to initialize the state of enum types without disallowLinks.
    private AnchorShapeType​(java.lang.String name, boolean disallowLinks)
    Constructor to initialize the state of enum types.
  • Method Summary

    Modifier and Type Method Description
    int compareTo​(AnchorShapeType o)
    Compares string representations of given AnchorType lexicographically.
    static AnchorShapeType fromName​(java.lang.String name)
    Returns the AnchorType from given string name.
    java.lang.String getName()
    Returns the name key for this AnchorType.
    static java.lang.String[] getNames()
    Returns the names of all registered AnchorTypes as a String array.
    static AnchorShapeType[] getValues()
    Returns the anchor type values of all AnchorTypes as a list.
    boolean isDisallowLinks()
    Returns the booleans disallowLinks.
    static AnchorShapeType register​(java.lang.String name)
    Returns an AnchorType from a given string identifier name.
    java.lang.String toString()
    Returns a string representation of this AnchorShapeType.

    Methods inherited from class java.lang.Object

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

    • nameToAnchorShapeType

      private static java.util.Map<java.lang.String,​AnchorShapeType> nameToAnchorShapeType
    • NONE

      public static final AnchorShapeType NONE
    • SQUARE

      public static final AnchorShapeType SQUARE
    • CIRCLE

      public static final AnchorShapeType CIRCLE
    • name

      private java.lang.String name
  • Constructor Details

    • AnchorShapeType

      private AnchorShapeType​(java.lang.String name, boolean disallowLinks)
      Constructor to initialize the state of enum types.
      Parameters:
      name - the string key.
      disallowLinks - the boolean if set to true nothing will be able to attach to this anchor
    • AnchorShapeType

      private AnchorShapeType​(java.lang.String name)
      Constructor to initialize the state of enum types without disallowLinks.
      Parameters:
      name - the string key.
  • Method Details

    • register

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

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

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

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

      public static AnchorShapeType[] getValues()
      Returns the anchor type values of all AnchorTypes as a list.
      Returns:
      anchorTypes the list of all registered AnchorType.
    • isDisallowLinks

      public boolean isDisallowLinks()
      Returns the booleans disallowLinks.
      Returns:
      disallowLinks the boolean if set to true nothing will be able to attach to this anchor
    • toString

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

      public int compareTo​(AnchorShapeType o)
      Compares string representations of given AnchorType lexicographically.
      Returns:
      positive number (integer difference of character value) if first string is lexicographically greater than second string, negative number if first string is less than second string lexicographically, and 0 if first string is lexicographically equal to second string.