com.supermap.data

Class Recordset

  • java.lang.Object
    • com.supermap.data.Recordset


  • public class Recordset
    extends java.lang.Object

    The recordset class.

    Using this class, you can perform operations on the data in the vector dataset.

    For the data that is stored in a file, the spatial geometry information and attribute information are stored separately. Actually, record set treats the file the same way as the database, that is to say, for the record set, it assumes all data are stored in a table, where the geometry and attribute information are stored together in the fields like a DBMS table does. Of course, there may be some background operations on the file data to make this assumption work, which we do not need to know, and this way, the record set is a subclass of that table, so that modifications can be done to the data in the record set. We can see that the record set provides a way to operate the data in the storing table. A row in the record set represents a feature or a record (for tabular vector data) , while a column of the record set is called a field.

    There are two ways to get the recordset: one is selecting several geometric objects in the MapControl and converting the selection to the Recordset; the other is getting the recordset from a vector dataset. You can either return a recordset from a vector dataset through the DatasetVector.getRecordset() method , or with the query statement. The difference is that the DatasetVector.getRecordset() method returns all spatial and attribute information of all records of the dataset; however, the query statement returns the records satisfying the statement. .

    Note: Once the Recordset object is got by user, the resources occupied by this object should be released.

    Example:
    The following example demonstrates how to delete and add a record. Suppose opening a workspace object which contains a datasource object. workspace .
     public void recordsetTest() {
            // Get the World region dataset and Example region dataset.
            DatasetVector dataset_world = (DatasetVector) datasource.getDatasets().get("World");
            DatasetVector dataset = (DatasetVector) datasource.getDatasets().get("Example");
     
            //Gets all recordsets related to "Example" and the record whose SmID is 1 in the World dataset
            Recordset recordset = dataset.getRecordset(false, CursorType.DYNAMIC);
            QueryParameter parameter = new QueryParameter();
            parameter.setAttributeFilter("SmID=1");
            parameter.setCursorType(CursorType.STATIC);
            Recordset recordset_world = dataset_world.query(parameter);
     
            //Move the record position to the first one
            recordset.moveFirst();
     
            //Deletes the current record
            recordset.delete();
     
            //Add the record whose SmID is 1 in the World dataset to the recordset and commit it
            Geometry geometry = recordset_world.getGeometry();
            recordset.update();
            recordset.addNew(geometry);
            recordset.update();
     
            // Close recordset and release geometry and recordset.
            recordset.close();
            geometry.dispose();
            recordset.dispose();
            recordset_world.dispose();
     }
     
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      class  Recordset.BatchEditor
      This class is the nested class of the Recordset class which provides the batch edit of the records.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean addNew(Geometry geometry)
      Appends one record to Recordset.
      boolean addNew(Geometry geometry, java.util.Map<java.lang.String,java.lang.Object> values)
      Add Geometry object and set the field value.
      boolean cancelUpdate()
      Cancels all changes to current or new record before calling Update.
      void close()
      It is used for closing a record set Close a record set immediately after using it
      boolean delete()
      Deletes the current recordset in dataset.
      boolean deleteAll()
      Deletes all records in the specific Recordset.
      void dispose()
      Releases all resources that the object occupies.
      boolean edit()
      Locks and edits the current record in Recordset.
      boolean fromGeoJSON(java.lang.String geoJSON)
      Gets the geometry and its attributes from the GeoJSON string, and update it to the dataset The supported geometry type includes: point, line, region, multi line
      Recordset.BatchEditor getBatch()
      Returns the objects for batch modification.
      boolean getBoolean(int index)
      The value of the "Boolean" field in the current record from the attribute table of the dataset.
      boolean getBoolean(java.lang.String name)
      The value of the "Boolean" field in the current record from the attribute table of the dataset.
      Rectangle2D getBounds()
      Returns the boundary rectangle of the Recordset.
      byte getByte(int index)
      The value of the "byte" field in the current record from the attribute table of the dataset.
      byte getByte(java.lang.String name)
      The value of the "byte" field in the current record from the attribute table of the dataset.
      DatasetVector getDataset()
      Returns the corresponding dataset of the Recordset.
      java.util.Date getDateTime(int index)
      The value of the "date" field in the current record from the attribute table of the dataset.
      java.util.Date getDateTime(java.lang.String name)
      The value of the "date" field in the current record from the attribute table of the dataset.
      double getDouble(int index)
      The value of the "double-precision" field in the current record from the attribute table of the dataset.
      double getDouble(java.lang.String name)
      The value of the "double-precision" field in the current record from the attribute table of the dataset.
      int getFieldCount()
      Returns the number of the Field in the Recordset.
      FieldInfos getFieldInfos()
      Returns the FieldInfos object of the Recordset.
      java.lang.Object getFieldValue(int index)
      Returns the field value of the current record in attribute table according to the index of the field.
      java.lang.Object getFieldValue(java.lang.String name)
      Returns the field value of the current record in attribute table according to the name of the field.
      Geometry getGeometry()
      The geometric object of the current Recordset in attribute table.
      int getID()
      Returns the ID (SmID) of geometric object corresponding to the current record in the attribute table.
      short getInt16(int index)
      The value of the "16 bit integer" field in the current record from the attribute table of the dataset.
      short getInt16(java.lang.String name)
      The value of the "16 bit integer" field in the current record from the attribute table of the dataset.
      int getInt32(int index)
      The value of the "32 bit integer" field in the current record from the attribute table of the dataset.
      int getInt32(java.lang.String name)
      The value of the "32 bit integer" field in the current record from the attribute table of the dataset.
      long getInt64(int index)
      The value of the "64 bit integer" field in the current record from the attribute table of the dataset.
      long getInt64(java.lang.String name)
      The value of the "64 bit integer" field in the current record from the attribute table of the dataset.
      byte[] getLongBinary(int index)
      The value of the "binary" field in the current record from the attribute table of the dataset.
      byte[] getLongBinary(java.lang.String name)
      The value of the "binary" field in the current record from the attribute table of the dataset.
      QueryParameter getQueryParameter()
      Gets the query parameters of the current Recordset, and returns a copy.
      int getRecordCount()
      Returns the number of the records in the Recordset.
      float getSingle(int index)
      The value of the "single-precision" field in the current record from the attribute table of the dataset.
      float getSingle(java.lang.String name)
      The value of the "single-precision" field in the current record from the attribute table of the dataset.
      java.lang.String getString(int index)
      The value of the "text" field in the current record from the attribute table of the dataset.
      java.lang.String getString(java.lang.String name)
      The value of the "text" field in the current record from the attribute table of the dataset.
      boolean isBOF()
      Indicates whether the current record is positioned before the first record in the recordset.
      boolean isClosed()
      Determines whether the Recordset is closed or not.
      boolean isEOF()
      Indicates whether the current record is positioned after the last record in the recordset.
      boolean isReadOnly()
      Returns whether the Recordset is read only or not.
      boolean move(int count)
      Moves the current record position specified count backward or forward and makes that record current.
      boolean moveFirst()
      Moves the current record position to the first record in the Recordset and makes that record current.
      boolean moveLast()
      Moves the current record position to the last record in the Recordset and makes that record current.
      boolean moveNext()
      Moves the current record position to next record in the Recordset and makes that record current.
      boolean movePrev()
      Moves the current record position to previous record in the Recordset and makes that record current.
      boolean moveTo(int position)
      Moves the current position to the specified position and make that record current.
      boolean seekID(int id)
      Searches the record with specific ID and make the record current.
      boolean setBoolean(int index, boolean value)
      Sets the value for a field in a recordset.
      boolean setBoolean(java.lang.String name, boolean value)
      Sets the value for a field in a recordset.
      boolean setByte(int index, byte value)
      Sets the value of a field for the current record int he recordset.
      boolean setByte(java.lang.String name, byte value)
      Sets the value of a field for the current record int he recordset.
      boolean setDateTime(int index, java.util.Date value)
      Sets the value for a field in a recordset.
      boolean setDateTime(java.lang.String name, java.util.Date value)
      Sets the value for a field in a recordset.
      boolean setDouble(int index, double value)
      Sets the value for a field in a recordset.
      boolean setDouble(java.lang.String name, double value)
      Sets the value for a field in a recordset.
      boolean setFieldValue(int index, java.lang.Object value)
      Sets value for a field specified by the field index.
      boolean setFieldValue(java.lang.String name, java.lang.Object value)
      Sets value for a field specified by the field name.
      boolean setFieldValueNull(int index)
      Sets the values of a field in the Recordset to null according to the specified field index.
      boolean setFieldValueNull(java.lang.String name)
      Sets the values of a field in the Recordset to null according to the specified field name.
      boolean setGeometry(Geometry geometry)
      Modifies the current geometric object in the Recordset and overwrite the old one.
      boolean setInt16(int index, short value)
      Sets the value of a field as a "16 bit integer" for the current record in the recordset.
      boolean setInt16(java.lang.String name, short value)
      Sets the value of a field as a "16 bit integer" for the current record in the recordset.
      boolean setInt32(int index, int value)
      Sets the value for a field in a recordset.
      boolean setInt32(java.lang.String name, int value)
      Sets the value for a field in a recordset.
      boolean setInt64(int index, long value)
      Sets the value for a field in a recordset.
      boolean setInt64(java.lang.String name, long value)
      Sets the value for a field in a recordset.
      boolean setLongBinary(int index, byte[] value)
      Sets the value for a field in a recordset.
      boolean setLongBinary(java.lang.String name, byte[] value)
      Sets the value for a field in a recordset.
      boolean setSingle(int index, float value)
      Sets the value for a field in a recordset.
      boolean setSingle(java.lang.String name, float value)
      Sets the value for a field in a recordset.
      boolean setString(int index, java.lang.String value)
      Sets the value for a field in a recordset.
      boolean setString(java.lang.String name, java.lang.String value)
      Sets the value for a field in a recordset.
      double statistic(int fieldIndex, StatisticMode mode)
      Performs statistic computing for the field specified by the field name.
      double statistic(java.lang.String fieldName, StatisticMode mode)
      Performs statistic computing for the field specified by the field name.
      java.lang.String toGeoJSON(boolean hasAttributte, int count)
      Convert the specified number of records counting from the current record to GeoJSON string.
      boolean update()
      Modifies the committed Recordset which contains add, edit record, modify field value operations.
      • Methods inherited from class java.lang.Object

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

      • getBounds

        public Rectangle2D getBounds()
        Returns the boundary rectangle of the Recordset.
        Returns:
        The boundary rectangle of the Recordset.
      • getDataset

        public DatasetVector getDataset()
        Returns the corresponding dataset of the Recordset.
        Returns:
        The corresponding dataset of the Recordset.
      • getFieldInfos

        public FieldInfos getFieldInfos()
        Returns the FieldInfos object of the Recordset. For more information about field information, please refer to the FieldInfos class.
        Returns:
        A copy of FieldInfos.
      • getFieldCount

        public int getFieldCount()
        Returns the number of the Field in the Recordset.
        Returns:
        The number of the Field in the Recordset.
      • isClosed

        public boolean isClosed()
        Determines whether the Recordset is closed or not. true if the dataset is closed; false otherwise.
        Returns:
        Whether the Recordset is closed or not.
        Default:
        The default value is false, namely the dataset doesn't close.
      • edit

        public boolean edit()
        Locks and edits the current record in Recordset. It will return true when successful. After editing using this method, it is necessary to use update() to update Recordset, and the current record can not be moved before update(), otherwise this method would fail and Recordset might be damaged. .
        Returns:
        true if successful; otherwise, false.
      • isBOF

        public boolean isBOF()
        Indicates whether the current record is positioned before the first record in the recordset. If it is,returns true; otherwise returns false.
        Returns:
        Whether the current record is positioned before the first record.
        See Also:
        Recordset
        Example:
        Please see the sample of Recordset class.
      • isEOF

        public boolean isEOF()
        Indicates whether the current record is positioned after the last record in the recordset. If it is, returns true; otherwise returns false.
        Returns:
        Whether the current record is positioned after the last record.
      • isReadOnly

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

        public int getRecordCount()
        Returns the number of the records in the Recordset.
        Returns:
        The number of the records in the Recordset.
      • addNew

        public boolean addNew(Geometry geometry)
        Appends one record to Recordset.
      • The method for the recordset of the dataset in a read-only datasource is invalid.
      • This method will not be successfully called if the Recordset is locked for editing when adding a new record;Recordset.addNew()} method failed;
      • If the argument passed in is null, this method will be called successfully only when the recordset is from a tabular dataset.Recordset.addNew() If it is from other types of dataset, it will fail.
      • Parameters:
        geometry - The corresponded geometric object to be added which can be point, line, region and label etc. This parameter can be null.
        Returns:
        If successful returns true; otherwise returns false.
        See Also:
        Recordset
        Example:
        Please see the sample of Recordset class.
      • addNew

        public boolean addNew(Geometry geometry,java.util.Map<java.lang.String,java.lang.Object> values)
        Add Geometry object and set the field value.

        Call update method to submit the method and save the results after using this method.

        Parameters:
        geometry - The Geometry object to be added.
        values - The specified field value. The String object is the filed name, and the Object is the value. Note: If the specified field name is not found in the recordset or the value is not consist with the field type, the value will be ignored.
        Returns:
        A boolean. Return true if successful; otherwise, false.
        Example:
        Please see the sample of Recordset.BatchEditor class.
      • cancelUpdate

        public boolean cancelUpdate()
        Cancels all changes to current or new record before calling Update. It will return true when successful.
        Returns:
        If successful, this method will return true; otherwise it will return false.
      • update

        public boolean update()
        Modifies the committed Recordset which contains add, edit record, modify field value operations. Calls method to submit the method update() after modifying the recordset. It is needed to call update() to submit every time a record is modified.
        Returns:
        true if the update is successful, or false otherwise.
        See Also:
        Recordset
        Example:
        Please see the sample of Recordset class.
      • close

        public void close()
        It is used for closing a record set Close a record set immediately after using it
      • delete

        public boolean delete()
        Deletes the current recordset in dataset. It will return true when succeeds.

        This method is invalid for read-only recordset.

        Returns:
        Returns true if successful; otherwise false.
        See Also:
        Recordset
        Example:
        Please see the sample of Recordset class.
      • deleteAll

        public boolean deleteAll()
        Deletes all records in the specific Recordset. 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(int index)
        Returns the field value of the current record in attribute table according to the index of the field.
        Parameters:
        index - The field index whose value would be got.
        Returns:
        The specified field value of the current record.
        Example:
        Please see the sample of QueryParameter.
      • getFieldValue

        public java.lang.Object getFieldValue(java.lang.String name)
        Returns the field value of the current record in attribute table according to the name of the field.
        Parameters:
        name - The field name whose value would be got.
        Returns:
        The specified field value of the current record.
      • getGeometry

        public Geometry getGeometry()
        The geometric object of the current Recordset in attribute table.
        Returns:
        Returns the geometric object if successful; otherwise, null.
        See Also:
        Recordset
        Example:
        Please see the sample of Recordset class.
      • getID

        public int getID()
        Returns the ID (SmID) of geometric object corresponding to the current record in the attribute table.
        Returns:
        The ID of the Geometry object.
      • move

        public boolean move(int count)
        Moves the current record position specified count backward or forward and makes that record current. It will return true when successful. count If count is less than 0, it means forward movement; if count is greater than 0, it means backward movement; if count is equal to 0, it means no movement. If the count is not in the scope, the method will return false, Recordset and the current record position will not move..
        Parameters:
        count - The number of records.
        Returns:
        True, if successful; Otherwise false.
      • moveFirst

        public boolean moveFirst()
        Moves the current record position to the first record in the Recordset and makes that record current. It will return true when successful.
        Returns:
        Returns true if the move succeeds, false otherwise.
        See Also:
        Recordset
        Example:
        Please see the sample of Recordset class.
      • moveLast

        public boolean moveLast()
        Moves the current record position to the last record in the Recordset and makes that record current. It will return true when successful.
        Returns:
        Returns true if the move succeeds, false otherwise.
      • moveNext

        public boolean moveNext()
        Moves the current record position to next record in the Recordset and makes that record current. It will return true when successful. Return false if the current record is positioned after the last record in the recordset.
        Returns:
        Returns true if the move succeeds, false otherwise.
      • movePrev

        public boolean movePrev()
        Moves the current record position to previous record in the Recordset and makes that record current. It will return true when successful. Return false if the current record is positioned at the first record in the recordset.
        Returns:
        Returns true if the move succeeds, false otherwise.
      • moveTo

        public boolean moveTo(int position)
        Moves the current position to the specified position and make that record current. It will return true when successful.
        Parameters:
        position - The specified position, namely the ID of record to which the current record position moved. The position is from zero. The moveTo(0) and is equivalent. moveFirst().
        Returns:
        True, if successful; Otherwise false.
      • seekID

        public boolean seekID(int id)
        Searches the record with specific ID and make the record current.
        Parameters:
        id - The ID to be searched.
        Returns:
        If successful, this method will return true; otherwise it will return false.
      • setFieldValue

        public boolean setFieldValue(int index,java.lang.Object value)
        Sets value for a field specified by the field index. It will return true when successful. When you try to set a new value to a specified field in a record, you should lock it first by using the method edit(). In addition, you should use the method update() to commit your changes..
        Parameters:
        index - The index of the field to set values in the recordset.
        value - The new field value.
        Returns:
        True if successful; otherwise, false.
      • setFieldValue

        public boolean setFieldValue(java.lang.String name,java.lang.Object value)
        Sets value for a field specified by the field name. It will return true when successful. When you try to set a new value to a specified field in a record, you should lock it first by using the method edit(). .
        Parameters:
        name - The field name at which the field value would be assigned.
        value - The new field value.
        Returns:
        True if successful; otherwise, false.
      • setFieldValueNull

        public boolean setFieldValueNull(int index)
        Sets the values of a field in the Recordset to null according to the specified field index. Returns true if successful.
        Parameters:
        index - The field index to be set.
        Returns:
        True if successful; otherwise, false.
      • setFieldValueNull

        public boolean setFieldValueNull(java.lang.String name)
        Sets the values of a field in the Recordset to null according to the specified field name. Returns true if successful.
        Parameters:
        name - The field name at which the field value would be assigned.
        Returns:
        True if successful; otherwise, false.
      • setGeometry

        public boolean setGeometry(Geometry geometry)

        Modifies the current geometric object in the Recordset and overwrite the old one. It will return true when succeeds.

        Call edit() before the modification. When modifying the geometric object, its system field values should be modified automatically, such as, the area of polygon and the length of line etc.

        Parameters:
        geometry - A new geometric object used to overlap the old one.
        Returns:
        True if successful; otherwise, false.
        Throws:
        java.lang.NullPointerException - If the passed parameter is null, an NullPointerException will be thrown.
        java.lang.IllegalArgumentException - When the tabular dataset calls this interface and the parameter passed in isn't null, an IllegalArgumentException will be thrown. ,
      • getQueryParameter

        public QueryParameter getQueryParameter()
        Gets the query parameters of the current Recordset, and returns a copy. For more information about query parameters, please refer to QueryParameter Type.
        Returns:
        the recordset contains the query results.
        See Also:
        QueryParameter
      • getByte

        public byte getByte(int index)
        The value of the "byte" field in the current record from the attribute table of the dataset.

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

        Parameters:
        index - The specified index of field that is waiting for return.
        Returns:
        The value of the "byte" field in the current record from the attribute table of the dataset.
      • getByte

        public byte getByte(java.lang.String name)
        The value of the "byte" field in the current record from the attribute table of the dataset.

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

        Parameters:
        name - The specified name of field that is waiting for return.
        Returns:
        The value of the "byte" field in the current record from the attribute table of the dataset.
      • setByte

        public boolean setByte(int index,byte value)
        Sets the value of a field for the current record int he recordset. 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:
        index - The specified index of field.
        value - The byte value to be set.
        Returns:
        A boolean. Return true if successful; otherwise, false.
      • setByte

        public boolean setByte(java.lang.String name,byte value)
        Sets the value of a field for the current record int he recordset. 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:
        name - The specified name of field.
        value - The byte value to be set.
        Returns:
        A boolean. Return true if successful; otherwise, false.
      • getInt16

        public short getInt16(int index)
        The value of the "16 bit integer" field in the current record from the attribute table of the dataset.

        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:
        index - The specified index of field that is waiting for return.
        Returns:
        The value of the "16 bit integer" field in the current record from the attribute table of the dataset.
      • getInt16

        public short getInt16(java.lang.String name)
        The value of the "16 bit integer" field in the current record from the attribute table of the dataset.

        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:
        name - The specified name of field that is waiting for return.
        Returns:
        The value of the "16 bit integer" field in the current record from the attribute table of the dataset.
      • setInt16

        public boolean setInt16(int index,short value)
        Sets the value of a field as a "16 bit integer" for the current record in the recordset. 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:
        index - The specified index of field.
        value - The short value to be set.
        Returns:
        True if successful; otherwise, false.
      • setInt16

        public boolean setInt16(java.lang.String name,short value)
        Sets the value of a field as a "16 bit integer" for the current record in the recordset. 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:
        name - The specified name of field.
        value - The short value to be set.
        Returns:
        True if successful; otherwise, false.
      • getInt32

        public int getInt32(int index)
        The value of the "32 bit integer" field in the current record from the attribute table of the dataset.

        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:
        index - The specified index of field that is waiting for return.
        Returns:
        The value of the "32 bit integer" field in the current record from the attribute table of the dataset.
      • getInt32

        public int getInt32(java.lang.String name)
        The value of the "32 bit integer" field in the current record from the attribute table of the dataset.

        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:
        name - The specified name of field that is waiting for return.
        Returns:
        The value of the "32 bit integer" field in the current record from the attribute table of the dataset.
      • setInt32

        public boolean setInt32(int index,int value)
        Sets the value for a field in a recordset. 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:
        index - The specified index of field that is waiting for return.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setInt32

        public boolean setInt32(java.lang.String name,int value)
        Sets the value for a field in a recordset. 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:
        name - The specified name of field that is waiting for return.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • getInt64

        public long getInt64(int index)
        The value of the "64 bit integer" field in the current record from the attribute table of the dataset.

        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:
        index - The specified index of field that is waiting for return.
        Returns:
        The value of the "64 bit integer" field in the current record from the attribute table of the dataset.
      • getInt64

        public long getInt64(java.lang.String name)
        The value of the "64 bit integer" field in the current record from the attribute table of the dataset.

        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:
        name - The specified name of field that is waiting for return.
        Returns:
        The value of the "64 bit integer" field in the current record from the attribute table of the dataset.
      • setInt64

        public boolean setInt64(int index,long value)
        Sets the value for a field in a recordset. 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:
        index - The specified index of field that is waiting for return.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setInt64

        public boolean setInt64(java.lang.String name,long value)
        Sets the value for a field in a recordset. 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:
        name - The specified name of field that is waiting for return.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • getSingle

        public float getSingle(int index)
        The value of the "single-precision" field in the current record from the attribute table of the dataset.

        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:
        index - The index of the specified field.
        Returns:
        The value of the "single-precision" field in the current record from the attribute table of the dataset.
      • getSingle

        public float getSingle(java.lang.String name)
        The value of the "single-precision" field in the current record from the attribute table of the dataset.

        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:
        name - The field name whose value would be got.
        Returns:
        The value of the "single-precision" field in the current record from the attribute table of the dataset.
      • setSingle

        public boolean setSingle(int index,float value)
        Sets the value for a field in a recordset. 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:
        index - The index of the specified field.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setSingle

        public boolean setSingle(java.lang.String name,float value)
        Sets the value for a field in a recordset. 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:
        name - The field name whose value would be got.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • getDouble

        public double getDouble(int index)
        The value of the "double-precision" field in the current record from the attribute table of the dataset.

        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:
        index - The index of the specified field.
        Returns:
        The value of the "double-precision" field in the current record from the attribute table of the dataset.
      • getDouble

        public double getDouble(java.lang.String name)
        The value of the "double-precision" field in the current record from the attribute table of the dataset.

        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:
        name - The field name whose value would be got.
        Returns:
        The value of the "double-precision" field in the current record from the attribute table of the dataset.
      • setDouble

        public boolean setDouble(int index,double value)
        Sets the value for a field in a recordset. 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:
        index - The index of the specified field.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setDouble

        public boolean setDouble(java.lang.String name, double value)
        Sets the value for a field in a recordset. 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:
        name - The field name whose value would be got.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • getLongBinary

        public byte[] getLongBinary(int index)
        The value of the "binary" field in the current record from the attribute table of the dataset.

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

        Parameters:
        index - The index of the specified field.
        Returns:
        The value of the "binary" field in the current record from the attribute table of the dataset.
      • getLongBinary

        public byte[] getLongBinary(java.lang.String name)
        The value of the "binary" field in the current record from the attribute table of the dataset.

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

        Parameters:
        name - The field name whose value would be got.
        Returns:
        The value of the "binary" field in the current record from the attribute table of the dataset.
      • setLongBinary

        public boolean setLongBinary(int index,byte[] value)
        Sets the value for a field in a recordset. Returns true if set successfully.

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

        Parameters:
        index - The index of the specified field.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setLongBinary

        public boolean setLongBinary(java.lang.String name,byte[] value)
        Sets the value for a field in a recordset. Returns true if set successfully.

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

        It is only valid for binary type, if the field is not this type, then return false.

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

        public boolean getBoolean(int index)
        The value of the "Boolean" field in the current record from the attribute table of the dataset.

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

        Parameters:
        index - The index of the specified field.
        Returns:
        The value of the "boolean" field in the current record from the attribute table of the dataset.
      • getBoolean

        public boolean getBoolean(java.lang.String name)
        The value of the "Boolean" field in the current record from the attribute table of the dataset.

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

        Parameters:
        name - The field name whose value would be got.
        Returns:
        The value of the "boolean" field in the current record from the attribute table of the dataset.
      • setBoolean

        public boolean setBoolean(int index,boolean value)
        Sets the value for a field in a recordset. 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:
        index - The index of the specified field.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setBoolean

        public boolean setBoolean(java.lang.String name, boolean value)
        Sets the value for a field in a recordset. 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:
        name - The field name whose value would be got.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • getString

        public java.lang.String getString(int index)
        The value of the "text" field in the current record from the attribute table of the dataset.

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

        Parameters:
        index - The index of the specified field.
        Returns:
        The value of the "text" field in the current record from the attribute table of the dataset.
      • getString

        public java.lang.String getString(java.lang.String name)
        The value of the "text" field in the current record from the attribute table of the dataset.

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

        Parameters:
        name - The field name whose value would be got.
        Returns:
        The value of the "text" field in the current record from the attribute table of the dataset.
      • setString

        public boolean setString(int index,java.lang.String value)
        Sets the value for a field in a recordset. 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:
        index - The index of the specified field.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setString

        public boolean setString(java.lang.String name,java.lang.String value)
        Sets the value for a field in a recordset. 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:
        name - The field name whose value would be got.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • getDateTime

        public java.util.Date getDateTime(int index)
        The value of the "date" field in the current record from the attribute table of the dataset.

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

        Parameters:
        index - The index of the specified field.
        Returns:
        The value of the "date" field in the current record from the attribute table of the dataset.
      • getDateTime

        public java.util.Date getDateTime(java.lang.String name)
        The value of the "date" field in the current record from the attribute table of the dataset.

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

        Parameters:
        name - The field name whose value would be got.
        Returns:
        The value of the "date" field in the current record from the attribute table of the dataset.
      • setDateTime

        public boolean setDateTime(int index,java.util.Date value)
        Sets the value for a field in a recordset. Returns true if set successfully.

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

        Parameters:
        index - The index of the specified field.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • setDateTime

        public boolean setDateTime(java.lang.String name,java.util.Date value)
        Sets the value for a field in a recordset. 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:
        name - The field name whose value would be got.
        value - The value to be set.
        Returns:
        True if successful; otherwise, false.
      • dispose

        public void dispose()
        Releases all resources that the object occupies. After calling this method, this object will not be useful.
      • statistic

        public double statistic(int fieldIndex,StatisticMode mode)
        Performs statistic computing for the field specified by the field name. For example, Max, Min, Average, Summary, Standard Deviation and Square Deviation etc.
        Parameters:
        fieldIndex - The field index
        mode - The statistics mode
        Returns:
        Statistical values
      • statistic

        public double statistic(java.lang.String fieldName,StatisticMode mode)
        Performs statistic computing for the field specified by the field name. For example, Max, Min, Average, Summary, Standard Deviation and Square Deviation etc.
        Parameters:
        fieldName - Field Name
        mode - The statistics mode
        Returns:
        Statistical values
      • getBatch

        public Recordset.BatchEditor getBatch()
        Returns the objects for batch modification.

        EngineType The writable file engine and the database type datasource in EngineType both support the batch modification.

        Returns:
        The objects for batch modification.
      • fromGeoJSON

        public boolean fromGeoJSON(java.lang.String geoJSON)
        Gets the geometry and its attributes from the GeoJSON string, and update it to the dataset

        The supported geometry type includes: point, line, region, multi line

        Parameters:
        geoJSON - GeoJSON string, which can contain a geometry or a set of multiple objects
        Returns:
        Gets all geometries and updates successfully, it will return true; otherwise, it will return false
      • toGeoJSON

        public java.lang.String toGeoJSON(boolean hasAttributte,int count)
        Convert the specified number of records counting from the current record to GeoJSON string.

        The supported geometry type includes: point, line, region, multi line. The method supports getting the GeoJSON string which contains at most 10 records. When hasAttributte is true, it will return a string in Feature type; when hasAttributte is false, it will return a string in Geometry type which only contains geometries.

        Parameters:
        hasAttributte - has Attributte Whether to contain attributes
        count - Number of records to be obtained
        Returns:
        Returns the obtained GeoJSON string. It will return null if no result