public interface IAttributeValue extends Serializable
Note that if IAttributeValue.isNull() is true, other getters will throw an exception
so it is advisable to always call IAttributeValue.isNull() before getting the value
of the attribute.
IAttributeValue is as follows:
IAttributeValue val = getValue();
if (val.isNull()) {
// do something
} else {
switch (val.getDataType()) {
case BOOLEAN:
boolean boolVal = val.getBoolean();
// do something
break;
case INTEGER:
int intVal = val.getInt();
// do something
break;
// ...
}
}
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBinary()
Gets the value of the attribute.
|
boolean |
getBoolean()
Gets the value of the attribute.
|
byte |
getByte()
Gets the value of the attribute.
|
char |
getChar()
Gets the value of the attribute.
|
IAttributeValue |
getCopy()
Returns a deep copy of this attribute.
|
AttributeType |
getDataType()
Indicates the data type of the attribute.
|
MIDate |
getDate()
Gets the value of the attribute.
|
MIDateTime |
getDateTime()
Gets the value of the attribute.
|
MIDateTimeZone |
getDateTimeZone()
Gets the value of the attribute.
|
double |
getDouble()
Gets the value of the attribute.
|
IFeature |
getFeature()
Gets the value of the attribute.
|
IFeatureCollection |
getFeatureCollection()
Gets the value of the attribute.
|
IFeatureGeometry |
getFeatureGeometry()
Gets the value of the attribute.
|
float |
getFloat()
Gets the value of the attribute.
|
int |
getInt()
Gets the value of the attribute.
|
long |
getLong()
Gets the value of the attribute.
|
IMultiFeatureCollection |
getMultiFeatureCollection()
Gets the value of the attribute.
|
IRasterDataset |
getRasterDataset()
Gets the value of the attribute.
|
short |
getShort()
Gets the value of the attribute.
|
String |
getString()
Gets the value of the attribute.
|
IStyle |
getStyle()
Gets the value of the attribute.
|
MITime |
getTime()
Gets the value of the attribute.
|
MITimespan |
getTimespan()
Gets the value of the attribute.
|
boolean |
isNull()
Indicates if the value of the attribute is null.
|
void |
setBinary(byte[] value)
Sets the value of the attribute.
|
void |
setBoolean(boolean value)
Sets the value of the attribute.
|
void |
setByte(byte value)
Sets the value of the attribute.
|
void |
setChar(char value)
Sets the value of the attribute.
|
void |
setDate(MIDate value)
Sets the value of the attribute.
|
void |
setDateTime(MIDateTime value)
Sets the value of the attribute.
|
void |
setDateTimeZone(MIDateTimeZone value)
Sets the value of the attribute.
|
void |
setDouble(double value)
Sets the value of the attribute.
|
void |
setFeature(IFeature value)
Sets the value of the attribute.
|
void |
setFeatureCollection(IFeatureCollection value)
Sets the value of the attribute.
|
void |
setFeatureGeometry(IFeatureGeometry value)
Sets the value of the attribute.
|
void |
setFloat(float value)
Sets the value of the attribute.
|
void |
setFromFeature(IFeature feature,
int attributeIndex,
boolean bDeepCopy)
Note this should be a non-transient operation.
|
void |
setInt(int value)
Sets the value of the attribute.
|
void |
setLong(long value)
Sets the value of the attribute.
|
void |
setMultiFeatureCollection(IMultiFeatureCollection value)
Sets the value of the attribute.
|
void |
setNull()
Sets the value of the attribute to
null. |
void |
setRasterDataset(IRasterDataset value)
Sets the value of the attribute.
|
void |
setShort(short value)
Sets the value of the attribute.
|
void |
setString(String value)
Sets the value of the attribute.
|
void |
setStyle(IStyle value)
Sets the value of the attribute.
|
void |
setTime(MITime value)
Sets the value of the attribute.
|
void |
setTimespan(MITimespan value)
Sets the value of the attribute.
|
void |
setValue(IAttributeValue from,
boolean bDeepCopy)
Note this should be a non-transient operation.
|
IAttributeValue getCopy()
AttributeType getDataType()
void setValue(IAttributeValue from, boolean bDeepCopy)
from - - The value to set this attribute to.bDeepCopy - - True if the from value should be deep copied.void setFromFeature(IFeature feature, int attributeIndex, boolean bDeepCopy)
feature - - The feature containing the data this attribute is to be set to.attributeIndex - - The index of the attributebDeepCopy - - True if the from value should be deep copied.boolean isNull()
getString and getInt will
throw an exception if the value for the attribute is null. Users should first
check for null values using this method.true if the value for the attribute is null; false otherwise.boolean getBoolean()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()int getInt()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()short getShort()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()long getLong()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()float getFloat()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()double getDouble()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()String getString()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()MIDate getDate()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()MIDateTime getDateTime()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()MITime getTime()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()MIDateTimeZone getDateTimeZone()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()MITimespan getTimespan()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()IFeatureGeometry getFeatureGeometry()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()IStyle getStyle()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()char getChar()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()byte getByte()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected typeIllegalStateException - if the value for this attribute is null.IAttributeValue.isNull()byte[] getBinary()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected type or if the value for
this attribute is null.IAttributeValue.isNull()IRasterDataset getRasterDataset()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.InconvertableTypeException - if the attribute is not of the expected type or if the value for
this attribute is null.IAttributeValue.isNull()IFeature getFeature()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.
todo:
Include a section at the top of this interface or maybe in the Feature Package
level docs about type extensibility and refer to that here....
InconvertableTypeException - if the attribute is not of the expected type or if the value for
this attribute is null.IAttributeValue.isNull()IFeatureCollection getFeatureCollection()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.
todo:
Include a section at the top of this interface or maybe in the Feature Package
level docs about type extensibility and refer to that here....
InconvertableTypeException - if the attribute is not of the expected type or if the value for
this attribute is null.IAttributeValue.isNull()IMultiFeatureCollection getMultiFeatureCollection()
null, an
exception will be thrown. Users must check for null values before attempting to access
a typed value accessor method.
todo:
Include a section at the top of this interface or maybe in the Feature Package
level docs about type extensibility and refer to that here....
InconvertableTypeException - if the attribute is not of the expected type or if the value for
this attribute is null.IAttributeValue.isNull()void setNull()
null. Attributes
do not represent null using a value within the domain of the attribute type.
For example, a string attribute is not set to null by calling setString
and passing in a null string referenece for the value. This will generate an exception.
To set a value to null, use the setNull method.IllegalStateException - if the attribute is not allowed to be null.void setBoolean(boolean value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setInt(int value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setShort(short value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setLong(long value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setFloat(float value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setDouble(double value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setString(String value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setFeatureGeometry(IFeatureGeometry value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setStyle(IStyle value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setRasterDataset(IRasterDataset value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setDate(MIDate value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setDateTime(MIDateTime value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setDateTimeZone(MIDateTimeZone value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setTime(MITime value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setTimespan(MITimespan value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setChar(char value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setByte(byte value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setBinary(byte[] value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setFeature(IFeature value)
value - the new value for the attribute.MetadataMismatchException - if the attribute is not allowed to assume this type or if the input feature
attributes don't match the attributes defined for this attribute (if any).void setFeatureCollection(IFeatureCollection value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.void setMultiFeatureCollection(IMultiFeatureCollection value)
value - the new value for the attribute.InconvertableTypeException - if the attribute is not allowed to assume this type.© 2007, 2022 Precisely. All rights reserved.