java.lang.Object
org.jgrapht.nio.DefaultAttribute<T>
- Type Parameters:
T- the underlying type
- All Implemented Interfaces:
java.io.Serializable,Attribute
public class DefaultAttribute<T> extends java.lang.Object implements Attribute, java.io.Serializable
Default implementation of an attribute.
- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DefaultAttribute(T value, AttributeType type)Create a new attribute -
Method Summary
Modifier and Type Method Description static AttributecreateAttribute(java.lang.Boolean value)Create a boolean attributestatic AttributecreateAttribute(java.lang.Double value)Create a double attributestatic AttributecreateAttribute(java.lang.Float value)Create a float attributestatic AttributecreateAttribute(java.lang.Integer value)Create an integer attributestatic AttributecreateAttribute(java.lang.Long value)Create a long attributestatic AttributecreateAttribute(java.lang.String value)Create a string attributebooleanequals(java.lang.Object obj)AttributeTypegetType()Get the type of the attributejava.lang.StringgetValue()Get the string value of the attributeinthashCode()java.lang.StringtoString()
-
Field Details
-
NULL
The null attribute.
-
-
Constructor Details
-
DefaultAttribute
Create a new attribute- Parameters:
value- the valuetype- the type
-
-
Method Details
-
getValue
public java.lang.String getValue()Get the string value of the attribute -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getType
Get the type of the attribute -
createAttribute
Create a boolean attribute- Parameters:
value- the value- Returns:
- the attribute
-
createAttribute
Create an integer attribute- Parameters:
value- the value- Returns:
- the attribute
-
createAttribute
Create a long attribute- Parameters:
value- the value- Returns:
- the attribute
-
createAttribute
Create a float attribute- Parameters:
value- the value- Returns:
- the attribute
-
createAttribute
Create a double attribute- Parameters:
value- the value- Returns:
- the attribute
-
createAttribute
Create a string attribute- Parameters:
value- the value- Returns:
- the attribute
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-