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 voidaddToPolyline(Collection<? extends Point2D<?,?>> pts)Add a point to the end of the polyline.voidaddToPolyline(Point2D<?,?>... pts)Add a point to the end of the polyline.voidaddToPolyline3D(Collection<? extends Point3D<?,?>> pts)Add a point to the end of the polyline.voidaddToPolyline3D(Point3D<?,?>... pts)Add a point to the end of the polyline.protected voidassertAssignedAndNotNull()Assert that the attribute value was assigned and notnull.booleancast(AttributeType attrType)Change the type of this attribute.voidcastAndSet(AttributeType attrType, Object attrValue)Change the type of this attribute and set its value.static intcompareValues(AttributeValue arg0, AttributeValue arg1)Compare the two specified values.booleanequals(Object obj)booleanflush()Force this attribute to put its value into a storage system.booleangetBoolean()Replies the value of this metadata.DategetDate()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.InetAddressgetInetAddress()Replies the value of this metadata.longgetInteger()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> TgetJavaObject()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.doublegetReal()Replies the value of this metadata.StringgetString()Replies the value of this metadata.longgetTimestamp()Replies the value of this metadata.AttributeTypegetType()Replies the type of this metadata.URIgetURI()Replies the value of this metadata.URLgetURL()Replies the value of this metadata.UUIDgetUUID()Replies the value of this metadata.ObjectgetValue()Replies the value attribute stored in the implementation of this interface.inthashCode()booleanisAssignableFrom(AttributeType type)Replies if a value of the given attribute type may be cast to a value of this attribute type.booleanisAssignableFrom(AttributeValue value)Replies if a value of the given attribute type may be cast to a value of this attribute type.booleanisAssigned()Replies if a value was affected to this attribute.booleanisBaseType()Replies if this attribute type is a base type, ie. a number, a boolean or a string.booleanisNullAllowed()Replies if a null value is allowed for this attribute.booleanisObjectValue()Replies of the value of this attribute is a data object ie, java object or icon.static AttributeValueImplparse(String text)Replies the best attribute value that is representing the given text.voidsetBoolean(boolean value)Set the value of this metadata.voidsetDate(Date value)Set the value of this metadata.voidsetEnumeration(Enum<?> enumConstant)Set the value of this metadata.voidsetInetAddress(String hostname)Set the value of this metadata.voidsetInetAddress(InetAddress address)Set the value of this metadata.voidsetInetAddress(InetSocketAddress address)Set the value of this metadata.voidsetInteger(int value)Set the value of this metadata.voidsetInteger(long value)Set the value of this metadata.protected voidsetInternalValue(Object value)Set this value with the content of the specified one.protected voidsetInternalValue(Object value, AttributeType type)Set this value with the content of the specified one.voidsetJavaClass(Class<?> type)Set the value of this metadata.voidsetJavaObject(Object value)Set the value of this metadata.voidsetPoint(float x, float y)Set the value of this metadata.voidsetPoint(Point2D<?,?> value)Set the value of this metadata.voidsetPoint3D(float x, float y, float z)Set the value of this metadata.voidsetPoint3D(Point3D<?,?> value)Set the value of this metadata.voidsetPolyline(Collection<? extends Point2D<?,?>> value)Set the value of this metadata.voidsetPolyline(Point2D<?,?>... value)Set the value of this metadata.voidsetPolyline3D(Collection<? extends Point3D<?,?>> value)Set the value of this metadata.voidsetPolyline3D(Point3D<?,?>... value)Set the value of this metadata.voidsetReal(double value)Set the value of this metadata.voidsetString(String value)Set the value of this metadata.voidsetTimestamp(long value)Set the value of this metadata.voidsetToDefault()Set the value to its default.voidsetToDefaultIfUninitialized()Set the value to its default if not init.voidsetType(AttributeType type)Change the type of this attribute.voidsetURI(String uri)Set the value of this metadata.voidsetURI(URI u)Set the value of this metadata.voidsetURL(String url)Set the value of this metadata.voidsetURL(URL u)Set the value of this metadata.voidsetUUID(String id)Set the value of this metadata.voidsetUUID(UUID u)Set the value of this metadata.voidsetValue(Object value)Set this value with the content of the specified one.voidsetValue(AttributeValue value)Set this value with the content of the specified one.voidtoJson(JsonBuffer buffer)Replies the Json representation of this node.StringtoString()voiduninitializeValue()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
arg0is lesser thanarg1, a positive value ifarg0is greater thanarg1, or0if they are equal. - See Also:
AttributeValueComparator
-
toJson
public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObjectReplies the Json representation of this node.- Specified by:
toJsonin interfaceJsonableObject- Parameters:
buffer- the Json buffer.
-
isAssignableFrom
@Pure public boolean isAssignableFrom(AttributeType type)
Description copied from interface:AttributeValueReplies 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 repliestrueif 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:
isAssignableFromin interfaceAttributeValue- Parameters:
type- th etype.- Returns:
trueif a value of the giventypemay be cast to a value of the same type as this; otherwisefalse.
-
isAssignableFrom
@Pure public boolean isAssignableFrom(AttributeValue value)
Description copied from interface:AttributeValueReplies 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 repliestrueif 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:
isAssignableFromin interfaceAttributeValue- Parameters:
value- the value.- Returns:
trueif the given value may be cast to a value of the same type as this; otherwisefalse.
-
assertAssignedAndNotNull
protected void assertAssignedAndNotNull() throws AttributeNotInitializedExceptionAssert that the attribute value was assigned and notnull.- Throws:
AttributeNotInitializedException- attribute not initialized.
-
isBaseType
@Pure public boolean isBaseType()
Description copied from interface:AttributeValueReplies 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:
isBaseTypein interfaceAttributeValue- Returns:
trueif this attribute is containing a base type value, otherwisefalse- See Also:
AttributeValue.isNullAllowed(),AttributeValue.isObjectValue()
-
isNullAllowed
@Pure public boolean isNullAllowed()
Description copied from interface:AttributeValueReplies if a null value is allowed for this attribute.If
AttributeValue.isBaseType()repliestrue, this function must always repliesfalse.- Specified by:
isNullAllowedin interfaceAttributeValue- Returns:
trueifnullis assigned to this attribute, otherwisefalse- See Also:
AttributeValue.isBaseType(),AttributeValue.isObjectValue()
-
getType
@Pure public AttributeType getType()
Description copied from interface:AttributeValueReplies the type of this metadata.- Specified by:
getTypein interfaceAttributeValue- Returns:
- the type of the attribute
-
setType
public void setType(AttributeType type) throws InvalidAttributeTypeException
Description copied from interface:AttributeValueChange 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:
setTypein 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:AttributeValueChange the type of this attribute.The value could be lost in case the type was incompatible with the value.
- Specified by:
castin interfaceAttributeValue- Parameters:
attrType- is the new type of this attribute- Returns:
trueif 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:AttributeValueChange the type of this attribute and set its value.- Specified by:
castAndSetin 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:AttributeValueReplies 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:
getValuein 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:AttributeValueReplies the type of the internal value of this implementation of AttributeValue.- Specified by:
getInternalStorageTypein interfaceAttributeValue- Returns:
- the type of the value stored inside this attribute value implementation.
-
setValue
public void setValue(AttributeValue value)
Description copied from interface:AttributeValueSet this value with the content of the specified one.- Specified by:
setValuein interfaceAttributeValue- Parameters:
value- the value to copy.
-
setValue
public void setValue(Object value)
Description copied from interface:AttributeValueSet 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:
setValuein 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:AttributeValueSet the value to its default.- Specified by:
setToDefaultin interfaceAttributeValue
-
setToDefaultIfUninitialized
public void setToDefaultIfUninitialized()
Description copied from interface:AttributeValueSet the value to its default if not init.- Specified by:
setToDefaultIfUninitializedin interfaceAttributeValue
-
getInteger
@Pure public long getInteger() throws InvalidAttributeTypeException, AttributeNotInitializedExceptionDescription copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getIntegerin 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:AttributeValueSet the value of this metadata.- Specified by:
setIntegerin interfaceAttributeValue- Parameters:
value- the value.
-
setInteger
public void setInteger(long value)
Description copied from interface:AttributeValueSet the value of this metadata.- Specified by:
setIntegerin interfaceAttributeValue- Parameters:
value- the value.
-
getReal
@Pure public double getReal() throws InvalidAttributeTypeException, AttributeNotInitializedExceptionDescription copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getRealin 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:AttributeValueSet the value of this metadata.- Specified by:
setRealin interfaceAttributeValue- Parameters:
value- the value.
-
getString
@Pure public String getString() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getStringin 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:AttributeValueSet the value of this metadata.- Specified by:
setStringin interfaceAttributeValue- Parameters:
value- the value.
-
getDate
@Pure public Date getDate() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getDatein 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:AttributeValueSet the value of this metadata.- Specified by:
setDatein interfaceAttributeValue- Parameters:
value- the value.
-
getBoolean
@Pure public boolean getBoolean() throws InvalidAttributeTypeException, AttributeNotInitializedExceptionDescription copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getBooleanin 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:AttributeValueSet the value of this metadata.- Specified by:
setBooleanin interfaceAttributeValue- Parameters:
value- the value.
-
isObjectValue
@Pure public boolean isObjectValue()
Description copied from interface:AttributeValueReplies 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:
isObjectValuein interfaceAttributeValue- Returns:
trueif 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, AttributeNotInitializedExceptionDescription copied from interface:AttributeValueReplies 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:
getJavaObjectin 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:AttributeValueSet the value of this metadata.- Specified by:
setJavaObjectin interfaceAttributeValue- Parameters:
value- the value.
-
getTimestamp
@Pure public long getTimestamp() throws InvalidAttributeTypeException, AttributeNotInitializedExceptionDescription copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getTimestampin 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:AttributeValueSet the value of this metadata.- Specified by:
setTimestampin interfaceAttributeValue- Parameters:
value- the value.
-
getPoint3D
@Pure public Point3D<?,?> getPoint3D() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getPoint3Din 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:AttributeValueSet the value of this metadata.- Specified by:
setPoint3Din interfaceAttributeValue- Parameters:
value- the point.
-
setPoint3D
public void setPoint3D(float x, float y, float z)Description copied from interface:AttributeValueSet the value of this metadata.- Specified by:
setPoint3Din interfaceAttributeValue- Parameters:
x- x coordinate.y- y coordinate.z- z coordinate.
-
getPoint
@Pure public Point2D<?,?> getPoint() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getPointin 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:AttributeValueSet the value of this metadata.- Specified by:
setPointin interfaceAttributeValue- Parameters:
value- the point.
-
setPoint
public void setPoint(float x, float y)Description copied from interface:AttributeValueSet the value of this metadata.- Specified by:
setPointin interfaceAttributeValue- Parameters:
x- x coordinate.y- y coordinate.
-
getUUID
@Pure public UUID getUUID() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getUUIDin 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:AttributeValueReplies the value of this metadata.- Specified by:
getURLin 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:AttributeValueReplies the value of this metadata.- Specified by:
getURIin 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:AttributeValueSet the value of this metadata.- Specified by:
setUUIDin 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:AttributeValueSet the value of this metadata.- Specified by:
setURLin 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:AttributeValueSet the value of this metadata.- Specified by:
setURIin 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:AttributeValueReplies the value of this metadata.- Specified by:
getPolyline3Din 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:AttributeValueSet the value of this metadata.- Specified by:
setPolyline3Din interfaceAttributeValue- Parameters:
value- the points.
-
setPolyline3D
public void setPolyline3D(Collection<? extends Point3D<?,?>> value)
Description copied from interface:AttributeValueSet the value of this metadata.- Specified by:
setPolyline3Din interfaceAttributeValue- Parameters:
value- the points.
-
addToPolyline3D
public void addToPolyline3D(Point3D<?,?>... pts)
Description copied from interface:AttributeValueAdd a point to the end of the polyline.- Specified by:
addToPolyline3Din interfaceAttributeValue- Parameters:
pts- the points
-
addToPolyline3D
public void addToPolyline3D(Collection<? extends Point3D<?,?>> pts)
Description copied from interface:AttributeValueAdd a point to the end of the polyline.- Specified by:
addToPolyline3Din interfaceAttributeValue- Parameters:
pts- the points.
-
getPolyline
@Pure public Point2D<?,?>[] getPolyline() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getPolylinein 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:AttributeValueSet the value of this metadata.- Specified by:
setPolylinein interfaceAttributeValue- Parameters:
value- the points.
-
setPolyline
public void setPolyline(Collection<? extends Point2D<?,?>> value)
Description copied from interface:AttributeValueSet the value of this metadata.- Specified by:
setPolylinein interfaceAttributeValue- Parameters:
value- the points.
-
addToPolyline
public void addToPolyline(Point2D<?,?>... pts)
Description copied from interface:AttributeValueAdd a point to the end of the polyline.- Specified by:
addToPolylinein interfaceAttributeValue- Parameters:
pts- the points
-
addToPolyline
public void addToPolyline(Collection<? extends Point2D<?,?>> pts)
Description copied from interface:AttributeValueAdd a point to the end of the polyline.- Specified by:
addToPolylinein interfaceAttributeValue- Parameters:
pts- the points.
-
getInetAddress
@Pure public InetAddress getInetAddress() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getInetAddressin 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:AttributeValueSet the value of this metadata.- Specified by:
setInetAddressin 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:AttributeValueReplies the value of this metadata.- Specified by:
getEnumerationin 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:AttributeValueReplies the value of this metadata.- Specified by:
getEnumerationin 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:AttributeValueSet the value of this metadata.- Specified by:
setEnumerationin interfaceAttributeValue- Parameters:
enumConstant- the constant.
-
getJavaClass
@Pure public Class<?> getJavaClass() throws InvalidAttributeTypeException, AttributeNotInitializedException
Description copied from interface:AttributeValueReplies the value of this metadata.- Specified by:
getJavaClassin 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:AttributeValueSet the value of this metadata.- Specified by:
setJavaClassin interfaceAttributeValue- Parameters:
type- the type.
-
isAssigned
@Pure public boolean isAssigned()
Description copied from interface:AttributeValueReplies if a value was affected to this attribute.- Specified by:
isAssignedin interfaceAttributeValue- Returns:
trueif this attribute is containing a value, otherwisefalse
-
uninitializeValue
public void uninitializeValue()
Description copied from interface:AttributeValueSet this attribute value uninitialized.- Specified by:
uninitializeValuein interfaceAttributeValue
-
flush
public boolean flush()
Description copied from interface:AttributeValueForce 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:
flushin interfaceAttributeValue- Returns:
trueif the value was written, otherwhisefalse
-
valueComparator
@Pure public Comparator<? extends AttributeValue> valueComparator()
Description copied from interface:AttributeValueReplies a comparator suitable for attribute values.- Specified by:
valueComparatorin interfaceAttributeValue- Returns:
- a comparator, never
null
-
-