类 Datastore

java.lang.Object
com.sh.javax.datastore.Datastore
所有已实现的接口:
DatastoreInterface, Serializable, Cloneable
直接已知子类:
FileDatastore, JSONDatastore

public class Datastore extends Object implements DatastoreInterface, Serializable, Cloneable
Datastore类实现了DatastoreInterface接口以及Serializable接口,该类的主要功能是接收 JDBC从数据库中获取的记录集,从而可以摆脱JDBC对于数据库的访问依赖于游标的情况。 同时,该类提供了对记录集添加、修改、删除、排序、查找等多种方便灵活的数据操作方式, 是开发数据库用的基础。 具体的方法调用说明参见DatastoreInterface。

构造方法:

一:通过DataCenter查询数据库中数据返回值;

二:自定义构造,如下形式:

Datastore ds = new Datastore(); ds.insertColumn(-1, "user_id", Datastore.STRING, "用户编号"); ds.insertColumn(-1, "user_name", Datastore.STRING, "用户姓名"); int rowNo = ds.insertRow(-1); ds.setItem(rowNo, "user_id", "admin"); ds.setItem(rowNo, "user_name", "系统管理员");

另请参阅:
  • 字段详细资料

    • prows

      protected int prows
    • frows

      protected int frows
    • drows

      protected int drows
    • cols

      protected int cols
    • datalist

      protected LinkedList<RowInfo> datalist
    • filter

      protected String filter
    • sort

      protected String sort
    • lastGetCol

      protected String lastGetCol
    • sql

      protected String sql
    • queryColsType

      protected String[] queryColsType
    • queryObj

      protected Object[] queryObj
    • queryTime

      protected long queryTime
    • isCacheData

      protected boolean isCacheData
    • columnIndexMap

      protected Map<String,Integer> columnIndexMap
    • log4j

      protected static final org.apache.logging.log4j.Logger log4j
    • gloableDataMap

      protected Map<String,Object> gloableDataMap
    • forEachBreak

      protected boolean forEachBreak
  • 构造器详细资料

    • Datastore

      public Datastore()
      构造函数
    • Datastore

      public Datastore(LinkedList<HeaderInfo> headerList)
      构造函数
  • 方法详细资料

    • addGloableData

      public void addGloableData(String key, Object value)
    • getGloableData

      public Object getGloableData(String key)
    • getGloableData

      public Object getGloableData(String key, Object defaultValue)
    • isContainGlobleData

      public boolean isContainGlobleData(String key)
    • removeGloableData

      public void removeGloableData(String key)
    • insertColumn

      public int insertColumn(int colNo, String colName, int colType, String label)
      在数据集中插入一个列,默认列值为null
      参数:
      colNo - 要插入的列号,插入成功后原来的colNo将被加1;如果colNo等于-1表示在尾部加一个列
      colName - 列名
      colType - 列的类型
      label - 列的标签
      返回:
      插入的列的列号
    • insertColumn

      public int insertColumn(int colNo, String colName, int colType, String label, Object defaultValue)
    • insertColumn

      public int insertColumn(int colNo, String colName, int colType, String label, Object defaultValue, String colName2)
      在数据集中插入一个列
      参数:
      colNo - 要插入的列号,插入成功后原来的colNo将被加1;如果colNo等于-1表示在尾部加一个列
      colName - 列名
      colType - 列的类型
      label - 列的标签
      defaultValue - 默认列值
      colName2 - 列名2
      返回:
      插入的列的列号,从1开始
    • changeColumnName

      public boolean changeColumnName(String colName, String newColName)
      修改列名
      参数:
      colName - 当前列名
      newColName - 新的列名
      返回:
      列不存在时,返回false
    • deleteColumn

      public void deleteColumn(int colNo)
      从数据集中删除一列数据
      参数:
      colNo - 列号
    • clearAll

      protected void clearAll()
      清空重置当前数据集
    • getHeader

      public LinkedList<HeaderInfo> getHeader()
      获取表头
      返回:
      LinkedList
    • setHeader

      public void setHeader(LinkedList<HeaderInfo> header)
      设置表头
      参数:
      header - LinkedList
    • getData

      public LinkedList<RowInfo> getData()
      获取主数据
      返回:
      LinkedList
    • addRowData

      public Datastore addRowData(RowInfo rowInfo)
    • addRowData

      public Datastore addRowData(RowInfo rowInfo, int rowNo)
      添加行数据
      参数:
      rowInfo -
      rowNo - 从1开始
      返回:
    • setData

      public void setData(LinkedList<RowInfo> data)
      设置数据
      参数:
      data - LinkedList
    • setFilter

      public boolean setFilter(String filter)
      设置数据集的过滤条件
      指定者:
      setFilter 在接口中 DatastoreInterface
      参数:
      filter - 过滤条件,条件的字符串的写法类似于SQL中where子句
      返回:
      设置是否成功
    • filter

      public int filter()
      根据设置的条件进行过滤
      指定者:
      filter 在接口中 DatastoreInterface
      返回:
      符合条件的记录条数
      抛出:
      FilterException - FilterException
    • filter

      public int filter(Predicate<? super RowInfo> action)
      过虑数据,实时生效
      参数:
      action -
      返回:
    • clearFilter

      public void clearFilter()
      恢复过滤条件状态
    • filteredCount

      public int filteredCount()
      取得过滤缓冲中记录的条数
      指定者:
      filteredCount 在接口中 DatastoreInterface
      返回:
      过滤缓冲中记录的条数
    • deletedCount

      public int deletedCount()
    • setSort

      public boolean setSort(String sort)
      数据集排序
      指定者:
      setSort 在接口中 DatastoreInterface
      参数:
      sort - 排序方式
      返回:
      boolean
    • sort

      public boolean sort()
      执行排序操作
      指定者:
      sort 在接口中 DatastoreInterface
      返回:
      true|false
    • sort

      public boolean sort(Comparator<RowInfo> comparator)
      数据集排序
      参数:
      comparator -
      返回:
    • find

      public int find(String expression)
    • find

      public int find(String expression, int start, int end)
      查找
      指定者:
      find 在接口中 DatastoreInterface
      参数:
      expression - 查询表达式
      start - 开始行号
      end - 结束行号
      返回:
      符合条件的第一条记录的行号
    • rowCount

      public int rowCount()
      从接口复制的说明: DatastoreInterface
      行统计,返回PRIMARY缓冲区内数据总行数。
      指定者:
      rowCount 在接口中 DatastoreInterface
      返回:
      行数
    • isEmpty

      public boolean isEmpty()
      判断是否为空
      返回:
      boolean
    • columnCount

      public int columnCount()
      从接口复制的说明: DatastoreInterface
      返回PRIMARY缓冲区内数据总列数。
      指定者:
      columnCount 在接口中 DatastoreInterface
      返回:
      列数
    • getColumnName

      public String getColumnName(int index)
      按索引取列名
      指定者:
      getColumnName 在接口中 DatastoreInterface
      参数:
      index - 列号,从1开始
      返回:
      列名
    • getColumnName2

      public String getColumnName2(int index)
      按索引取列名
      参数:
      index - 列号,从1开始
      返回:
      String
    • getLabel

      public String getLabel(int index)
      指定者:
      getLabel 在接口中 DatastoreInterface
    • getLabel

      public String getLabel(String column)
      指定者:
      getLabel 在接口中 DatastoreInterface
    • setPkCol

      public void setPkCol(String... cols)
      设置主键
      参数:
      cols - 主键列,不区分大小写
    • isPrimaryKey

      public boolean isPrimaryKey(int index)
      指定者:
      isPrimaryKey 在接口中 DatastoreInterface
    • isPrimaryKey

      public boolean isPrimaryKey(String column)
      指定者:
      isPrimaryKey 在接口中 DatastoreInterface
    • getColumnType

      public int getColumnType(int index)
      从接口复制的说明: DatastoreInterface
      取得列的数据类型,返回PRIMARY缓冲区指定索引(列名)的数据类型。
      指定者:
      getColumnType 在接口中 DatastoreInterface
      参数:
      index - 列号
      返回:
      列类型
    • getColumnType

      public int getColumnType(String column)
      按列名取列数据类型
      指定者:
      getColumnType 在接口中 DatastoreInterface
    • setItemStatus

      public boolean setItemStatus(int row, int column, int dwbuffer, int status)
      从接口复制的说明: DatastoreInterface
      设置指定缓冲区指定行列的状态。 Row :行号 Column:可使用列名或列号。Column为0时指定为整行。 Dwbuffer :三个缓冲区之一。 Status:状态类型,指定要设置为那个新状态。 成功返回true,失败返回false
      指定者:
      setItemStatus 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列号
      dwbuffer - int
      status - 状态
      返回:
      boolean
    • setItemStatus

      public boolean setItemStatus(int row, String column, int dwbuffer, int status)
      指定者:
      setItemStatus 在接口中 DatastoreInterface
    • setItemStatus

      public boolean setItemStatus(int row, int column, int status)
      从接口复制的说明: DatastoreInterface
      设置PRIMARY缓冲区指定行列的状态。 Row :行号 Column:可使用列名或列号。Column为0时指定为整行。 Status:状态类型,指定要设置为那个新状态。 成功返回true,失败返回false
      指定者:
      setItemStatus 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列号
      status - 状态
      返回:
      boolean
    • setItemStatus

      public boolean setItemStatus(int row, String column, int status)
      指定者:
      setItemStatus 在接口中 DatastoreInterface
    • getItemStatus

      public int getItemStatus(int row, int column, int dwbuffer)
      从接口复制的说明: DatastoreInterface
      取得指定缓冲区指定行列的状态。 Row :行号 Column:可使用列名或列号。Column为0时指定为整行。 Dwbuffer :三个缓冲区之一。 成功返回状态类型,失败返回-1。
      指定者:
      getItemStatus 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列号
      dwbuffer - int
      返回:
      int
    • getItemStatus

      public int getItemStatus(int row, String column, int dwbuffer)
      指定者:
      getItemStatus 在接口中 DatastoreInterface
    • getItemStatus

      public int getItemStatus(int row, int column)
      从接口复制的说明: DatastoreInterface
      取得PRIMARY缓冲区指定行列的状态。 Row :行号 Column:可使用列名或列号。Column为0时指定为整行。 成功返回状态类型,失败返回-1。
      指定者:
      getItemStatus 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列号
      返回:
      状态
    • getItemStatus

      public int getItemStatus(int row, String column) throws InvalidRowColException
      指定者:
      getItemStatus 在接口中 DatastoreInterface
      抛出:
      InvalidRowColException
    • reset

      public boolean reset()
      重置数据集
      指定者:
      reset 在接口中 DatastoreInterface
      返回:
      成功返回true,失败返回false
    • insertRow

      public int insertRow(int row)
      在数据集中插入一行,如果为-1表示在数据集的末尾加一行
      指定者:
      insertRow 在接口中 DatastoreInterface
      参数:
      row - 插入行号 -1 表示在末尾插入
      返回:
      返回插入后的行号
    • deleteRow

      public boolean deleteRow(int row)
      删除一行
      指定者:
      deleteRow 在接口中 DatastoreInterface
      参数:
      row - 待删除的行号 从1开始
      返回:
      true|false
    • filterRow

      protected boolean filterRow(RowInfo rowInfo)
    • restoreFilterData

      public int restoreFilterData()
      还原过滤的数据
      返回:
    • rowsMove

      public boolean rowsMove(int startrow, int endrow, int movebuffer, int beforerow, int targetbuffer)
      从接口复制的说明: DatastoreInterface
      在三个缓冲区内移动一行或多行数据。 startrow:开始行号 endrow:结束行号 movebuffer:源缓冲区。 beforerow:移动到目标缓冲区内的开始行号。 targetbuffer:目标缓冲区。
      指定者:
      rowsMove 在接口中 DatastoreInterface
      参数:
      startrow - 开始行
      endrow - 结束行
      movebuffer - 移动缓冲
      beforerow - int
      targetbuffer - int
      返回:
      成功返回true,失败返回false。
    • rowsCopy

      public boolean rowsCopy(int startrow, int endrow, Datastore targetdw)
    • rowsCopy

      public boolean rowsCopy(int startrow, int endrow, int movebuffer, Datastore targetdw, int beforerow, int targetbuffer)
    • getObject

      public Object getObject(int row, int column)
      获取数据集中单元格的数据
      指定者:
      getObject 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列号
      返回:
      Object
    • getObject

      public Object getObject(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getObject 在接口中 DatastoreInterface
    • getObject

      public Object getObject(int row, String column)
      获取数据集中单元格的数据
      指定者:
      getObject 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列名
    • getObject

      public Object getObject(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getObject 在接口中 DatastoreInterface
    • getItemDate

      public Date getItemDate(int row, int column)
      获取数据集中单元格的Date数据
      指定者:
      getItemDate 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列号
    • getItemDate

      public Date getItemDate(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getItemDate 在接口中 DatastoreInterface
    • getItemDate

      public Date getItemDate(int row, String column)
      获取数据集中单元格的Date数据
      指定者:
      getItemDate 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列名
    • getItemDate

      public Date getItemDate(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getItemDate 在接口中 DatastoreInterface
    • getItemTime

      public Time getItemTime(int row, int column)
      获取数据集中单元格的Time数据
      指定者:
      getItemTime 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列号
    • getItemTime

      public Time getItemTime(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getItemTime 在接口中 DatastoreInterface
    • getItemTime

      public Time getItemTime(int row, String column)
      获取数据集中单元格的Time数据
      指定者:
      getItemTime 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列名
    • getItemTime

      public Time getItemTime(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getItemTime 在接口中 DatastoreInterface
    • getItemTimestamp

      public Timestamp getItemTimestamp(int row, int column)
      获取数据集中单元格的Timestamp数据
      指定者:
      getItemTimestamp 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列号
    • getItemTimestamp

      public Timestamp getItemTimestamp(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getItemTimestamp 在接口中 DatastoreInterface
    • getItemTimestamp

      public String getItemTimestamp(int row, int column, String format)
      获取时间类型数据
      参数:
      row - 行
      column - 列
      format - 格式化表达式
      返回:
      String
    • getItemTimestamp

      public String getItemTimestamp(int row, int column, String format, String toZone)
    • getItemTimestamp

      public String getItemTimestamp(int row, String column, String format)
      获取时间类型数据
      参数:
      row - 行
      column - 列
      format - 格式化表达式
      返回:
      String
    • getItemTimestamp

      public String getItemTimestamp(int row, String column, String format, String toZone)
    • getItemTimestamp

      public Timestamp getItemTimestamp(int row, String column)
      获取数据集中单元格的Timestamp数据
      指定者:
      getItemTimestamp 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列名
    • getItemTimestamp

      public Timestamp getItemTimestamp(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getItemTimestamp 在接口中 DatastoreInterface
    • getItemInteger2

      public int getItemInteger2(int row, int column)
      获取数据集中单元格的int数据
      参数:
      row - 行号 从1开始
      column - 列号
      返回:
      int类型的数据
    • getItemInteger2String

      public String getItemInteger2String(int row, String column)
      获取整形值,并将其转化为String类型
      参数:
      row - 行号
      column - 列号
      返回:
      String
    • getItemInteger2

      public int getItemInteger2(int row, String column)
      获取数据集中单元格的int数据
      参数:
      row - 行号 从1开始
      column - 列名
      返回:
      int类型的数据
    • getItemInteger

      public Integer getItemInteger(int row, int column)
      获取数据集中单元格的Integer数据
      指定者:
      getItemInteger 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Integer类型的数据
    • getItemInteger

      public Integer getItemInteger(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getItemInteger 在接口中 DatastoreInterface
    • getItemInteger

      public Integer getItemInteger(int row, String column)
      获取数据集中单元格的Integer数据
      指定者:
      getItemInteger 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Integer类型的数据
    • getItemInteger

      public Integer getItemInteger(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getItemInteger 在接口中 DatastoreInterface
    • getItemLong2

      public long getItemLong2(int row, int column)
      获取数据集中单元格的Long数据
      参数:
      row - 行号 从1开始
      column - 列号
      返回:
      long类型的数据
    • getItemLong2String

      public String getItemLong2String(int row, String column)
      获取整形值,并将其转化为String类型
      参数:
      row - 行号
      column - 列名
      返回:
      String
    • getItemLong2

      public long getItemLong2(int row, String column)
      获取数据集中单元格的long数据
      参数:
      row - 行号 从1开始
      column - 列名
      返回:
      int类型的数据
    • getItemLong

      public Long getItemLong(int row, int column)
      获取数据集中单元格的Long数据
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Long类型的数据
    • getItemLong

      public Long getItemLong(int row, int column, int buffer, boolean originalvalue)
    • getItemLong

      public Long getItemLong(int row, String column)
      获取数据集中单元格的Long数据
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Long类型的数据
    • getItemLong

      public Long getItemLong(int row, String column, int buffer, boolean originalvalue)
    • getItemFloat2String

      public String getItemFloat2String(int row, int column, String format)
      获取数据集中单元格的Float数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      format - 格式化表达式
      返回:
      String类型的数据
    • getItemFloat2String

      public String getItemFloat2String(int row, String column, String format)
      获取数据集中单元格的Float数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      format - 格式化表达式
      返回:
      String类型的数据
    • getItemFloat2String

      public String getItemFloat2String(int row, int column)
      获取数据集中单元格的Float数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemFloat2String

      public String getItemFloat2String(int row, String column)
      获取数据集中单元格的Float数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemFloat2Int

      public int getItemFloat2Int(int row, int column)
      获取数据集中单元格的Float数据,并转化为int
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      int类型的数据
    • getItemFloat2Int

      public int getItemFloat2Int(int row, String column)
      获取数据集中单元格的Float数据,并转化为int
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      int类型的数据
    • getItemFloat2

      public float getItemFloat2(int row, String column)
      获取数据集中单元格的Float数据,并转化为float
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      float类型的数据
    • getItemFloat2

      public float getItemFloat2(int row, int column)
      获取数据集中单元格的Float数据,并转化为float
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      float类型的数据
    • getItemFloat

      public Float getItemFloat(int row, int column)
      获取数据集中单元格的Float数据
      指定者:
      getItemFloat 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Float类型的数据
    • getItemFloat

      public Float getItemFloat(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getItemFloat 在接口中 DatastoreInterface
    • getItemFloat

      public Float getItemFloat(int row, String column)
      获取数据集中单元格的Float数据
      指定者:
      getItemFloat 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Float类型的数据
    • getItemFloat

      public Float getItemFloat(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getItemFloat 在接口中 DatastoreInterface
    • getItemDouble2String

      public String getItemDouble2String(int row, String column, String format)
      获取数据集中单元格的Double数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      format - 格式化表达式
      返回:
      String类型的数据
    • getItemDouble2String

      public String getItemDouble2String(int row, int column, String format)
      获取数据集中单元格的Double数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      format - 格式化表达式
      返回:
      String类型的数据
    • getItemDouble2String

      public String getItemDouble2String(int row, String column)
      获取数据集中单元格的Double数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemDouble2String

      public String getItemDouble2String(int row, int column)
      获取数据集中单元格的Double数据,并转化为String
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemDouble2Long

      public long getItemDouble2Long(int row, int column)
      获取数据集中单元格的Double数据,并转化为long
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      long类型的数据
    • getItemDouble2Long

      public long getItemDouble2Long(int row, String column)
      获取数据集中单元格的Double数据,并转化为long
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      long类型的数据
    • getItemDouble2Int

      public int getItemDouble2Int(int row, int column)
      获取数据集中单元格的Double数据,并转化为int
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      int类型的数据
    • getItemDouble2Int

      public int getItemDouble2Int(int row, String column)
      获取数据集中单元格的Double数据,并转化为int
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      int类型的数据
    • getItemDouble2

      public double getItemDouble2(int row, int column)
      功能同getItemDouble,只是返回基本数据类型
      参数:
      row - 行号
      column - 列号
      返回:
      double类型的数据
    • getItemDoubleEx

      public Double getItemDoubleEx(int row, int column)
      获取数据集中单元格的Double数据
      指定者:
      getItemDoubleEx 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Double类型的数据
    • getItemDouble

      public Double getItemDouble(int row, int column)
      获取数据集中单元格的Double数据,如果为空,返回默认值
      指定者:
      getItemDouble 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Double类型的数据
    • getItemDouble

      public Double getItemDouble(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getItemDouble 在接口中 DatastoreInterface
    • getItemDouble2

      public double getItemDouble2(int row, String column)
      功能同getItemDouble,只是返回基本数据类型
      参数:
      row - 行号
      column - 列
      返回:
      double
    • getItemDouble

      public Double getItemDouble(int row, String column)
      功能同getItemDouble,只是返回基本数据类型
      指定者:
      getItemDouble 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      返回:
      Double
    • getItemDoubleEx

      public Double getItemDoubleEx(int row, String column)
      获取数据集中单元格的Double数据
      指定者:
      getItemDoubleEx 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      Double类型的数据
    • getItemDouble

      public Double getItemDouble(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getItemDouble 在接口中 DatastoreInterface
    • getItemBigDecimal

      public BigDecimal getItemBigDecimal(int row, String column)
    • getItemBigDecimal

      public BigDecimal getItemBigDecimal(int row, int colindex)
    • getItemString2

      public String getItemString2(int row, int column)
      获取数据集中单元格的String数据,如果为空,返回默认值
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemString2

      public String getItemString2(int row, String column)
      获取数据集中单元格的String数据,如果为空,返回默认值
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemString

      public String getItemString(int row, int column)
      获取数据集中单元格的String数据
      指定者:
      getItemString 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemString

      public String getItemString(int row, int column, int buffer, boolean originalvalue)
      指定者:
      getItemString 在接口中 DatastoreInterface
    • getItemString

      public String getItemString(int row, String column)
      获取数据集中单元格的String数据
      指定者:
      getItemString 在接口中 DatastoreInterface
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      String类型的数据
    • getItemString

      public String getItemString(int row, String column, int buffer, boolean originalvalue)
      指定者:
      getItemString 在接口中 DatastoreInterface
    • getBlobInputStream

      public InputStream getBlobInputStream(int row, int column)
      获取数据集中单元格的Blob数据
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      InputStream类型的数据
    • getBlobInputStream

      public InputStream getBlobInputStream(int row, String column)
      获取数据集中单元格的Blob数据
      参数:
      row - 行号 从1开始
      column - 列
      返回:
      InputStream类型的数据
    • getClobReader

      public Reader getClobReader(int row, int column)
      获取CLOB字段的字符流
      参数:
      row - 行号
      column - 列
      返回:
      Reader对象,没有时返回null
    • getClobReader

      public Reader getClobReader(int row, String column)
      获取CLOB字段的字符流
      参数:
      row - 行号
      column - 列
      返回:
      没有时返回null
    • getClobInputStream

      public InputStream getClobInputStream(int row, int column)
      获取CLOB字段的输入流
      参数:
      row - 行号
      column - 列
      返回:
      没有时返回null
    • getClobInputStream

      public InputStream getClobInputStream(int row, String column)
      获取CLOB字段的输入流
      参数:
      row - 行号
      column - 列
      返回:
      没有值时返回null
    • getClobString

      public String getClobString(int row, int column)
    • getClobString2

      public String getClobString2(int row, int column)
    • getClobString

      public String getClobString(int row, int column, String enter)
      获取CLOB字段的字符串值,适用于小字符串
      参数:
      row - 行号
      column - 列
      enter - 换行符
      返回:
      返回字符串
    • getClobString

      public String getClobString(int row, String column)
    • getClobString2

      public String getClobString2(int row, String column)
    • getClobString

      public String getClobString(int row, String column, String enter)
      获取CLOB字段的字符串值,适用于小字符串
      参数:
      row - 行号
      column - 列
      enter - 换行符
      返回:
      String
    • getItemObjectString

      public String getItemObjectString(int row, String column)
      获取字符串对象
      参数:
      row - 行号
      column - 列名
      返回:
      String
    • getItemObjectString

      public String getItemObjectString(int row, String column, String toZoneId)
    • getItemObjectString

      public String getItemObjectString(int row, int column)
      获取字符串数据对象
      参数:
      row - 行号
      column - 列号
      返回:
      String
    • getItemObjectString

      public String getItemObjectString(int row, int column, String toZoneId)
    • getItemObjectString2

      public String getItemObjectString2(int row, String column)
    • getItemObjectString2

      public String getItemObjectString2(int row, int column)
    • setColumnData

      public void setColumnData(String colName, DsSetColumnData_I func)
      设置更新一列的数据
      参数:
      colName - 列名
      func - 回调函数,返回值为设置值
    • setColumnData

      public void setColumnData(int colindex, DsSetColumnData_I func)
      设置更新一列的数据
      参数:
      colindex - 列索引号 从1开始
      func - 回调函数,返回值为设置值
    • setItem

      public int setItem(int row, int column, Date value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - 时间类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, int column, Time value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - 时间类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, int column, Timestamp value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - 时间类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, int column, Double value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Double类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, int column, Float value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Float类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, int column, Integer value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Integer类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, int column, Long value)
      设置单元格的值
      参数:
      row - 行号
      column - 列
      value - Long类型值
      返回:
      1 设置成功 -1 设置失败
      抛出:
      InvalidRowColException - InvalidRowColException
      ColumnTypeNotMatchException - ColumnTypeNotMatchException
    • setItem

      public int setItem(int row, int column, String value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列 从1开始
      value - String类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, String column, Date value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - 时间类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, String column, Time value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - 时间类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, String column, Timestamp value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - 时间类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, String column, Double value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Double类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, String column, Float value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Float类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, String column, Integer value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Integer类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, String column, String value)
      设置单元格的值
      指定者:
      setItem 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - String类型值
      返回:
      1 设置成功 -1 设置失败
    • setObject

      public int setObject(int row, int column, Object value)
      设置单元格的值
      指定者:
      setObject 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Object类型值
      返回:
      1 设置成功 -1 设置失败
    • setObject

      public int setObject(int row, String column, Object value)
      设置单元格的值
      指定者:
      setObject 在接口中 DatastoreInterface
      参数:
      row - 行号
      column - 列
      value - Object类型值
      返回:
      1 设置成功 -1 设置失败
    • setItem

      public int setItem(int row, int column, Object value)
    • setItem

      public int setItem(int row, String column, Object value)
    • refresh

      public void refresh()
    • getColumnIndexByName

      public int getColumnIndexByName(String colName)
    • indexofcol

      public int indexofcol(String colName)
      取列索引值 从1开始
      参数:
      colName -
      返回:
    • hasColumn

      public boolean hasColumn(String colName)
      判断是否存在列
      参数:
      colName - 列名
      返回:
      boolean
    • getRowInfoRef

      public RowInfo getRowInfoRef(int row)
      获取指定行对象(引用) row : 行号 成功返回RowInfo对象,失败返回null.
      指定者:
      getRowInfoRef 在接口中 DatastoreInterface
      参数:
      row - 行号
      返回:
      成功返回RowInfo对象,失败返回null.
    • getRowInfoRef

      public RowInfo getRowInfoRef(int row, int buffer)
      获取指定行对象(引用),和getRowInfo的区别是getRowInfo是通过行克隆后取得的数据,而getRowInfoRef是直接取行的引用
      指定者:
      getRowInfoRef 在接口中 DatastoreInterface
      参数:
      row - : 行号
      返回:
      成功返回RowInfo对象,失败返回null.
    • getRowData

      public Object getRowData(int rowNo)
      获取指定行的附加数据,数据的范围是主缓冲
      参数:
      rowNo - 行号
      返回:
      行的附加数据
    • setRowData

      public void setRowData(int rowNo, Object rowData)
      设置指定行的附加数据
      参数:
      rowNo - 行号
      rowData - 行附加数据
    • getRowInfo

      public RowInfo getRowInfo(int row)
      从接口复制的说明: DatastoreInterface
      获取指定行对象(拷贝) row : 行号 成功返回RowInfo对象,失败返回null.
      指定者:
      getRowInfo 在接口中 DatastoreInterface
      参数:
      row - 行号
      返回:
      RowInfo
    • getRowInfo

      public RowInfo getRowInfo(int row, int buffer)
      指定者:
      getRowInfo 在接口中 DatastoreInterface
    • setVisible

      public void setVisible(int column, boolean visible)
      从接口复制的说明: DatastoreInterface
      设置指定列是否可见
      指定者:
      setVisible 在接口中 DatastoreInterface
      参数:
      column - 列号
      visible - 是否可见
    • setVisible

      public void setVisible(String column, boolean visible)
      指定者:
      setVisible 在接口中 DatastoreInterface
    • isVisible

      public boolean isVisible(int column)
      从接口复制的说明: DatastoreInterface
      获取指定列是否可见
      指定者:
      isVisible 在接口中 DatastoreInterface
      参数:
      column - 列号
      返回:
      boolean
    • isVisible

      public boolean isVisible(String column)
      指定者:
      isVisible 在接口中 DatastoreInterface
    • convert2XMLDatastore

      public XMLDatastore convert2XMLDatastore(Format[] ft) throws Exception
      将当前Datastore转换成XMLDatastore,同时格式化每一列数据
      参数:
      ft - 对应的每一列的格式
      返回:
      转换后的XMLDatastore
      抛出:
      Exception - Exception
    • convert2XMLDatastore

      public XMLDatastore convert2XMLDatastore() throws Exception
      将当前Datastore转换成XMLDatastore
      返回:
      XMLDatastore
      抛出:
      Exception - Exception
    • copy

      public Datastore copy()
      复制当前对象
      返回:
      与当前对象一样的深度复制后的Datastore对象
    • copy

      public Datastore copy(int start, int end)
      复制指定行数的记录
      参数:
      start - 开始行数
      end - 结束行数
      返回:
      Datastore
    • getFilterDatastore

      public Datastore getFilterDatastore(Datastore.DsFilter_I filter)
      获取子数据集,非线程安全
      参数:
      filter - Datastore.DsFilter_I
      返回:
      Datastore
    • getFilterDatastore

      public Datastore getFilterDatastore(String colName, String value)
      获取子数据集,非线程安全
      参数:
      colName - String
      value - String
      返回:
      Datastore
    • getValueWithExpress3

      public String getValueWithExpress3(int rowNo, String expStr, String format)
    • getValueWithExpress3

      public String getValueWithExpress3(String expStr, String format)
    • getValueWithExpress2

      public int getValueWithExpress2(int rowNo, String expStr)
    • getValueWithExpress2

      public int getValueWithExpress2(String expStr)
    • getValueWithExpress

      public double getValueWithExpress(String expStr)
    • getValueWithExpress

      public double getValueWithExpress(int rowNo, String expStr)
      表达式运算
      参数:
      rowNo - 行号,如果<=0表示求和
      expStr - 根据表达式计算, 表达式列为[colName]或#colName#,如:[sum(year_value)] + [month_value]
      返回:
      double
    • sum

      public double sum(String colName)
      求和
      参数:
      colName - 列名
      返回:
      指定列求和后的值
    • sum2

      public int sum2(String colName)
      求和
      参数:
      colName - 列名
      返回:
      指定列求和后的值,返回int型
    • sum

      public double sum(String colName, String filter)
      求和
      参数:
      colName - 列名
      filter - 条件表达式
      返回:
      指定列求和后的值
    • sum2

      public int sum2(String colName, String filter)
      求和
      参数:
      colName - 列名
      filter - 条件表达式
      返回:
      指定列求和后的值
    • max

      public double max(String colName)
    • min

      public double min(String colName)
    • max

      public double max(String colName, String filter)
    • min

      public double min(String colName, String filter)
    • avg

      public double avg(String colName)
      求平均值
      参数:
      colName - 列名
      返回:
      指定列求平均后的值
    • avg

      public double avg(String colName, String filter)
      求平均值
      参数:
      colName - 列名
      filter - 条件表达式
      返回:
      指定列求平均后的值
    • count

      public int count(String filter)
      求记录数
      参数:
      filter - 过滤
      返回:
      指定条件的行数
    • toJSONArray

      public JSONArray toJSONArray()
    • toJSONArrayWithLowerKey

      public JSONArray toJSONArrayWithLowerKey()
    • toJSONArrayWithBeautify

      public JSONArray toJSONArrayWithBeautify()
    • toJSONArray

      public JSONArray toJSONArray(DatastoreJSONConfig_I config)
      转化为JSONArray对象
      参数:
      config - DatastoreJSONConfig_I
      返回:
      JSONArray
    • toMarkdown

      public String toMarkdown()
      将数据集转化为Markdown格式
      返回:
      String
    • clone

      public Object clone()
      Datastore的克隆方法,实现思路是,先将Datastore序列化到一个数组,再通过数组重新构造一个Datastore
      覆盖:
      clone 在类中 Object
      返回:
      新创建的Datastore对象的实例
    • getSql

      public String getSql()
    • setSql

      public void setSql(String sql, String[] colsType, Object[] obj, long queryTime)
    • printLog

      public String printLog()
    • printLog

      public String printLog(org.slf4j.Logger log)
    • printLog

      public String printLog(org.apache.logging.log4j.Logger log4j)
    • printLog

      public String printLog(org.apache.logging.log4j.Logger log4j, String prefix)
    • isCacheData

      public boolean isCacheData()
    • setCacheData

      public void setCacheData(boolean isCacheData)
    • concat

      public String concat(String columnName)
    • concat

      public String concat(String columnName, String beginToken, String endToken)
    • concat

      public String concat(String columnName, String beginToken, String endToken, String defaultValue)
    • concatWithNoRepeat

      public String concatWithNoRepeat(String columnName)
      生成不允许重复的连接字符串
      参数:
      columnName - 列名
      返回:
      String
    • concatWithNoRepeat

      public String concatWithNoRepeat(String columnName, String beginToken, String endToken)
      生成没有重复的
      参数:
      columnName - 列名
      beginToken - String
      endToken - String
      返回:
      String
    • concat

      public String concat(String columnName, String beginToken, String endToken, boolean isRepeat, String defaultValue)
      获取连接的字符串
      参数:
      columnName - 列名
      beginToken - String
      endToken - String
      isRepeat - 是否允许重复
      defaultValue - 允许重复时默认值
      返回:
      String
    • deleteDuplicateRow

      public void deleteDuplicateRow()
      删除重复的行只保留一行
    • iterator

      public DsIterator iterator()
      获取迭代嚣
      返回:
      DsIterator
    • forEach

      public void forEach(Consumer<? super RowInfo> action)
    • forEach

      public void forEach(BiConsumer<? super RowInfo,? super DsIterator> action)
    • isForEachBreak

      public boolean isForEachBreak()
    • setForEachBreak

      public void setForEachBreak(boolean forEachBreak)
    • iterator

      public DsIterator iterator(int rowNo)
      获取迭代嚣
      参数:
      rowNo - 开始行号,从1开始
      返回:
      DsIterator
    • stream

      public DSStream stream()
    • toDBBuilder

      public DsUpdateDBBuilder toDBBuilder(DataCenter dc)
      将当前数据集中的数据保存到数据库对应的表当中
      返回:
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object