com.esri.aims.mtier.model.map.layer.query
Class Recordset

java.lang.Object
  extended by com.esri.aims.mtier.model.map.layer.query.Recordset
All Implemented Interfaces:
Serializable

public class Recordset
extends Object
implements Serializable

Contains a collections of Records, Geometry, and Envelope objects associated with a specific query against a layer. The Recordset object get instantiated after a filter has been applied to a FeatureLayer. Before applying a different Filter, call clearRecordset() method to remove records from previous Filter operation.

See Also:
Serialized Form

Constructor Summary
Recordset()
          Creates an instance of a Recordset object.
 
Method Summary
 boolean addEnvelope(Envelope object)
          Adds the given Envelope objects to an envelope collection in this Recordset.
 boolean addGeometry(Geometry object)
          Adds the given Geometry objects to the Geometry collection.
 boolean addRecords(Records object)
          Adds the given Records objects to a records object collection in this Recordset.
 void clearEnvelope()
          Clears all Envelope objects from the envelopes collection.
 void clearGeometry()
          Clears all Geometry objects from the geometry object collection.
 void clearRecordset()
          Clears all Records, Envelope, and Geometry objects from the Recordset object.
 int getCount()
          Returns the number of records that are actually in the Recordset at a certain time.
 Envelope getEnvelope(int index)
          Returns the Envelope associated with this Recordset.
 int getEnvelopeCount()
          Returns a count of the Envelope objects in the envelope collection.
 long getFeaturesCount()
          Returns the value of attributes "count" in the ArcXML Response <FEATURECOUNT>.
 Collection getGeometry()
          Returns the collection of geometry objects.
 Geometry getGeometry(int index)
          Returns the Geometry object associated with this Recordset.
 int getGeometryCount()
          Returns the count of the Geometry objects in the Geometry objects collection.
 Records getRecords(int index)
          Returns the Records object at given index in this Recordset.
 TableDesc getTableDesc()
          Returns the TableDesc associated with this Recordset object.
 boolean isHasMore()
          Returns the value of ArcXML attribute "hasmore".
 void setFeaturesCount(long value)
          Sets the value of ArcXML attribute "count" from the Response
 void setGeometry(Collection geometry)
          Sets the collection of geometry objects.
 void setHasMore(boolean value)
          Sets the value of ArcXML attribute "hasmore" from the Response
 void setTableDesc(TableDesc object)
          Sets the TableDesc object of the Recordset object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Recordset

public Recordset()
Creates an instance of a Recordset object. Example:
Recordset recordset = new Recordset();

Method Detail

getCount

public int getCount()
Returns the number of records that are actually in the Recordset at a certain time. It is 0 when setSkipFeatures is set to true in Filter, in the following code: Example:
 filter.setWhereExpression="POP1990>1000";
 filter.setSkipFeatures(true);
 layer.setFilterObject(filter);
 map.refresh();
 int count = layer.getRecordset.getCount();
 int featurecount=layer.getRecordset.getFeaturesCount();
 
featurecount is the number of records that satisfy the WhereExpression, while count is 0 since no records are actually returned.
If a feature record in the ArcXML response contains special characters, e.g. the ampersand, this feature will be skipped, and count will be less than expected. To avoid this, call setCheckesc() function in Filter and set it to true.

 filter.setCheckesc(true);
 
See KB article 23879 for more information.

Returns:
the count as integer.

getRecords

public Records getRecords(int index)
Returns the Records object at given index in this Recordset. Example:
Records records = recordset.getRecords(0);

Parameters:
index - the Records object to return.
Returns:
Records

getTableDesc

public TableDesc getTableDesc()
Returns the TableDesc associated with this Recordset object. Example:
TableDesc tabledesc = recordset.getTableDesc();

Returns:
the TableDesc object.

getEnvelopeCount

public int getEnvelopeCount()
Returns a count of the Envelope objects in the envelope collection. Example:
int envCount = recordset.getEnvelopeCount();

Returns:
integer

getEnvelope

public Envelope getEnvelope(int index)
Returns the Envelope associated with this Recordset. Example:
Envelope env = recordset.getEnvelope(0);

