Class AttributeValueImpl
- java.lang.Object
-
- org.arakhne.afc.attrs.attr.AttributeValueImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,AttributeValue
,JsonableObject
- Direct Known Subclasses:
AttributeImpl
,MapLayer.SpecialAttributeValue
,MultiAttributeProvider.ManyValueAttributeValue
public class AttributeValueImpl extends Object implements AttributeValue
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 AttributeValueImpl()
Uninitialized value.AttributeValueImpl(boolean value)
Constructor from the given value.AttributeValueImpl(double value)
Constructor from the given value.AttributeValueImpl(double x, double y)
Constructor from the given value.AttributeValueImpl(double x, double y, double z)
Constructor from the given value.AttributeValueImpl(float value)
Constructor from the given value.AttributeValueImpl(float x, float y)
Constructor from the given value.AttributeValueImpl(float x, float y, float z)
Constructor from the given value.AttributeValueImpl(int value)
Constructor from the given value.AttributeValueImpl(long value)
Constructor from the given value.AttributeValueImpl(Class<?> value)
Constructor from the given value.AttributeValueImpl(Enum<?> value)
Constructor from the given value.AttributeValueImpl(Object value)
Constructor from the given value.AttributeValueImpl(String value)
Constructor from the given value.AttributeValueImpl(InetAddress value)
Constructor from the given value.AttributeValueImpl(InetSocketAddress value)
Constructor from the given value.AttributeValueImpl(URI value)
Constructor from the given value.AttributeValueImpl(URL value)
Constructor from the given value.AttributeValueImpl(Date value)
Constructor from the given value.AttributeValueImpl(UUID value)
Constructor from the given value.AttributeValueImpl(AttributeType type)
Uninitialized value.AttributeValueImpl(AttributeType type, Object rawValue)
Constructor from the given value.AttributeValueImpl(AttributeValue value)
Constructor from the given value.AttributeValueImpl(Point2D<?,?> value)
Constructor from the given value.AttributeValueImpl(Point2D<?,?>[] value)
Constructor from the given value.AttributeValueImpl(Point3D<?,?> value)
Constructor from the given value.AttributeValueImpl(Point3D<?,?>[] value)
Constructor from the given value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToPolyline(Collection<? extends Point2D<?,?>> pts)
Add a point to the end of the polyline.void
addToPolyline(Point2D<?,?>... pts)
Add a point to the end of the polyline.void
addToPolyline3D(Collection<? extends Point3D<?,?>> pts)
Add a point to the end of the polyline.void
addToPolyline3D(Point3D<?,?>... pts)
Add a point to the end of the polyline.protected void
assertAssignedAndNotNull()
Assert that the attribute value was assigned and notnull
.boolean
cast(AttributeType attrType)
Change the type of this attribute.void
castAndSet(AttributeType attrType, Object attrValue)
Change the type of this attribute and set its value.static int
compareValues(AttributeValue arg0, AttributeValue arg1)
Compare the two specified values.boolean
equals(Object obj)
boolean
flush()
Force this attribute to put its value into a storage system.boolean
getBoolean()
Replies the value of this metadata.Date
getDate()
Replies the value of this metadata.Enum<?>
getEnumeration()
Replies the value of this metadata.<T extends Enum<T>>
TgetEnumeration(Class<T> type)
Replies the value of this metadata.InetAddress
getInetAddress()
Replies the value of this metadata.long
getInteger()
Replies the value of this metadata.Class<?>
getInternalStorageType()
Replies the type of the internal value of this implementation of AttributeValue.Class<?>
getJavaClass()
Replies the value of this metadata.<T> T
getJavaObject()
Replies the value of this metadata.Point2D<?,?>
getPoint()
Replies the value of this metadata.Point3D<?,?>
getPoint3D()
Replies the value of this metadata.Point2D<?,?>[]
getPolyline()
Replies the value of this metadata.Point3D<?,?>[]
getPolyline3D()
Replies the value of this metadata.double
getReal()
Replies the value of this metadata.String
getString()
Replies the value of this metadata.long
getTimestamp()
Replies the value of this metadata.AttributeType
getType()
Replies the type of this metadata.URI
getURI()
Replies the value of this metadata.URL
getURL()
Replies the value of this metadata.UUID
getUUID()
Replies the value of this metadata.Object
getValue()
Replies the value attribute stored in the implementation of this interface.int
hashCode()
boolean
isAssignableFrom(AttributeType type)
Replies if a value of the given attribute type may be cast to a value of this attribute type.boolean
isAssignableFrom(AttributeValue value)
Replies if a value of the given attribute type may be cast to a value of this attribute type.boolean
isAssigned()
Replies if a value was affected to this attribute.boolean
isBaseType()
Replies if this attribute type is a base type, ie. a number, a boolean or a string.boolean
isNullAllowed()
Replies if a null value is allowed for this attribute.boolean
isObjectValue()
Replies of the value of this attribute is a data object ie, java object or icon.static AttributeValueImpl
parse(String text)
Replies the best attribute value that is representing the given text.void
setBoolean(boolean value)
Set the value of this metadata.void
setDate(Date value)
Set the value of this metadata.void
setEnumeration(Enum<?> enumConstant)
Set the value of this metadata.void
setInetAddress(String hostname)
Set the value of this metadata.void
setInetAddress(InetAddress address)
Set the value of this metadata.void
setInetAddress(InetSocketAddress address)
Set the value of this metadata.void
setInteger(int value)
Set the value of this metadata.void
setInteger(long value)
Set the value of this metadata.protected void
setInternalValue(Object value)
Set this value with the content of the specified one.protected void
setInternalValue(Object value, AttributeType type)
Set this value with the content of the specified one.void
setJavaClass(Class<?> type)
Set the value of this metadata.void
setJavaObject(Object value)
Set the value of this metadata.void
setPoint(float x, float y)
Set the value of this metadata.void
setPoint(Point2D<?,?> value)
Set the value of this metadata.void
setPoint3D(float x, float y, float z)
Set the value of this metadata.void
setPoint3D(Point3D<?,?> value)
Set the value of this metadata.void
setPolyline(Collection<? extends Point2D<?,?>> value)
Set the value of this metadata.void
setPolyline(Point2D<?,?>... value)
Set the value of this metadata.void
setPolyline3D(Collection<? extends Point3D<?,?>> value)
Set the value of this metadata.void
setPolyline3D(Point3D<?,?>... value)
Set the value of this metadata.void
setReal(double value)
Set the value of this metadata.void
setString(String value)
Set the value of this metadata.void
setTimestamp(long value)
Set the value of this metadata.void
setToDefault()
Set the value to its default.void
setToDefaultIfUninitialized()
Set the value to its default if not init.void
setType(AttributeType type)
Change the type of this attribute.void
setURI(String uri)
Set the value of this metadata.void
setURI(URI u)
Set the value of this metadata.void
setURL(String url)
Set the value of this metadata.void
setURL(URL u)
Set the value of this metadata.void
setUUID(String id)
Set the value of this metadata.void
setUUID(UUID u)
Set the value of this metadata.void
setValue(Object value)
Set this value with the content of the specified one.void
setValue(AttributeValue value)
Set this value with the content of the specified one.void
toJson(JsonBuffer buffer)
Replies the Json representation of this node.String
toString()
void
uninitializeValue()
Set this attribute value uninitialized.Comparator<? extends AttributeValue>
valueComparator()
Replies a comparator suitable for attribute values.
-
-
-
Constructor Detail
-
AttributeValueImpl
public AttributeValueImpl()
Uninitialized value.
-
AttributeValueImpl
public AttributeValueImpl(AttributeType type)
Uninitialized value.- Parameters:
type
- is the type of the value.
-
AttributeValueImpl
public AttributeValueImpl(AttributeValue value)
Constructor from the given value.- Parameters:
value
- is the value to initialize this new instance.
-
AttributeValueImpl
public AttributeValueImpl(AttributeType type, Object rawValue)
Constructor from the given value.- Parameters:
type
- is the type of this value.rawValue
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(boolean value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(UUID value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(URL value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(URI value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(InetAddress value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(InetSocketAddress value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Enum<?> value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Class<?> value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Date value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(float value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(double value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(int value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(long value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Point2D<?,?> value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(float x, float y)
Constructor from the given value.- Parameters:
x
- is the value.y
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(double x, double y)
Constructor from the given value.- Parameters:
x
- is the value.y
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Point3D<?,?> value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(float x, float y, float z)
Constructor from the given value.- Parameters:
x
- is the value.y
- is the value.z
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(double x, double y, double z)
Constructor from the given value.- Parameters:
x
- is the value.y
- is the value.z
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(String value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Point2D<?,?>[] value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Point3D<?,?>[] value)
Constructor from the given value.- Parameters:
value
- is the value.
-
AttributeValueImpl
public AttributeValueImpl(Object value)
Constructor from the given value.- Parameters:
value
- is the value.
-
-
Method Detail
-
parse
@Pure public static AttributeValueImpl parse(String text)
Replies the best attribute value that is representing the given text.- Parameters:
text
- the text.- Returns:
- the attribute value, never
null
.
-
compareValues
@Pure public static int compareValues(AttributeValue arg0, AttributeValue arg1)
Compare the two specified values.- Parameters:
arg0
- first value.arg1
- second value.- Returns:
- replies a negative value if
arg0
is lesser thanarg1
, a positive value ifarg0
is greater thanarg1
, or0
if they are equal. - See Also:
AttributeValueComparator
-
toJson
public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObject
Replies the Json representation of this node.- Specified by:
toJson
in interfaceJsonableObject
- Parameters:
buffer
- the Json buffer.
-
isAssignableFrom
@Pure public boolean isAssignableFrom(AttributeType type)
Description copied from interface:AttributeValue
Replies if a value of the given attribute type may be cast to a value of this attribute type.Caution: even if isAssignableFrom is replying
true
, theAttributeValue.cast(AttributeType)
andAttributeValue.castAndSet(AttributeType, Object)
may fail if the target type does not support a specifical value of the source type. The isAssignableFrom function repliestrue
if a least one value of the source type is assignable to a value of the target type.This function is equivalent to:
this.getType().isAssignableFrom(type)
- Specified by:
isAssignableFrom
in interfaceAttributeValue
- Parameters:
type
- th etype.- Returns:
true
if a value of the giventype
may be cast to a value of the same type as this; otherwisefalse
.
-
isAssignableFrom
@Pure public boolean isAssignableFrom(AttributeValue value)
Description copied from interface:AttributeValue
Replies if a value of the given attribute type may be cast to a value of this attribute type.Caution: even if isAssignableFrom is replying
true
, theAttributeValue.cast(AttributeType)
andAttributeValue.castAndSet(AttributeType, Object)
may fail if the target type does not support a specifical value of the source type. The isAssignableFrom function repliestrue
if a least one value of the source type is assignable to a value of the target type.This function is equivalent to:
this.getType().isAssignableFrom(value.getType())
- Specified by:
isAssignableFrom
in interfaceAttributeValue
- Parameters:
value
- the value.- Returns:
true
if the given value may be cast to a value of the same type as this; otherwisefalse
.
-
assertAssignedAndNotNull
protected void assertAssignedAndNotNull() throws AttributeNotInitializedException
Assert that the attribute value was assigned and notnull
.- Throws:
AttributeNotInitializedException
- attribute not initialized.
-
isBaseType
@Pure public boolean isBaseType()
Description copied from interface:AttributeValue
Replies if this attribute type is a base type, ie. a number, a boolean or a string.The following code is always
true
:
isObjectValue() == !isBaseValue()
- Specified by:
isBaseType
in interfaceAttributeValue
- Returns:
true
if this attribute is containing a base type value, otherwisefalse
- See Also:
AttributeValue.isNullAllowed()
,AttributeValue.isObjectValue()
-
isNullAllowed
@Pure public boolean isNullAllowed()
Description copied from interface:AttributeValue
Replies if a null value is allowed for this attribute.If
AttributeValue.isBaseType()
repliestrue
, this function must always repliesfalse
.- Specified by:
isNullAllowed
in interfaceAttributeValue
- Returns:
true
ifnull
is assigned to this attribute, otherwisefalse
- See Also:
AttributeValue.isBaseType()
,AttributeValue.isObjectValue()
-
getType
@Pure public AttributeType getType()
Description copied from interface:AttributeValue
Replies the type of this metadata.- Specified by:
getType
in interfaceAttributeValue
- Returns:
- the type of the attribute
-
setType
public void setType(AttributeType type) throws InvalidAttributeTypeException
Description copied from interface:AttributeValue
Change the type of this attribute.The exception will be generated in case the current value could not be casted to the new type.
- Specified by:
setType
in interfaceAttributeValue
- Parameters:
type
- is the new type of this attribute- Throws:
InvalidAttributeTypeException
- if the current value was incompatible with the given type.
-
cast
public boolean cast(AttributeType attrType)
Description copied from interface:AttributeValue
Change the type of this attribute.The value could be lost in case the type was incompatible with the value.
- Specified by:
cast
in interfaceAttributeValue
- Parameters:
attrType
- is the new type of this attribute- Returns:
true
if the cast was sucessfully done, otherwhise, if the value was lost because of the cast operation.
-
castAndSet
public void castAndSet(AttributeType attrType, Object attrValue)
Description copied from interface:AttributeValue
Change the type of this attribute and set its value.- Specified by:
castAndSet
in interfaceAttributeValue
- Parameters:
attrType
- is the new type of this attributeattrValue
- is the new value.
-
getValue
@Pure public Object getValue() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value attribute stored in the implementation of this interface. In opposite thanAttributeValue.getJavaObject()
, this function replies the value for all attribute type.- Specified by:
getValue
in interfaceAttributeValue
- Returns:
- the raw value of this attribute
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
getInternalStorageType
@Pure public final Class<?> getInternalStorageType()
Description copied from interface:AttributeValue
Replies the type of the internal value of this implementation of AttributeValue.- Specified by:
getInternalStorageType
in interfaceAttributeValue
- Returns:
- the type of the value stored inside this attribute value implementation.
-
setValue
public void setValue(AttributeValue value)
Description copied from interface:AttributeValue
Set this value with the content of the specified one.- Specified by:
setValue
in interfaceAttributeValue
- Parameters:
value
- the value to copy.
-
setValue
public void setValue(Object value)
Description copied from interface:AttributeValue
Set this value with the content of the specified one.The type of the attribute will be detected from the type of the object.
- Specified by:
setValue
in interfaceAttributeValue
- Parameters:
value
- the value.
-
setInternalValue
protected void setInternalValue(Object value)
Set this value with the content of the specified one.The type of the attribute will be NOT detected from the type of the object. It means that it is not changed by this function. The given value must be compatible with internal representation of the attribute implementation.
- Parameters:
value
- is the raw value to put inside this attribute value.
-
setInternalValue
protected void setInternalValue(Object value, AttributeType type)
Set this value with the content of the specified one.The type of the attribute will be NOT detected from the type of the object. It means that it will be equal to the given type, even if the given value is incompatible. The given value must be compatible with internal representation of the attribute implementation.
- Parameters:
value
- is the raw value to put inside this attribute value.type
- is the type of the value.
-
setToDefault
public void setToDefault()
Description copied from interface:AttributeValue
Set the value to its default.- Specified by:
setToDefault
in interfaceAttributeValue
-
setToDefaultIfUninitialized
public void setToDefaultIfUninitialized()
Description copied from interface:AttributeValue
Set the value to its default if not init.- Specified by:
setToDefaultIfUninitialized
in interfaceAttributeValue
-
getInteger
@Pure public long getInteger() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getInteger
in interfaceAttributeValue
- Returns:
- the value
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setInteger
public void setInteger(int value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setInteger
in interfaceAttributeValue
- Parameters:
value
- the value.
-
setInteger
public void setInteger(long value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setInteger
in interfaceAttributeValue
- Parameters:
value
- the value.
-
getReal
@Pure public double getReal() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getReal
in interfaceAttributeValue
- Returns:
- the value
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setReal
public void setReal(double value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setReal
in interfaceAttributeValue
- Parameters:
value
- the value.
-
getString
@Pure public String getString() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getString
in interfaceAttributeValue
- Returns:
- the value
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setString
public void setString(String value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setString
in interfaceAttributeValue
- Parameters:
value
- the value.
-
getDate
@Pure public Date getDate() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getDate
in interfaceAttributeValue
- Returns:
- the value
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setDate
public void setDate(Date value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setDate
in interfaceAttributeValue
- Parameters:
value
- the value.
-
getBoolean
@Pure public boolean getBoolean() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getBoolean
in interfaceAttributeValue
- Returns:
- the value
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setBoolean
public void setBoolean(boolean value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setBoolean
in interfaceAttributeValue
- Parameters:
value
- the value.
-
isObjectValue
@Pure public boolean isObjectValue()
Description copied from interface:AttributeValue
Replies of the value of this attribute is a data object ie, java object or icon.The following code is always
true
:
isObjectValue() == !isBaseValue()
- Specified by:
isObjectValue
in interfaceAttributeValue
- Returns:
true
if this attribute contains a object as value (ie, not a base type), otherwisefalse
- See Also:
AttributeValue.isBaseType()
,AttributeValue.isNullAllowed()
-
getJavaObject
@Pure public <T> T getJavaObject() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata. In opposite thanAttributeValue.getValue()
, this function replies the value only if this attribute value if of typeAttributeType.OBJECT
.- Specified by:
getJavaObject
in interfaceAttributeValue
- Type Parameters:
T
- is the type of the value to reply- Returns:
- the value
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.- See Also:
AttributeValue.getValue()
-
setJavaObject
public void setJavaObject(Object value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setJavaObject
in interfaceAttributeValue
- Parameters:
value
- the value.
-
getTimestamp
@Pure public long getTimestamp() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getTimestamp
in interfaceAttributeValue
- Returns:
- a timestamp with a precision in milliseconds
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setTimestamp
public void setTimestamp(long value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setTimestamp
in interfaceAttributeValue
- Parameters:
value
- the value.
-
getPoint3D
@Pure public Point3D<?,?> getPoint3D() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getPoint3D
in interfaceAttributeValue
- Returns:
- a 3d point
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setPoint3D
public void setPoint3D(Point3D<?,?> value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPoint3D
in interfaceAttributeValue
- Parameters:
value
- the point.
-
setPoint3D
public void setPoint3D(float x, float y, float z)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPoint3D
in interfaceAttributeValue
- Parameters:
x
- x coordinate.y
- y coordinate.z
- z coordinate.
-
getPoint
@Pure public Point2D<?,?> getPoint() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getPoint
in interfaceAttributeValue
- Returns:
- a 2d point
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setPoint
public void setPoint(Point2D<?,?> value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPoint
in interfaceAttributeValue
- Parameters:
value
- the point.
-
setPoint
public void setPoint(float x, float y)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPoint
in interfaceAttributeValue
- Parameters:
x
- x coordinate.y
- y coordinate.
-
getUUID
@Pure public UUID getUUID() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getUUID
in interfaceAttributeValue
- Returns:
- an uuid
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
getURL
@Pure public URL getURL() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getURL
in interfaceAttributeValue
- Returns:
- an url
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
getURI
@Pure public URI getURI() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getURI
in interfaceAttributeValue
- Returns:
- an uri
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setUUID
public void setUUID(UUID u)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setUUID
in interfaceAttributeValue
- Parameters:
u
- the uuid.
-
setUUID
public void setUUID(String id)
Set the value of this metadata.- Parameters:
id
- identifier.
-
setURL
public void setURL(URL u)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setURL
in interfaceAttributeValue
- Parameters:
u
- the url.
-
setURL
public void setURL(String url)
Set the value of this metadata.- Parameters:
url
- the url.
-
setURI
public void setURI(URI u)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setURI
in interfaceAttributeValue
- Parameters:
u
- the uri.
-
setURI
public void setURI(String uri)
Set the value of this metadata.- Parameters:
uri
- the uri.
-
getPolyline3D
@Pure public Point3D<?,?>[] getPolyline3D() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getPolyline3D
in interfaceAttributeValue
- Returns:
- a list of 3d points
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setPolyline3D
public void setPolyline3D(Point3D<?,?>... value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPolyline3D
in interfaceAttributeValue
- Parameters:
value
- the points.
-
setPolyline3D
public void setPolyline3D(Collection<? extends Point3D<?,?>> value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPolyline3D
in interfaceAttributeValue
- Parameters:
value
- the points.
-
addToPolyline3D
public void addToPolyline3D(Point3D<?,?>... pts)
Description copied from interface:AttributeValue
Add a point to the end of the polyline.- Specified by:
addToPolyline3D
in interfaceAttributeValue
- Parameters:
pts
- the points
-
addToPolyline3D
public void addToPolyline3D(Collection<? extends Point3D<?,?>> pts)
Description copied from interface:AttributeValue
Add a point to the end of the polyline.- Specified by:
addToPolyline3D
in interfaceAttributeValue
- Parameters:
pts
- the points.
-
getPolyline
@Pure public Point2D<?,?>[] getPolyline() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getPolyline
in interfaceAttributeValue
- Returns:
- a list of 2d points
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setPolyline
public void setPolyline(Point2D<?,?>... value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPolyline
in interfaceAttributeValue
- Parameters:
value
- the points.
-
setPolyline
public void setPolyline(Collection<? extends Point2D<?,?>> value)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setPolyline
in interfaceAttributeValue
- Parameters:
value
- the points.
-
addToPolyline
public void addToPolyline(Point2D<?,?>... pts)
Description copied from interface:AttributeValue
Add a point to the end of the polyline.- Specified by:
addToPolyline
in interfaceAttributeValue
- Parameters:
pts
- the points
-
addToPolyline
public void addToPolyline(Collection<? extends Point2D<?,?>> pts)
Description copied from interface:AttributeValue
Add a point to the end of the polyline.- Specified by:
addToPolyline
in interfaceAttributeValue
- Parameters:
pts
- the points.
-
getInetAddress
@Pure public InetAddress getInetAddress() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getInetAddress
in interfaceAttributeValue
- Returns:
- an Internet address.
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setInetAddress
public void setInetAddress(InetAddress address)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setInetAddress
in interfaceAttributeValue
- Parameters:
address
- the address.
-
setInetAddress
public void setInetAddress(InetSocketAddress address)
Set the value of this metadata.- Parameters:
address
- the address.
-
setInetAddress
public void setInetAddress(String hostname)
Set the value of this metadata.- Parameters:
hostname
- the hostname
-
getEnumeration
@Pure public Enum<?> getEnumeration() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getEnumeration
in interfaceAttributeValue
- Returns:
- an enumeration.
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
getEnumeration
@Pure public <T extends Enum<T>> T getEnumeration(Class<T> type) throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getEnumeration
in interfaceAttributeValue
- Type Parameters:
T
- is the type of the enumeration to reply.- Parameters:
type
- is the type of the enumeration to reply.- Returns:
- an enumeration.
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setEnumeration
public void setEnumeration(Enum<?> enumConstant)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setEnumeration
in interfaceAttributeValue
- Parameters:
enumConstant
- the constant.
-
getJavaClass
@Pure public Class<?> getJavaClass() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValue
Replies the value of this metadata.- Specified by:
getJavaClass
in interfaceAttributeValue
- Returns:
- a Java type.
- Throws:
InvalidAttributeTypeException
- when type is invalid.AttributeNotInitializedException
- when attribute is not initialized.
-
setJavaClass
public void setJavaClass(Class<?> type)
Description copied from interface:AttributeValue
Set the value of this metadata.- Specified by:
setJavaClass
in interfaceAttributeValue
- Parameters:
type
- the type.
-
isAssigned
@Pure public boolean isAssigned()
Description copied from interface:AttributeValue
Replies if a value was affected to this attribute.- Specified by:
isAssigned
in interfaceAttributeValue
- Returns:
true
if this attribute is containing a value, otherwisefalse
-
uninitializeValue
public void uninitializeValue()
Description copied from interface:AttributeValue
Set this attribute value uninitialized.- Specified by:
uninitializeValue
in interfaceAttributeValue
-
flush
public boolean flush()
Description copied from interface:AttributeValue
Force this attribute to put its value into a storage system.By default, this function does nothing. It is dependant of the application implementation.
- Specified by:
flush
in interfaceAttributeValue
- Returns:
true
if the value was written, otherwhisefalse
-
valueComparator
@Pure public Comparator<? extends AttributeValue> valueComparator()
Description copied from interface:AttributeValue
Replies a comparator suitable for attribute values.- Specified by:
valueComparator
in interfaceAttributeValue
- Returns:
- a comparator, never
null
-
-