public class DefaultFeatureQuery extends java.lang.Object implements FeatureQuery
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCALE_PARAM_NAME |
NO_LIMIT
Constructor and Description |
---|
DefaultFeatureQuery()
Creates a FeatureQuery which will load all available Features of a type.
|
DefaultFeatureQuery(FeatureType featureType)
Creates a FeatureQuery which will load all available Features of a type.
|
DefaultFeatureQuery(FeatureType featureType,
Evaluator filter)
Creates a FeatureQuery with the type of features, a filter and the order
for the FeatureCollection.
|
DefaultFeatureQuery(FeatureType featureType,
Evaluator filter,
double scale)
Creates a FeatureQuery with the type of features, a filter, the order for
the FeatureCollection and the view scale.
|
DefaultFeatureQuery(java.lang.String storeName) |
DefaultFeatureQuery(java.lang.String[] attributeNames)
Creates a FeatureQuery which will load a list of attribute names of all
available Features.
|
DefaultFeatureQuery(java.lang.String[] attributeNames,
Evaluator filter)
Creates a FeatureQuery with the list of attribute names of feature, a
filter and the order for the FeatureCollection.
|
DefaultFeatureQuery(java.lang.String[] attributeNames,
Evaluator filter,
double scale)
Creates a FeatureQuery with the list of attribute names of feature, a
filter, the order for the FeatureCollection and the view scale.
|
Modifier and Type | Method and Description |
---|---|
void |
addAggregate(java.lang.String funcName,
java.lang.String columnName) |
void |
addAttributeName(java.lang.String attributeName)
Adds the name of an attribute that has to be used to load each
Feature . |
void |
addConstantAttributeName(java.lang.String attributeName)
Add an attribute name that will be treated as constant for each
Feature . |
void |
addEssentialAttributeNames(FeatureStore store) |
void |
addFilter(Evaluator evaluator)
Adds a filter to apply to the
Feature s to load. |
void |
addFilter(Expression filter) |
void |
addFilter(java.lang.String filter) |
void |
addPrimaryKeyAttributeNames(FeatureStore store) |
void |
clearAttributeNames()
Remove all the attribute names specifieds.
|
void |
clearConstantsAttributeNames()
Remove all the names specified as constants attributes.
|
void |
clearFilter() |
void |
clearLimit() |
java.lang.Object |
clone()
Creates a copy of the object.
|
void |
copyFrom(FeatureQuery query) |
void |
fromJson(JsonObject json) |
java.lang.String |
getAggregate(java.lang.String name) |
java.lang.String |
getAggregate(java.lang.String tableName,
java.lang.String name) |
java.lang.String |
getAggregateFunction(java.lang.String name) |
java.util.Map<java.lang.String,java.lang.String> |
getAggregateFunctions()
Return the aggregate functions useds for every attribute of the feature.
|
java.lang.String[] |
getAttributeNames()
Returns the names of the attributes to load from each
Feature . |
java.lang.String[] |
getConstantsAttributeNames()
Returns the names of the attributes that are constants in each
Feature . |
FeatureQuery |
getCopy() |
Expression |
getExpressionFilter()
Return the Expression associated to the filter.
|
FeatureExtraColumns |
getExtraColumn()
Deprecated.
|
FeatureExtraColumns |
getExtraColumns()
Extra local columns to the query.
|
java.lang.String |
getFeatureTypeId()
Returns the
FeatureType id of the Feature s to load. |
Evaluator |
getFilter()
Returns the filter to apply to the
Feature s to load. |
java.util.List<java.lang.String> |
getGroupByColumns()
Return the names of attributes for group the features.
|
long |
getLimit()
Returns the maximum number of elements to return with this query.
|
FeatureQueryOrder |
getOrder()
Returns the order of the
Feature s to load. |
long |
getPageSize()
Returns the load page size, as the number of elements to be retrieved in
block by the data source.
|
java.lang.Object |
getQueryParameter(java.lang.String name)
Returns the value of an query parameter.
|
double |
getScale()
Returns the scale of the data to load.
|
MutableSymbolTable |
getSymbolTable() |
boolean |
hasAggregateFunctions() |
boolean |
hasAttributeNames()
Return true if has set attribute names
|
boolean |
hasConstantsAttributeNames()
Return true if has set constants attribute names
|
boolean |
hasFilter()
Returns if a filter has been defined for the query.
|
boolean |
hasGroupByColumns() |
boolean |
hasLimit() |
boolean |
hasOrder()
Returns if an order has been set for the elements returned by the query.
|
boolean |
isAggregate(java.lang.String name) |
boolean |
isAGroupByColumn(java.lang.String name) |
boolean |
isUseSubquery()
Returns true if a subquery should be used.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
removeAggregateFunction(java.lang.String colname) |
void |
removeGroupByColumn(java.lang.String colname) |
void |
retrievesAllAttributes() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
static void |
selfRegister() |
void |
setAttributeNames(java.lang.String[] attributeNames)
Sets the names of the attributes to load from each
Feature . |
void |
setConstantsAttributeNames(java.lang.String[] constantsAttributeNames)
Set of attribute names to be treated as constants for each
Feature . |
void |
setFeatureType(FeatureType featureType)
Sets the
FeatureType of the Feature s to load. |
void |
setFeatureTypeId(java.lang.String featureTypeId)
Sets the
FeatureType id of the Feature s to load. |
void |
setFilter(Evaluator filter)
Sets the filter to apply to the
Feature s to load. |
void |
setFilter(Expression filter) |
void |
setFilter(java.lang.String filter) |
void |
setLimit(long limit)
Sets the maximum number of elements to return with this query.
|
void |
setOrder(FeatureQueryOrder order)
Sets the order of the
Feature s to load. |
void |
setPageSize(long pageSize)
Sets the load page size, as the number of elements to be retrieved in block
by the data source.
|
void |
setQueryParameter(java.lang.String name,
java.lang.Object value)
Sets the value of an query parameter.
|
void |
setScale(double scale)
Sets the scale.
|
void |
setSymbolTable(MutableSymbolTable symbolTable) |
void |
setUseSubquery(boolean useSubquery)
Indicates whether to use a subquery or not in case the connection has
an sql indicated.
|
void |
setVar(java.lang.String name,
java.lang.Object value)
Set a variable in the symbol table associated to this searchPanel.
|
JsonObjectBuilder |
toJsonBuilder() |
java.lang.String |
toString() |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cloneQuietly, cloneQuietly
toJson, toJson, toJsonBuilder
public static final java.lang.String SCALE_PARAM_NAME
public DefaultFeatureQuery()
public DefaultFeatureQuery(java.lang.String storeName)
public DefaultFeatureQuery(FeatureType featureType)
featureType
- the type of Features of the querypublic DefaultFeatureQuery(FeatureType featureType, Evaluator filter)
featureType
- the type of Features of the queryfilter
- based on the properties of the Featurespublic DefaultFeatureQuery(FeatureType featureType, Evaluator filter, double scale)
featureType
- the type of Features of the queryfilter
- based on the properties of the Featuresscale
- to view the Features.public DefaultFeatureQuery(java.lang.String[] attributeNames)
attributeNames
- the list of attribute names to loadpublic DefaultFeatureQuery(java.lang.String[] attributeNames, Evaluator filter)
attributeNames
- the list of attribute names to loadfilter
- based on the properties of the Featurespublic DefaultFeatureQuery(java.lang.String[] attributeNames, Evaluator filter, double scale)
attributeNames
- the list of attribute names to loadfilter
- based on the properties of the Featuresscale
- to view the Features.public double getScale()
DataQuery
public final void setScale(double scale)
DataQuery
public java.lang.Object getQueryParameter(java.lang.String name)
DataQuery
getQueryParameter
in interface DataQuery
name
- of the parameterpublic void setQueryParameter(java.lang.String name, java.lang.Object value)
DataQuery
setQueryParameter
in interface DataQuery
name
- of the query parametervalue
- for the query parameterpublic final void setFeatureType(FeatureType featureType)
FeatureQuery
FeatureType
of the Feature
s to load. It may be
used as an alternative way to set a subset of the list of attribute names
to load, by creating a sub-FeatureType.setFeatureType
in interface FeatureQuery
featureType
- the feature type of the data to loadpublic java.lang.String[] getAttributeNames()
FeatureQuery
Feature
.getAttributeNames
in interface FeatureQuery
public final void setAttributeNames(java.lang.String[] attributeNames)
FeatureQuery
Feature
.setAttributeNames
in interface FeatureQuery
attributeNames
- the attribute names to loadpublic void retrievesAllAttributes()
retrievesAllAttributes
in interface FeatureQuery
public void addAttributeName(java.lang.String attributeName)
FeatureQuery
Feature
.addAttributeName
in interface FeatureQuery
attributeName
- the attribute name to loadpublic void addEssentialAttributeNames(FeatureStore store)
addEssentialAttributeNames
in interface FeatureQuery
public void addPrimaryKeyAttributeNames(FeatureStore store)
addPrimaryKeyAttributeNames
in interface FeatureQuery
public boolean hasAttributeNames()
FeatureQuery
hasAttributeNames
in interface FeatureQuery
public void clearAttributeNames()
FeatureQuery
clearAttributeNames
in interface FeatureQuery
public Evaluator getFilter()
FeatureQuery
Feature
s to load.getFilter
in interface FeatureQuery
public Expression getExpressionFilter()
FeatureQuery
getExpressionFilter
in interface FeatureQuery
public void setFilter(Expression filter)
setFilter
in interface FeatureQuery
public void setFilter(java.lang.String filter)
setFilter
in interface FeatureQuery
public void setFilter(Evaluator filter)
FeatureQuery
Feature
s to load.setFilter
in interface FeatureQuery
filter
- the filter to apply to the Feature
s to loadpublic void addFilter(java.lang.String filter)
addFilter
in interface FeatureQuery
public void addFilter(Expression filter)
addFilter
in interface FeatureQuery
public void addFilter(Evaluator evaluator)
FeatureQuery
Feature
s to load. A query can have
more that one filter and all of them are applied when the query is applied.
If filter is null do nothing.addFilter
in interface FeatureQuery
evaluator
- a filter to apply to the Feature
s to loadpublic void clearFilter()
clearFilter
in interface FeatureQuery
public FeatureQueryOrder getOrder()
FeatureQuery
Feature
s to load.getOrder
in interface FeatureQuery
Feature
s to loadpublic void setOrder(FeatureQueryOrder order)
FeatureQuery
Feature
s to load.setOrder
in interface FeatureQuery
order
- the order of the Feature
s to loadpublic boolean hasFilter()
FeatureQuery
hasFilter
in interface FeatureQuery
public boolean hasLimit()
hasLimit
in interface FeatureQuery
public boolean hasOrder()
FeatureQuery
hasOrder
in interface FeatureQuery
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 FeatureQuery getCopy()
getCopy
in interface FeatureQuery
Cloneable.clone()
public java.lang.String getFeatureTypeId()
FeatureQuery
FeatureType
id of the Feature
s to load.getFeatureTypeId
in interface FeatureQuery
FeatureType
id of the Feature
s to loadpublic void setFeatureTypeId(java.lang.String featureTypeId)
FeatureQuery
setFeatureTypeId
in interface FeatureQuery
featureTypeId
- the FeatureType
id of the Feature
s to
loadpublic void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public static void selfRegister()
public long getLimit()
FeatureQuery
NOTE: this value may be ignored by the underlying data source, or only used as a hint, so don't rely on it being used, as you may actually get more values than the limit.
getLimit
in interface FeatureQuery
public long getPageSize()
FeatureQuery
getPageSize
in interface FeatureQuery
public void setLimit(long limit)
FeatureQuery
NOTE: this value may be ignored by the underlying data source, or only used as a hint, so don't rely on it being used, as you may actually get more values than the limit.
setLimit
in interface FeatureQuery
limit
- the maximum number of elements to return with this querypublic void clearLimit()
clearLimit
in interface FeatureQuery
public void setPageSize(long pageSize)
FeatureQuery
setPageSize
in interface FeatureQuery
pageSize
- the load page sizepublic java.lang.String[] getConstantsAttributeNames()
FeatureQuery
Feature
. These attributes will not be charged.getConstantsAttributeNames
in interface FeatureQuery
public void setConstantsAttributeNames(java.lang.String[] constantsAttributeNames)
FeatureQuery
Feature
.setConstantsAttributeNames
in interface FeatureQuery
constantsAttributeNames
- the attribute names to be constantspublic void addConstantAttributeName(java.lang.String attributeName)
FeatureQuery
Feature
.addConstantAttributeName
in interface FeatureQuery
attributeName
- the attribute name to be treated as constantpublic boolean hasConstantsAttributeNames()
FeatureQuery
hasConstantsAttributeNames
in interface FeatureQuery
public void clearConstantsAttributeNames()
FeatureQuery
clearConstantsAttributeNames
in interface FeatureQuery
public boolean isAGroupByColumn(java.lang.String name)
isAGroupByColumn
in interface FeatureQuery
public java.util.List<java.lang.String> getGroupByColumns()
FeatureQuery
getGroupByColumns
in interface FeatureQuery
public void removeGroupByColumn(java.lang.String colname)
removeGroupByColumn
in interface FeatureQuery
public void addAggregate(java.lang.String funcName, java.lang.String columnName)
addAggregate
in interface FeatureQuery
public java.util.Map<java.lang.String,java.lang.String> getAggregateFunctions()
FeatureQuery
getAggregateFunctions
in interface FeatureQuery
public void removeAggregateFunction(java.lang.String colname)
removeAggregateFunction
in interface FeatureQuery
public java.lang.String getAggregateFunction(java.lang.String name)
getAggregateFunction
in interface FeatureQuery
public java.lang.String getAggregate(java.lang.String name)
getAggregate
in interface FeatureQuery
public java.lang.String getAggregate(java.lang.String tableName, java.lang.String name)
getAggregate
in interface FeatureQuery
public boolean isAggregate(java.lang.String name)
isAggregate
in interface FeatureQuery
public boolean hasAggregateFunctions()
hasAggregateFunctions
in interface FeatureQuery
public boolean hasGroupByColumns()
hasGroupByColumns
in interface FeatureQuery
public void copyFrom(FeatureQuery query)
copyFrom
in interface FeatureQuery
public FeatureExtraColumns getExtraColumns()
FeatureQuery
getExtraColumns
in interface FeatureQuery
@Deprecated public FeatureExtraColumns getExtraColumn()
getExtraColumn
in interface FeatureQuery
public MutableSymbolTable getSymbolTable()
getSymbolTable
in interface FeatureQuery
public void setSymbolTable(MutableSymbolTable symbolTable)
setSymbolTable
in interface FeatureQuery
public void setVar(java.lang.String name, java.lang.Object value)
FeatureQuery
setVar
in interface FeatureQuery
public boolean isUseSubquery()
FeatureQuery
isUseSubquery
in interface FeatureQuery
public void setUseSubquery(boolean useSubquery)
FeatureQuery
setUseSubquery
in interface FeatureQuery
public void fromJson(JsonObject json)
fromJson
in interface SupportFromJson
public JsonObjectBuilder toJsonBuilder()
toJsonBuilder
in interface SupportToJson
public java.lang.String toString()
toString
in class java.lang.Object