Package org.pathvisio.libgpml.model.type
Class ConnectorType
java.lang.Object
org.pathvisio.libgpml.model.type.ConnectorType
public class ConnectorType
extends java.lang.Object
This class contains extensible enum for different connectorType property.
- Author:
- unknown, finterly
-
Field Summary
Fields Modifier and Type Field Description static ConnectorType
CURVED
static ConnectorType
ELBOW
private java.lang.String
name
private static java.util.Map<java.lang.String,ConnectorType>
nameToConnectorType
static ConnectorType
SEGMENTED
static ConnectorType
STRAIGHT
-
Constructor Summary
Constructors Modifier Constructor Description private
ConnectorType(java.lang.String name)
The constructor is private. -
Method Summary
Modifier and Type Method Description int
compareTo(ConnectorType connectorType)
Compares string representations of given ConnectorType lexicographically.static ConnectorType
fromName(java.lang.String name)
Returns the ConnectorType from given string name.java.lang.String
getName()
Returns the name key for this ConnectorType.static java.lang.String[]
getNames()
Returns the names of all registered ConnectorTypes as a String array.static ConnectorType[]
getValues()
Returns the connector type values of all ConnectorTypes as a list.static ConnectorType
register(java.lang.String name)
Returns a ConnectorType from a given name.java.lang.String
toString()
Returns a string representation of this ConnectorType.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
nameToConnectorType
-
STRAIGHT
-
ELBOW
-
CURVED
-
SEGMENTED
-
name
private java.lang.String name
-
-
Constructor Details
-
ConnectorType
private ConnectorType(java.lang.String name)The constructor is private. ConnectorType cannot be directly instantiated. Use create() method to instantiate ConnectorType.- Parameters:
name
- the string key.- Throws:
java.lang.NullPointerException
- if name is null.
-
-
Method Details
-
register
Returns a ConnectorType from a given name. If the ConnectorType 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 ConnectorType for given name or new ConnectorType if name does not exist.
-
getName
public java.lang.String getName()Returns the name key for this ConnectorType.- Returns:
- name the key for this ConnectorType.
-
fromName
Returns the ConnectorType from given string name.- Parameters:
name
- the string.- Returns:
- the ConnectorType with given string name.
-
getNames
public static java.lang.String[] getNames()Returns the names of all registered ConnectorTypes as a String array.- Returns:
- names the names of all registered ConnectorTypes in order of insertion.
-
getValues
Returns the connector type values of all ConnectorTypes as a list.- Returns:
- connectorTypes the list of all registered ConnectorTypes.
-
toString
public java.lang.String toString()Returns a string representation of this ConnectorType.- Overrides:
toString
in classjava.lang.Object
- Returns:
- name the identifier of this ConnectorType.
-
compareTo
Compares string representations of given ConnectorType lexicographically.- Parameters:
connectorType
-- 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.
-