com.supermap.services

Class FeatureSet

  • java.lang.Object
    • com.supermap.services.FeatureSet


  • public class FeatureSet
    extends java.lang.Object
    The FeatureSet class.

    This class stores the data get from the server.

    • Constructor Summary

      Constructors 
      Constructor and Description
      FeatureSet(FieldInfos fieldInfos)
      Create a FeatureSet object from the field
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean delete()
      Used to delete the current feature, return true if succeed.
      boolean deleteAll()
      Deletes all elements in the specific FeatureSet.
      boolean fromRecordset(Recordset recordset)
      Convert from Recordset to featureset
      boolean getBoolean(java.lang.String fieldname)
      Used to return the field value of the current feature in boolean.
      byte getByte(java.lang.String fieldname)
      Used to return the field value of the current feature in byte.
      java.sql.Date getDateTime(java.lang.String fieldname)
      Get the field value form the current feature in date.
      double getDouble(java.lang.String fieldname)
      Used to return the field value of the current feature in double.
      int getFeatureCount()
      Return the count of elements in the feature collection.
      int getFieldCount()
      Returns the number of fields in the FieldInfos object of the feature collection.
      FieldInfos getFieldInfos()
      Gets the FieldInfos object in the FeatureSet.
      java.lang.Object getFieldValue(java.lang.String fieldname)
      Return the value of this field in the current feature according to the given field name.
      Geometry getGeometry()
      Get the geometry object in the current element.
      int getID()
      Used to returns the ID of the geometry object of the current Feature (The value of SmID).
      short getInt16(java.lang.String fieldname)
      Return the field value of the current feature in 16 integer.
      int getInt32(java.lang.String fieldname)
      Return the field value of the current feature in 32 integer.
      long getInt64(java.lang.String fieldname)
      Return the field value of the current feature in 64 integer.
      float getSingle(java.lang.String fieldname)
      Used to return the field value of the current feature in float.
      java.lang.String getString(java.lang.String fieldname)
      Used to return the field value of the current feature in text.
      boolean isBOF()
      Returns whether the current element is in front of the first element in the collection.
      boolean isEOF()
      Determines whether the current element is behind the last element in the collection.
      boolean isReadOnly()
      Returns whether the FeatureSet is read only or not.
      boolean moveFirst()
      Used to remove the current feature to the first, make the first feature to be the current feature.
      boolean moveLast()
      Used to remove the current feature to the last, make the last feature to be the current feature.
      boolean moveNext()
      Remove the current feature to the next location, make the next feature to be the current feature.
      boolean movePrev()
      Remove the current feature to the previous location, make the previous feature to be the current feature.
      boolean setBoolean(java.lang.String fieldname, boolean value)
      Sets the value for a field in a FeatureSet.
      boolean setByte(java.lang.String fieldname, byte value)
      Sets the value of a field for the current record int he FeatureSet.
      boolean setDateTime(java.lang.String fieldname, java.sql.Date date)
      Sets the value for a field in a FeatureSet.
      boolean setDouble(java.lang.String fieldname, double value)
      Sets the value for a field in a FeatureSet.
      boolean setFieldValue(java.lang.String fieldname, java.lang.Object value)
      Sets value for a field specified by the field name.
      boolean setInt16(java.lang.String fieldname, short value)
      Sets the value of a field as a "16 bit integer" for the current record in the FeatureSet.
      boolean setInt32(java.lang.String fieldname, int value)
      Sets the value for a field in a FeatureSet.
      boolean setInt64(java.lang.String fieldname, long value)
      Sets the value for a field in a FeatureSet.
      boolean setSingle(java.lang.String fieldname, float value)
      Sets the value for a field in a FeatureSet.
      boolean setString(java.lang.String fieldname, java.lang.String value)
      Sets the value for a field in a FeatureSet.
      boolean toRecordset(Recordset recordset)
      Convert the current Featureset to Recordset
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FeatureSet

        public FeatureSet(FieldInfos fieldInfos)
        Create a FeatureSet object from the field
        Parameters:
        fieldInfos - field information collection
    • Method Detail

      • getGeometry

        public Geometry getGeometry()
        Get the geometry object in the current element.
        Returns:
        Returns the geometric object if successful; otherwise, false.
      • getFieldInfos

        public FieldInfos getFieldInfos()
        Gets the FieldInfos object in the FeatureSet.
        Returns:
        A copy of FieldInfos.
      • getFieldCount

        public int getFieldCount()
        Returns the number of fields in the FieldInfos object of the feature collection.
        Returns:
        The count of fields of feature in the feature collection.
      • isBOF

        public boolean isBOF()
        Returns whether the current element is in front of the first element in the collection.
        Returns:
        A boolean, return true if the current element is in front of the first element in the collection.
      • isEOF

        public boolean isEOF()
        Determines whether the current element is behind the last element in the collection.
        Returns:
        A boolean, return true if the current element behind the last element in the collection.
      • getFeatureCount

        public int getFeatureCount()
        Return the count of elements in the feature collection.
        Returns:
        The count of elements in the feature collection.
      • deleteAll

        public boolean deleteAll()
        Deletes all elements in the specific FeatureSet. This method will delete the record permanently.

        This method is invalid for read-only recordset.

        Returns:
        Returns true if successful; otherwise false.
      • getFieldValue

        public java.lang.Object getFieldValue(java.lang.String fieldname)
        Return the value of this field in the current feature according to the given field name.
        Parameters:
        fieldname - field name
        Returns:
        The specified field value of the current feature.
      • getInt32

        public int getInt32(java.lang.String fieldname)
        Return the field value of the current feature in 32 integer.

        Returns the value of specified field, if the type is not 32 bit integer, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field that is waiting for return.
        Returns:
        The field value of the current feature in 32 integer.
      • getInt64

        public long getInt64(java.lang.String fieldname)
        Return the field value of the current feature in 64 integer.

        Returns the value of specified field, if the type is not 64 bit integer, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field that is waiting for return.
        Returns:
        The field value of the current feature in 64 integer.
      • getInt16

        public short getInt16(java.lang.String fieldname)
        Return the field value of the current feature in 16 integer.

        Returns the value of specified field, if the type is not 16 bit integer, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field that is waiting for return.
        Returns:
        The field value of the current feature in 16 integer.
      • getDateTime

        public java.sql.Date getDateTime(java.lang.String fieldname)
        Get the field value form the current feature in date.

        Returns the value of specified field, if the type is not date type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        Returns:
        The field value form the current feature in date.
      • getSingle

        public float getSingle(java.lang.String fieldname)
        Used to return the field value of the current feature in float.

        Returns the value of specified field, if the type is not single-precision type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        Returns:
        The field value form the current feature in float.
      • moveFirst

        public boolean moveFirst()
        Used to remove the current feature to the first, make the first feature to be the current feature.
        Returns:
        True, if successful; Otherwise false.
      • moveLast

        public boolean moveLast()
        Used to remove the current feature to the last, make the last feature to be the current feature.
        Returns:
        True, if successful; Otherwise false.
      • moveNext

        public boolean moveNext()
        Remove the current feature to the next location, make the next feature to be the current feature.
        Returns:
        True, if successful; Otherwise false.
      • movePrev

        public boolean movePrev()
        Remove the current feature to the previous location, make the previous feature to be the current feature.
        Returns:
        True, if successful; Otherwise false.
      • setFieldValue

        public boolean setFieldValue(java.lang.String fieldname,
                                     java.lang.Object value)
        Sets value for a field specified by the field name. Returns true if successful.
        Parameters:
        fieldname - The field name at which the field value would be assigned.
        value - new field value.
        Returns:
        true if successful; otherwise, false.
      • setDateTime

        public boolean setDateTime(java.lang.String fieldname,
                                   java.sql.Date date)
        Sets the value for a field in a FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not DateTime type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        date - value to be set.
        Returns:
        True if successful; otherwise, false.
      • setInt16

        public boolean setInt16(java.lang.String fieldname,
                                short value)
        Sets the value of a field as a "16 bit integer" for the current record in the FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not 16 bit integer, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field.
        value - The short value to be set.
        Returns:
        True if successful; otherwise, false.
      • setInt32

        public boolean setInt32(java.lang.String fieldname,
                                int value)
        Sets the value for a field in a FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not 32 bit integer, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field that is waiting for return.
        value - value to be set.
        Returns:
        true if successful; otherwise, false.
      • setInt64

        public boolean setInt64(java.lang.String fieldname,
                                long value)
        Sets the value for a field in a FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not 64 bit integer, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field that is waiting for return.
        value - value to be set.
        Returns:
        true if successful; otherwise, false.
      • setSingle

        public boolean setSingle(java.lang.String fieldname,
                                 float value)
        Sets the value for a field in a FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not single-precision type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        value - value to be set.
        Returns:
        true if successful; otherwise, false.
      • getBoolean

        public boolean getBoolean(java.lang.String fieldname)
        Used to return the field value of the current feature in boolean.

        Returns the value of specified field, if the type is not boolean type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        Returns:
        The field value form the current feature in boolean.
      • getByte

        public byte getByte(java.lang.String fieldname)
        Used to return the field value of the current feature in byte.

        Returns the value of specified field, if the type is not byte type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field that is waiting for return.
        Returns:
        The field value form the current feature in byte.
      • getDouble

        public double getDouble(java.lang.String fieldname)
        Used to return the field value of the current feature in double.

        Returns the value of specified field, if the type is not double-precision type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        Returns:
        the field value form the current feature in double.
      • setBoolean

        public boolean setBoolean(java.lang.String fieldname,
                                  boolean value)
        Sets the value for a field in a FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not boolean type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        value - value to be set.
        Returns:
        True if successful; otherwise, false.
      • setByte

        public boolean setByte(java.lang.String fieldname,
                               byte value)
        Sets the value of a field for the current record int he FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not byte type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The specified name of field.
        value - byte value to be set.
        Returns:
        A boolean. Return true if successful; otherwise, false.
      • setDouble

        public boolean setDouble(java.lang.String fieldname,
                                 double value)
        Sets the value for a field in a FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not double-precision type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        value - value to be set.
        Returns:
        True if successful; otherwise, false.
      • delete

        public boolean delete()
        Used to delete the current feature, return true if succeed.

        This method is invalid for read-only recordset.

        Returns:
        Returns true if successful; otherwise false.
      • isReadOnly

        public boolean isReadOnly()
        Returns whether the FeatureSet is read only or not. If it is, returns true, that means the FeatureSet can not be modified.
        Returns:
        Whether the FeatureSet object is read only.
      • getString

        public java.lang.String getString(java.lang.String fieldname)
        Used to return the field value of the current feature in text.

        Returns the value of specified field, if the type is not text type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        Returns:
        The field value form the current feature in text.
      • getID

        public int getID()
        Used to returns the ID of the geometry object of the current Feature (The value of SmID).
        Returns:
        The ID of the Geometry object.
      • setString

        public boolean setString(java.lang.String fieldname,
                                 java.lang.String value)
        Sets the value for a field in a FeatureSet. Returns true if set successfully.

        Sets the value of specified field, if the type is not text type, the data may be changed, lost, or unable to return.

        Parameters:
        fieldname - The field name whose value would be got.
        value - value to be set.
        Returns:
        True if successful; otherwise, false.
      • toRecordset

        public boolean toRecordset(Recordset recordset)
        Convert the current Featureset to Recordset
        Parameters:
        recordset - Converted result recordset
        Returns:
        True, if conversion successful; Otherwise false.
      • fromRecordset

        public boolean fromRecordset(Recordset recordset)
        Convert from Recordset to featureset
        Parameters:
        recordset - Recordset for conversion to featrueset
        Returns:
        True, if conversion successful; Otherwise false.