- java.lang.Object
-
- org.arakhne.afc.attrs.attr.AttributeValueImpl
-
- org.arakhne.afc.attrs.attr.AttributeImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Attribute
,AttributeValue
,JsonableObject
public class AttributeImpl extends AttributeValueImpl implements Attribute
This class contains an attribute value.- Version:
- 17.0 2020-01-04 14:41:51
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- attributes
-
-
Constructor Summary
Constructors Constructor Description AttributeImpl()
Uninitialized attribute.AttributeImpl(String name)
Uninitialized attribute.AttributeImpl(String name, boolean value)
Constructor from the given value.AttributeImpl(String name, double value)
Constructor from the given value.AttributeImpl(String name, double x, double y)
Constructor from the given value.AttributeImpl(String name, double x, double y, double z)
Constructor from the given value.AttributeImpl(String name, float value)
Constructor from the given value.AttributeImpl(String name, float x, float y)
Constructor from the given value.AttributeImpl(String name, float x, float y, float z)
Constructor from the given value.AttributeImpl(String name, int value)
Constructor from the given value.AttributeImpl(String name, long value)
Constructor from the given value.AttributeImpl(String name, Class<?> value)
Constructor from the given value.AttributeImpl(String name, Enum<?> value)
Constructor from the given value.AttributeImpl(String name, Object value)
Constructor from the given value.AttributeImpl(String name, String value)
Constructor from the given value.AttributeImpl(String name, InetAddress value)
Constructor from the given value.AttributeImpl(String name, InetSocketAddress value)
Constructor from the given value.AttributeImpl(String name, URI value)
Constructor from the given value.AttributeImpl(String name, URL value)
Constructor from the given value.AttributeImpl(String name, Date value)
Constructor from the given value.AttributeImpl(String name, UUID value)
Constructor from the given value.AttributeImpl(String name, AttributeType type)
Uninitialized attribute.AttributeImpl(String name, AttributeType type, Object rawValue)
Initialized attribute with the given raw value.AttributeImpl(String name, AttributeValue value)
Constructor from the given value.AttributeImpl(String name, Point2D<?,?> value)
Constructor from the given value.AttributeImpl(String name, Point2D<?,?>[] value)
Constructor from the given value.AttributeImpl(String name, Point3D<?,?> value)
Constructor from the given value.AttributeImpl(String name, Point3D<?,?>[] value)
Constructor from the given value.AttributeImpl(Attribute value)
Constructor from the given value.AttributeImpl(AttributeType type)
Uninitialized attribute.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertAssignedAndNotNull()
Assert that the attribute value was assigned and notnull
.Comparator<? extends Attribute>
comparator()
Replies a comparator suitable for attribute based on the names of the attributes only.static int
compareAttrNames(String arg0, String arg1)
Compare the two specified attribute names.static int
compareAttrs(Attribute arg0, Attribute arg1)
Compare the two specified attributes.boolean
equals(Object obj)
String
getName()
Replies the name of the metadata.int
hashCode()
Comparator<? extends Attribute>
nameComparator()
Replies a comparator suitable for attribute based on the names of the attributes only.void
setAttribute(Attribute value)
The this value with the content of the specified one.void
setName(String name)
Set the name of this metadata.void
toJson(JsonBuffer buffer)
Replies the Json representation of this node.-
Methods inherited from class org.arakhne.afc.attrs.attr.AttributeValueImpl
addToPolyline, addToPolyline, addToPolyline3D, addToPolyline3D, cast, castAndSet, compareValues, flush, getBoolean, getDate, getEnumeration, getEnumeration, getInetAddress, getInteger, getInternalStorageType, getJavaClass, getJavaObject, getPoint, getPoint3D, getPolyline, getPolyline3D, getReal, getString, getTimestamp, getType, getURI, getURL, getUUID, getValue, isAssignableFrom, isAssignableFrom, isAssigned, isBaseType, isNullAllowed, isObjectValue, parse, setBoolean, setDate, setEnumeration, setInetAddress, setInetAddress, setInetAddress, setInteger, setInteger, setInternalValue, setInternalValue, setJavaClass, setJavaObject, setPoint, setPoint, setPoint3D, setPoint3D, setPolyline, setPolyline, setPolyline3D, setPolyline3D, setReal, setString, setTimestamp, setToDefault, setToDefaultIfUninitialized, setType, setURI, setURI, setURL, setURL, setUUID, setUUID, setValue, setValue, toString, uninitializeValue, valueComparator
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.attr.AttributeValue
addToPolyline, addToPolyline, addToPolyline3D, addToPolyline3D, cast, castAndSet, flush, getBoolean, getDate, getEnumeration, getEnumeration, getInetAddress, getInteger, getInternalStorageType, getJavaClass, getJavaObject, getPoint, getPoint3D, getPolyline, getPolyline3D, getReal, getString, getTimestamp, getType, getURI, getURL, getUUID, getValue, isAssignableFrom, isAssignableFrom, isAssigned, isBaseType, isNullAllowed, isObjectValue, setBoolean, setDate, setEnumeration, setInetAddress, setInteger, setInteger, setJavaClass, setJavaObject, setPoint, setPoint, setPoint3D, setPoint3D, setPolyline, setPolyline, setPolyline3D, setPolyline3D, setReal, setString, setTimestamp, setToDefault, setToDefaultIfUninitialized, setType, setURI, setURL, setUUID, setValue, setValue, uninitializeValue, valueComparator
-
-
-
-
Constructor Detail
-
AttributeImpl
public AttributeImpl()
Uninitialized attribute.
-
AttributeImpl
public AttributeImpl(AttributeType type)
Uninitialized attribute.- Parameters:
type
- is the type of the attribute.
-
AttributeImpl
public AttributeImpl(String name)
Uninitialized attribute.- Parameters:
name
- is the name of the attribute
-
AttributeImpl
public AttributeImpl(String name, AttributeType type)
Uninitialized attribute.- Parameters:
name
- is the name of the attributetype
- is the type of the attribute.
-
AttributeImpl
public AttributeImpl(String name, AttributeType type, Object rawValue)
Initialized attribute with the given raw value. The raw value must be compatible with the internal representation of the value.- Parameters:
name
- is the name of the attributetype
- is the type of the attribute.rawValue
- is the rawValue.
-
AttributeImpl
public AttributeImpl(String name, AttributeValue value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(Attribute value)
Constructor from the given value.- Parameters:
value
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, boolean value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, Date value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, float value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, double value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, int value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, long value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, Object value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, Point2D<?,?> value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, float x, float y)
Constructor from the given value.- Parameters:
name
- is the name of the attributex
- is the value of this new attribute.y
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, double x, double y)
Constructor from the given value.- Parameters:
name
- is the name of the attributex
- is the value of this new attribute.y
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, Point3D<?,?> value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, float x, float y, float z)
Constructor from the given value.- Parameters:
name
- is the name of the attributex
- is the value of this new attribute.y
- is the value of this new attribute.z
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, double x, double y, double z)
Constructor from the given value.- Parameters:
name
- is the name of the attributex
- is the value of this new attribute.y
- is the value of this new attribute.z
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, String value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, Point2D<?,?>[] value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, Point3D<?,?>[] value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, Enum<?> value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, InetAddress value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, InetSocketAddress value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, URI value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, URL value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
AttributeImpl
public AttributeImpl(String name, UUID value)
Constructor from the given value.- Parameters:
name
- is the name of the attributevalue
- is the value of this new attribute.
-
-
Method Detail
-
compareAttrs
@Pure public static int compareAttrs(Attribute arg0, Attribute arg1)
Compare the two specified attributes.- Parameters:
arg0
- first attributearg1
- second attribute.- Returns:
- replies a negative value if
arg0
is lesser thanarg1
, a positive value ifarg0
is greater thanarg1
, or0
if they are equal. - See Also:
AttributeComparator
-
compareAttrNames
@Pure public static int compareAttrNames(String arg0, String arg1)
Compare the two specified attribute names.- Parameters:
arg0
- first attribute.arg1
- second attribute.- Returns:
- replies a negative value if
arg0
is lesser thanarg1
, a positive value ifarg0
is greater thanarg1
, or0
if they are equal. - See Also:
AttributeNameComparator
-
equals
@Pure public boolean equals(Object obj)
- Overrides:
equals
in classAttributeValueImpl
-
hashCode
@Pure public int hashCode()
- Overrides:
hashCode
in classAttributeValueImpl
-
toJson
public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObject
Replies the Json representation of this node.- Specified by:
toJson
in interfaceJsonableObject
- Overrides:
toJson
in classAttributeValueImpl
- Parameters:
buffer
- the Json buffer.
-
assertAssignedAndNotNull
protected void assertAssignedAndNotNull() throws AttributeNotInitializedException
Assert that the attribute value was assigned and notnull
.- Overrides:
assertAssignedAndNotNull
in classAttributeValueImpl
- Throws:
AttributeNotInitializedException
- attribute not initialized.
-
getName
@Pure public String getName()
Description copied from interface:Attribute
Replies the name of the metadata.
-
setName
public void setName(String name)
Description copied from interface:Attribute
Set the name of this metadata.
-
setAttribute
public void setAttribute(Attribute value) throws InvalidAttributeTypeException
Description copied from interface:Attribute
The this value with the content of the specified one.- Specified by:
setAttribute
in interfaceAttribute
- Parameters:
value
- the value.- Throws:
InvalidAttributeTypeException
- when the type is incompatible.
-
nameComparator
@Pure public Comparator<? extends Attribute> nameComparator()
Description copied from interface:Attribute
Replies a comparator suitable for attribute based on the names of the attributes only.- Specified by:
nameComparator
in interfaceAttribute
- Returns:
- a comparator, never
null
- See Also:
AttributeValue.valueComparator()
,Attribute.comparator()
-
comparator
@Pure public Comparator<? extends Attribute> comparator()
Description copied from interface:Attribute
Replies a comparator suitable for attribute based on the names of the attributes only.- Specified by:
comparator
in interfaceAttribute
- Returns:
- a comparator, never
null
- See Also:
Attribute.nameComparator()
,AttributeValue.valueComparator()
-
-