public class IlvAttributeProperty extends IlvNamedProperty
IlvNamedProperty
, it can be attached to graphic object
layers or managers, and, possibly saved to IVL files.
A subclass, IlvFeatureAttributeProperty
, is optimized
to store the attributes of the map features.
Modifier and Type | Field and Description |
---|---|
static String |
NAME
The name of the property
|
Constructor and Description |
---|
IlvAttributeProperty(IlvAttributeInfoProperty info,
Object[] values)
Creates an instance of the class
IlvAttributeProperty . |
IlvAttributeProperty(IlvAttributeProperty source)
Creates a new
IlvNamedProperty object by copying an
existing one. |
IlvAttributeProperty(IlvInputStream stream)
Creates a new
IlvAttributeInfoProperty from
an IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
IlvNamedProperty |
copy()
Copies the property.
|
IlvAttributeInfoProperty |
getInfo()
Returns information about the attribute values.
|
Object |
getValue(int i)
Returns the value of the attribute specified by the index
i . |
Object |
getValue(String name)
Returns the value of the attribute specified by its name.
|
boolean |
isPersistent()
Returns true if the property must be saved to an IVL file.
|
void |
setPersistent(boolean persistent)
Specifies whether the property must be saved to an IVL file.
|
void |
setValue(int i,
Object value)
Sets the value of the attribute specified by the index
i
to value . |
void |
setValue(String name,
Object value)
Sets the value of the attribute specified by its name
to
value . |
void |
unsafeSetValue(int i,
Object value)
Sets the value of the attribute specified by its index to
value . |
void |
write(IlvOutputStream stream)
Writes the property to an
IlvOutputStream . |
getName
public static final String NAME
public IlvAttributeProperty(IlvAttributeInfoProperty info, Object[] values)
IlvAttributeProperty
.info
- The description of the attributes (names, classes etc.)values
- The values of the attributesIllegalArgumentException
- if the array of values differs from
the number of attributes specified by the info
argument or if the classes of the values are different from
the classes specified in info
.public IlvAttributeProperty(IlvAttributeProperty source)
IlvNamedProperty
object by copying an
existing one.
The IlvAttributeInfoProperty
is not copied,
which means that the source and the copy will share the same instance
of IlvAttributeInfoProperty
.
The values are copied. Modifying the values of the copied object
using the method setValue
will not alter the source object,
and vice versa.
source
- The named property to be copiedpublic IlvAttributeProperty(IlvInputStream stream) throws IlvReadFileException
IlvAttributeInfoProperty
from
an IlvInputStream
.stream
- the input stream.IlvReadFileException
- if an error occurs while reading.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvNamedProperty
stream
- the output stream.IOException
- standard IO error.public IlvAttributeInfoProperty getInfo()
public Object getValue(int i)
i
.i
- The index of the attributepublic Object getValue(String name)
name
- The name of the attributeIllegalArgumentException
- if name
is not
the name of an attribute.public void setValue(int i, Object value)
i
to value
.
This method checks consistency of assignment, that is:
value
is assignable
to the corresponding class in associated
IlvAttributeInfoProperty
object;
value
is not null when the value at position i
is
not nullable.
i
- The index of the attribute to be set.value
- The value to which the specified attribute will be set.IllegalArgumentException
- if the index is higher than the
number of attributes, or if the class of the value is
incompatible with the class of this attribute.public void setValue(String name, Object value)
value
.
This method checks consistency of assignment, that is:
value
is assignable
to the corresponding class in associated
IlvAttributeInfoProperty
object;
value
is not null when the value is
not nullable.
name
- The name of the attribute to be setvalue
- The value to which the specified attribute will be setIllegalArgumentException
- if name
is not the
name of an attribute, or if the class of the value is
incompatible with the class of this attribute.public void unsafeSetValue(int i, Object value)
value
.
This function does not check for any class or nullable value.i
- The index of attribute to be setvalue
- The value to which the specified attribute will be setIllegalArgumentException
- if index is higher than the
number of attributes.public IlvNamedProperty copy()
IlvAttributeInfoProperty
is not copied, that is
the source and the copy will share the same instance of
IlvAttributeInfoProperty
The internal array of values is copied.
Modifying the values of the copied object using setValue
will not alter the source object and vice versa.
copy
in class IlvNamedProperty
public void setPersistent(boolean persistent)
persistent
- Set to true
if the property must be saved to an IVL file
or false otherwise.public boolean isPersistent()
isPersistent
in class IlvNamedProperty
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.