public class DescribedValue
extends java.lang.Object
ValueInfo
object which provides metadata about that value
(name, class, shape, units and so on).Constructor | Description |
---|---|
DescribedValue(ValueInfo vinfo) |
Constructs a new DescribedValue object to hold values
described by a given ValueInfo object.
|
DescribedValue(ValueInfo vinfo,
java.lang.Object value) |
Constructs a new DescribedValue object to hold values
described by a given ValueInfo object and with a
given initial value.
|
Modifier and Type | Method | Description |
---|---|---|
ValueInfo |
getInfo() |
Returns the ValueInfo object which describes the value
held by this object.
|
java.lang.Object |
getValue() |
Returns the actual value content of this object.
|
java.lang.String |
getValueAsString(int maxLength) |
Returns a string representation of the value of this object,
no longer than a given maximum length.
|
void |
setValue(java.lang.Object value) |
Sets the actual value content of this object.
|
void |
setValueFromString(java.lang.String sval) |
Sets the value of this object from a string representation.
|
java.lang.String |
toString() |
Returns a string representation of this object no longer than a
default maximum length.
|
java.lang.String |
toString(int maxLength) |
Returns a string representation of this object, no longer than a
given maximum length.
|
public DescribedValue(ValueInfo vinfo)
vinfo
- the metadata handler for this valuepublic DescribedValue(ValueInfo vinfo, java.lang.Object value)
vinfo
- the metadata describing this object's valuevalue
- the value of this objectjava.lang.IllegalArgumentException
- if value.getClass()
is not compatible with vinfo.getContentClass()public ValueInfo getInfo()
public void setValue(java.lang.Object value)
value
- the valuejava.lang.IllegalArgumentException
- if value.getClass() is not
compatible with getValueInfo().getContentClass()public java.lang.Object getValue()
public java.lang.String getValueAsString(int maxLength)
maxLength
- the maximum number of characters in the returned
stringpublic void setValueFromString(java.lang.String sval)
sval
- string representation of the new valuepublic java.lang.String toString(int maxLength)
maxLength
- the maximum number of characters in the returned
stringpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.