public class IlvAttributeArray extends IlvFeatureAttribute
Constructor and Description |
---|
IlvAttributeArray()
Creates an instance of
IlvAttributeArray . |
IlvAttributeArray(IlvAttributeArray source)
Copies this feature attribute and the attribute values.
|
IlvAttributeArray(IlvInputStream stream)
Reads an
IlvAttributeArray from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
IlvFeatureAttribute |
copy()
Returns a copy of the object.
|
IlvFeatureAttribute |
getAttribute(int i)
Returns the attribute of the specified index.
|
Class<?> |
getCommonClass()
Returns the current class of element stored in this array.
|
int |
getSize()
Returns the number of elements of this array
|
void |
removeAll()
Empties the array.
|
void |
setAttribute(int i,
IlvFeatureAttribute attribute)
Sets the attribute of the specified index.
|
void |
setCommonClass(Class<?> commonClass)
Sets the common class for the attributes of this attribute array.
|
void |
setSize(int newSize)
Sets the size of this array.
|
String |
toString()
Converts the attribute array into a string.
|
void |
unsafeSetAttribute(int i,
IlvFeatureAttribute attribute)
Sets the value of the attribute specified by the index
i
to value , without checking. |
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
public IlvAttributeArray()
IlvAttributeArray
.public IlvAttributeArray(IlvInputStream stream) throws IlvReadFileException
IlvAttributeArray
from an
IlvInputStream
.stream
- the input stream.IlvReadFileException
- if the format is not correct.public IlvAttributeArray(IlvAttributeArray source)
source
- the object to be copied.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvFeatureAttribute
stream
- the output stream.IOException
- if an error occurs.public IlvFeatureAttribute getAttribute(int i)
i
- the index.ArrayIndexOutOfBoundsException
- if an invalid index was given.public void setAttribute(int i, IlvFeatureAttribute attribute)
i
- the index.attribute
- the attribute to set.ArrayIndexOutOfBoundsException
- if an invalid index was given.IllegalArgumentException
- if the attribute is not assignable
to the common class.setCommonClass(java.lang.Class<?>)
public void unsafeSetAttribute(int i, IlvFeatureAttribute attribute)
i
to value
, without checking. This method must be used with
care. If the class of the attribute can't be assigned to the common
class of this array, the class will be left in an inconsistent state.i
- the index of the attribute to be set.attribute
- the value to which the specified attribute will be set.ArrayIndexOutOfBoundsException
- if an invalid index was given.public Class<?> getCommonClass()
public void setCommonClass(Class<?> commonClass)
IlvFeatureAttribute
,
intended for any type of data. Providing a precise common class
determines for the application the type of the attribute array.commonClass
- the common class.IllegalArgumentException
- if the array contains attributes
that are not assignable to the specified class.public int getSize()
public void setSize(int newSize)
null
items are added to the end of the array.
If the new size is less than the current size, all components at
index newSize
and greater are just ignored.newSize
- the new size of this array.public void removeAll()
public String toString()
public IlvFeatureAttribute copy()
copy
in class IlvFeatureAttribute
IlvFeatureAttribute
.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.