Parameters:
index - the Envelope to return.
Returns:
the Envelope object.

getGeometryCount

public int getGeometryCount()
Returns the count of the Geometry objects in the Geometry objects collection. Example:
int geometryCount = recordset.getGeometryCount();

Returns:
int
See Also:
getGeometry(int), addGeometry(com.esri.aims.mtier.model.map.layer.query.Geometry)

addGeometry

public boolean addGeometry(Geometry object)
Adds the given Geometry objects to the Geometry collection. It is used after the Features response with the geometry information is received. Geometry objects are created and added from responses from the ArcIMS Application Server.

Parameters:
object - the Geometry object
Returns:
boolean
See Also:
getGeometry(int), getGeometryCount()

getGeometry

public Geometry getGeometry(int index)
Returns the Geometry object associated with this Recordset. The Geometry object contains all x, y coordinates that make up the selected features shape. Example: Geometry geom = recordset.getGeometry(0);

Parameters:
index - the Geometry item to return from the Geometry collection.
Returns:
Geometry
See Also:
getGeometryCount(), addGeometry(com.esri.aims.mtier.model.map.layer.query.Geometry)

clearGeometry

public void clearGeometry()
Clears all Geometry objects from the geometry object collection. Example:
recordset.clearGeometry();

See Also:
addGeometry(com.esri.aims.mtier.model.map.layer.query.Geometry), getGeometry(int), getGeometryCount()

clearEnvelope

public void clearEnvelope()
Clears all Envelope objects from the envelopes collection. Example:
recordset.clearEnvelope();

See Also:
addEnvelope(com.esri.aims.mtier.model.envelope.Envelope), getEnvelope(int), getEnvelopeCount()

addEnvelope

public boolean addEnvelope(Envelope object)
Adds the given Envelope objects to an envelope collection in this Recordset. Envelope objects are created and added by responses from the ArcIMS Application Server.

Parameters:
object - the Envelope object. Is used after FEATURES response is received and parsed.
Returns:
boolean
See Also:
getEnvelope(int), clearEnvelope(), getEnvelopeCount()

addRecords

public boolean addRecords(Records object)
Adds the given Records objects to a records object collection in this Recordset. Records objects are created and added by responses from the ArcIMS Application Server.

Parameters:
object - the Records object. Is used after FEATURES response is received and parsed.
Returns:
boolean

setTableDesc

public void setTableDesc(TableDesc object)
Sets the TableDesc object of the Recordset object. Is used after the SERVICEINFO response is received and parsed. The TableDesc object is created and set by the response from the ArcIMS Application Server.

Parameters:
object - the TableDesc object.

clearRecordset

public void clearRecordset()
Clears all Records, Envelope, and Geometry objects from the Recordset object. Commonly used to prepare for the next Filter operation. Example:
recordset.clearRecordset();


setHasMore

public void setHasMore(boolean value)
Sets the value of ArcXML attribute "hasmore" from the Response

See Also:
isHasMore()

isHasMore

public boolean isHasMore()
Returns the value of ArcXML attribute "hasmore".

 long fl = 5;
 filter.setFeatureLimit(fl);
 filter.setBeginRecord(0);
 if (recordset.isHasMore()){
  filter.setFeatureLimit(fl);
  filter.setBeginRecord(fl+1);
 }
 

Returns:
true if there are more records available

setFeaturesCount

public void setFeaturesCount(long value)
Sets the value of ArcXML attribute "count" from the Response

See Also:
getFeaturesCount()

getFeaturesCount

public long getFeaturesCount()
Returns the value of attributes "count" in the ArcXML Response <FEATURECOUNT>.

 long fCount = recordset.getFeaturesCount();
 

Returns:
the value of attributes "count" in the ArcXML Response <FEATURECOUNT>

setGeometry

public void setGeometry(Collection geometry)
Sets the collection of geometry objects.

Parameters:
geometry - the geometry collection

getGeometry

public Collection getGeometry()
Returns the collection of geometry objects. It can be type of Polygon, Polyline or Points

Returns:
Collection- the collection of geometry objects