public class DefaultFeature extends java.lang.Object implements Feature, EvaluatorData, Cloneable
Modifier and Type | Field and Description |
---|---|
protected FeatureProvider |
data |
static java.lang.String |
FORMAT_MODE |
static java.lang.String |
FORMAT_MODE_GEOJSON |
static java.lang.String |
FORMAT_MODE_GVSIGDESKTOP |
protected FeatureReference |
reference |
static java.lang.String |
TOJSON_MODE |
static int |
TOJSON_MODE_COLLECTIONS |
static int |
TOJSON_MODE_COMPUTEDS |
static int |
TOJSON_MODE_DEEP |
static int |
TOJSON_MODE_SHALLOW |
CHECK_BASIC, CHECK_REQUIREDS, CHECK_RULES_AT_EDITING, CHECK_RULES_AT_FINISH
Constructor and Description |
---|
DefaultFeature(FeatureStore store) |
DefaultFeature(FeatureStore store,
FeatureProvider data) |
DefaultFeature(FeatureType targetType,
Feature sourceFeature) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetValue(FeatureAttributeDescriptor attr,
java.util.function.Predicate<FeatureAttributeDescriptor> copy) |
boolean |
canSetValue(java.lang.String name) |
void |
clear() |
java.lang.Object |
clone()
Creates a copy of the object.
|
boolean |
containsKey(java.lang.String key) |
ExpressionBuilder |
createBuilderFilter() |
Expression |
createFilter() |
java.lang.String |
format(int index) |
java.lang.String |
format(java.lang.String name) |
java.lang.Object |
get(int index)
Returns the value of an attribute given its position.
|
java.lang.Object |
get(java.lang.String name)
Returns the value of an attribute given its name.
|
java.lang.Object[] |
getArray(int index)
Returns the array value of an attribute given its position.
|
java.lang.Object[] |
getArray(java.lang.String name)
Returns the array value of an attribute given its name.
|
DynObject |
getAsDynObject() |
boolean |
getBoolean(int index)
Returns the Boolean value of an attribute given its position.
|
boolean |
getBoolean(java.lang.String name)
Returns the Boolean value of an attribute given its name.
|
boolean |
getBooleanOrDefault(int index,
boolean defaultValue) |
boolean |
getBooleanOrDefault(java.lang.String name,
boolean defaultValue) |
byte |
getByte(int index)
Returns the byte value of an attribute given its position.
|
byte |
getByte(java.lang.String name)
Returns the byte value of an attribute given its name.
|
byte[] |
getByteArray(int index) |
byte[] |
getByteArray(java.lang.String name) |
java.lang.Object |
getContextValue(java.lang.String name) |
Feature |
getCopy()
Creates and returns a copy of this
|
FeatureProvider |
getData() |
java.util.Iterator |
getDataNames() |
protected DataTypesManager |
getDataTypesManager() |
java.lang.Object |
getDataValue(java.lang.String name) |
java.util.Iterator |
getDataValues() |
java.sql.Date |
getDate(int index)
Returns the Date value of an attribute given its position.
|
java.sql.Date |
getDate(java.lang.String name)
Returns the Date value of an attribute given its name.
|
java.util.Date |
getDateOrDefault(int index,
java.util.Date defaultValue) |
java.util.Date |
getDateOrDefault(java.lang.String name,
java.util.Date defaultValue) |
java.math.BigDecimal |
getDecimal(int index)
Returns the BigDecimal value of an attribute given its position.
|
java.math.BigDecimal |
getDecimal(java.lang.String name)
Returns the BigDecimal value of an attribute given its name.
|
java.math.BigDecimal |
getDecimalOrDefault(int index,
java.math.BigDecimal defaultValue) |
java.math.BigDecimal |
getDecimalOrDefault(java.lang.String name,
java.math.BigDecimal defaultValue) |
Envelope |
getDefaultEnvelope()
Envelope (AKA extent or bounding box) of the default geometry attribute.
|
Geometry |
getDefaultGeometry()
Returns the value of the default geometry attribute, which is a
Geometry . |
IProjection |
getDefaultSRS()
Returns the Spatial Reference System in which is expressed the default
geometry attribute.
|
double |
getDouble(int index)
Returns the double value of an attribute given its position.
|
double |
getDouble(java.lang.String name)
Returns the double value of an attribute given its name.
|
double |
getDoubleOrDefault(int index,
double defaultValue) |
double |
getDoubleOrDefault(java.lang.String name,
double defaultValue) |
EditableFeature |
getEditable()
Returns the editable instance of this Feature.
|
EvaluatorData |
getEvaluatorData()
This lets Feature be used eaily with
Evaluator |
java.lang.Object |
getExtraColumnValue(java.lang.String name) |
java.lang.Object |
getExtraValue(int index) |
java.lang.Object |
getExtraValue(java.lang.String name) |
Feature |
getFeature(int index)
Returns the Feature value of an attribute given its position.
|
Feature |
getFeature(java.lang.String name)
Returns the Feature value of an attribute given its name.
|
float |
getFloat(int index)
Returns the float value of an attribute given its position.
|
float |
getFloat(java.lang.String name)
Returns the float value of an attribute given its name.
|
float |
getFloatOrDefault(int index,
float defaultValue) |
float |
getFloatOrDefault(java.lang.String name,
float defaultValue) |
Feature |
getForeignFeature(java.lang.String attrName) |
java.lang.Object |
getFromProfile(int index) |
java.lang.Object |
getFromProfile(java.lang.String name) |
java.util.List |
getGeometries()
Returns a list with the values of this Feature's geometry attributes.
|
Geometry |
getGeometry(int index)
Returns the Geometry value of an attribute given its position.
|
Geometry |
getGeometry(java.lang.String name)
Returns the Geometry value of an attribute given its name.
|
int |
getInt(int index)
Returns the int value of an attribute given its position.
|
int |
getInt(java.lang.String name)
Returns the int value of an attribute given its name.
|
int |
getIntOrDefault(int index,
int defaultValue) |
int |
getIntOrDefault(java.lang.String name,
int defaultValue) |
java.util.List<java.lang.String> |
getKeys() |
java.lang.String |
getLabelOfValue(java.lang.String name) |
long |
getLong(int index)
Returns the long value of an attribute given its position.
|
long |
getLong(java.lang.String name)
Returns the long value of an attribute given its name.
|
long |
getLongOrDefault(int index,
long defaultValue) |
long |
getLongOrDefault(java.lang.String name,
long defaultValue) |
java.lang.Object |
getOrDefault(int index,
java.lang.Object defaultValue) |
java.lang.Object |
getOrDefault(java.lang.String name,
DataType type,
java.lang.Object defaultValue) |
java.lang.Object |
getOrDefault(java.lang.String name,
int type,
java.lang.Object defaultValue) |
java.lang.Object |
getOrDefault(java.lang.String name,
java.lang.Object defaultValue) |
FeatureReference |
getReference()
Returns a unique identifier for this Feature in the associated store.
|
java.util.List |
getSRSs()
Returns a list with the Spatial Reference Systems in which are expressed
this Feature's geometry attributes.
|
FeatureStore |
getStore()
Return the store associated to this feature.
|
java.lang.String |
getString(int index)
Returns the String value of an attribute given its position.
|
java.lang.String |
getString(java.lang.String name)
Returns the String value of an attribute given its name.
|
java.lang.String |
getStringOrDefault(int index,
java.lang.String defaultValue) |
java.lang.String |
getStringOrDefault(java.lang.String name,
java.lang.String defaultValue) |
java.sql.Time |
getTime(int index) |
java.sql.Time |
getTime(java.lang.String name) |
java.sql.Timestamp |
getTimestamp(int index) |
java.sql.Timestamp |
getTimestamp(java.lang.String name) |
FeatureType |
getType()
Returns the FeatureType that describes the structure of this Feature.
|
boolean |
has_key(java.lang.String key) |
boolean |
hasContextValue(java.lang.String name) |
boolean |
hasDataValue(java.lang.String name) |
boolean |
hasExtraValue(java.lang.String name) |
boolean |
hasValue(java.lang.String name) |
void |
initializeValues() |
void |
initializeValues(Feature feature) |
boolean |
isBroken() |
boolean |
isEmpty() |
boolean |
isInserted()
It is a new feature that has already been inserted into the store but has not yet been saved to disk
|
boolean |
isNull(int index) |
boolean |
isNull(java.lang.String name) |
java.util.Iterator<java.lang.String> |
iterator() |
java.util.Iterator |
iteritems() |
java.util.Iterator<java.lang.String> |
iterkeys() |
java.util.List<java.lang.String> |
keys() |
protected void |
set(FeatureAttributeDescriptor attribute,
java.lang.Object value) |
void |
setData(FeatureProvider data) |
void |
setExtraValue(java.lang.String name,
java.lang.Object value) |
void |
setInserted(boolean inserted)
If true, marks the feature as already inserted in the vault but has not yet been saved to disk
|
int |
size() |
JsonObject |
toJson() |
JsonObject |
toJson(java.util.Map<java.lang.String,java.lang.Object> props) |
JsonObjectBuilder |
toJsonBuilder() |
JsonObjectBuilder |
toJsonBuilder(java.util.Map<java.lang.String,java.lang.Object> props) |
JsonObjectBuilder |
toJsonBuilderDefault(java.util.Map<java.lang.String,java.lang.Object> props) |
java.lang.String |
toString() |
void |
validate(int check) |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cloneQuietly, cloneQuietly
protected FeatureProvider data
protected FeatureReference reference
public static final java.lang.String TOJSON_MODE
public static final java.lang.String FORMAT_MODE
public static final java.lang.String FORMAT_MODE_GVSIGDESKTOP
public static final java.lang.String FORMAT_MODE_GEOJSON
public static final int TOJSON_MODE_SHALLOW
public static final int TOJSON_MODE_DEEP
public static final int TOJSON_MODE_COMPUTEDS
public static final int TOJSON_MODE_COLLECTIONS
public DefaultFeature(FeatureStore store)
public DefaultFeature(FeatureStore store, FeatureProvider data)
public DefaultFeature(FeatureType targetType, Feature sourceFeature)
public void setData(FeatureProvider data)
public FeatureProvider getData()
protected DataTypesManager getDataTypesManager()
public boolean canSetValue(java.lang.String name)
public boolean canSetValue(FeatureAttributeDescriptor attr, java.util.function.Predicate<FeatureAttributeDescriptor> copy)
protected void set(FeatureAttributeDescriptor attribute, java.lang.Object value)
public void initializeValues()
public void clear()
public void initializeValues(Feature feature)
public FeatureStore getStore()
Feature
public FeatureType getType()
Feature
public EditableFeature getEditable()
Feature
getEditable
in interface Feature
public Feature getCopy()
Feature
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so its sure
it implements it, so this exception may be used for problems on specific
object instances.Object#clone()}.
public FeatureReference getReference()
Feature
getReference
in interface Feature
public java.lang.Object getOrDefault(java.lang.String name, java.lang.Object defaultValue)
getOrDefault
in interface Feature
public java.lang.Object getOrDefault(java.lang.String name, int type, java.lang.Object defaultValue)
getOrDefault
in interface Feature
public java.lang.Object getOrDefault(java.lang.String name, DataType type, java.lang.Object defaultValue)
getOrDefault
in interface Feature
public java.lang.String getStringOrDefault(java.lang.String name, java.lang.String defaultValue)
getStringOrDefault
in interface Feature
public boolean getBooleanOrDefault(java.lang.String name, boolean defaultValue)
getBooleanOrDefault
in interface Feature
public int getIntOrDefault(java.lang.String name, int defaultValue)
getIntOrDefault
in interface Feature
public long getLongOrDefault(java.lang.String name, long defaultValue)
getLongOrDefault
in interface Feature
public float getFloatOrDefault(java.lang.String name, float defaultValue)
getFloatOrDefault
in interface Feature
public double getDoubleOrDefault(java.lang.String name, double defaultValue)
getDoubleOrDefault
in interface Feature
public java.math.BigDecimal getDecimalOrDefault(java.lang.String name, java.math.BigDecimal defaultValue)
getDecimalOrDefault
in interface Feature
public java.util.Date getDateOrDefault(java.lang.String name, java.util.Date defaultValue)
getDateOrDefault
in interface Feature
public java.lang.Object getOrDefault(int index, java.lang.Object defaultValue)
getOrDefault
in interface Feature
public java.lang.String getStringOrDefault(int index, java.lang.String defaultValue)
getStringOrDefault
in interface Feature
public boolean getBooleanOrDefault(int index, boolean defaultValue)
getBooleanOrDefault
in interface Feature
public int getIntOrDefault(int index, int defaultValue)
getIntOrDefault
in interface Feature
public long getLongOrDefault(int index, long defaultValue)
getLongOrDefault
in interface Feature
public float getFloatOrDefault(int index, float defaultValue)
getFloatOrDefault
in interface Feature
public double getDoubleOrDefault(int index, double defaultValue)
getDoubleOrDefault
in interface Feature
public java.math.BigDecimal getDecimalOrDefault(int index, java.math.BigDecimal defaultValue)
getDecimalOrDefault
in interface Feature
public java.util.Date getDateOrDefault(int index, java.util.Date defaultValue)
getDateOrDefault
in interface Feature
public void validate(int check) throws DataException
validate
in interface Feature
DataException
public java.util.List getSRSs()
Feature
public Envelope getDefaultEnvelope()
Feature
getDefaultEnvelope
in interface Feature
public Geometry getDefaultGeometry()
Feature
Geometry
.getDefaultGeometry
in interface Feature
public IProjection getDefaultSRS()
Feature
getDefaultSRS
in interface Feature
public java.util.List getGeometries()
Feature
getGeometries
in interface Feature
public java.lang.Object getFromProfile(int index)
getFromProfile
in interface Feature
public java.lang.Object getFromProfile(java.lang.String name)
getFromProfile
in interface Feature
public java.lang.Object get(java.lang.String name)
Feature
get
in interface Feature
get
in interface GetItemByKey<java.lang.String,java.lang.Object>
name
- a string containing the name of the attributepublic boolean has_key(java.lang.String key)
public java.util.List<java.lang.String> keys()
public java.util.Iterator<java.lang.String> iterkeys()
public java.util.Iterator iteritems()
public java.lang.Object get(int index)
Feature
public byte[] getByteArray(java.lang.String name)
getByteArray
in interface Feature
public byte[] getByteArray(int index)
getByteArray
in interface Feature
public java.lang.Object[] getArray(java.lang.String name)
Feature
public java.lang.Object[] getArray(int index)
Feature
public boolean getBoolean(java.lang.String name)
Feature
getBoolean
in interface Feature
name
- name of the attributepublic boolean getBoolean(int index)
Feature
getBoolean
in interface Feature
index
- position of the attributepublic byte getByte(java.lang.String name)
Feature
public byte getByte(int index)
Feature
public java.sql.Date getDate(java.lang.String name)
Feature
public java.sql.Date getDate(int index)
Feature
public java.sql.Time getTime(java.lang.String name)
public java.sql.Timestamp getTimestamp(java.lang.String name)
getTimestamp
in interface Feature
public java.sql.Timestamp getTimestamp(int index)
getTimestamp
in interface Feature
public double getDouble(java.lang.String name)
Feature
public double getDouble(int index)
Feature
public java.math.BigDecimal getDecimal(java.lang.String name)
Feature
getDecimal
in interface Feature
name
- name of the attributepublic java.math.BigDecimal getDecimal(int index)
Feature
getDecimal
in interface Feature
index
- position of the attributepublic Feature getFeature(java.lang.String name)
Feature
getFeature
in interface Feature
name
- name of the attributepublic Feature getFeature(int index)
Feature
getFeature
in interface Feature
index
- position of the attributepublic float getFloat(java.lang.String name)
Feature
public float getFloat(int index)
Feature
public Geometry getGeometry(java.lang.String name)
Feature
getGeometry
in interface Feature
name
- name of the attributepublic Geometry getGeometry(int index)
Feature
getGeometry
in interface Feature
index
- position of the attributepublic int getInt(java.lang.String name)
Feature
public int getInt(int index)
Feature
public long getLong(java.lang.String name)
Feature
public long getLong(int index)
Feature
public java.lang.String getString(java.lang.String name)
Feature
public java.lang.String getString(int index)
Feature
public java.lang.Object getContextValue(java.lang.String name)
getContextValue
in interface EvaluatorData
public java.util.Iterator getDataNames()
getDataNames
in interface EvaluatorData
public java.lang.Object getDataValue(java.lang.String name)
getDataValue
in interface EvaluatorData
public java.util.Iterator getDataValues()
getDataValues
in interface EvaluatorData
public boolean hasContextValue(java.lang.String name)
hasContextValue
in interface EvaluatorData
public boolean hasDataValue(java.lang.String name)
hasDataValue
in interface EvaluatorData
public DynObject getAsDynObject()
getAsDynObject
in interface Feature
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isInserted()
public void setInserted(boolean inserted)
inserted
- the inserted to setpublic EvaluatorData getEvaluatorData()
Feature
Evaluator
getEvaluatorData
in interface Feature
EvaluatorData
which returns the data of this
featurepublic boolean isEmpty()
public java.util.Iterator<java.lang.String> iterator()
public boolean containsKey(java.lang.String key)
public java.lang.String getLabelOfValue(java.lang.String name)
getLabelOfValue
in interface Feature
public void setExtraValue(java.lang.String name, java.lang.Object value)
setExtraValue
in interface Feature
public java.lang.Object getExtraColumnValue(java.lang.String name)
public java.lang.Object getExtraValue(java.lang.String name)
getExtraValue
in interface Feature
public boolean hasExtraValue(java.lang.String name)
hasExtraValue
in interface Feature
public java.lang.Object getExtraValue(int index)
getExtraValue
in interface Feature
public JsonObject toJson()
toJson
in interface SupportToJson
public JsonObject toJson(java.util.Map<java.lang.String,java.lang.Object> props)
toJson
in interface SupportToJson
public JsonObjectBuilder toJsonBuilder()
toJsonBuilder
in interface SupportToJson
public JsonObjectBuilder toJsonBuilder(java.util.Map<java.lang.String,java.lang.Object> props)
toJsonBuilder
in interface SupportToJson
public JsonObjectBuilder toJsonBuilderDefault(java.util.Map<java.lang.String,java.lang.Object> props)
public java.util.List<java.lang.String> getKeys()
public java.lang.String format(java.lang.String name)
public Feature getForeignFeature(java.lang.String attrName)
getForeignFeature
in interface Feature
public Expression createFilter()
createFilter
in interface Feature
public ExpressionBuilder createBuilderFilter()
createBuilderFilter
in interface Feature