类 DataSet

java.lang.Object
org.anyline.entity.DataSet
所有已实现的接口:
Serializable, Iterable<DataRow>, Collection<DataRow>, AnyData<DataSet>

public class DataSet extends Object implements Collection<DataRow>, Serializable, AnyData<DataSet>
另请参阅:
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • creatIndex

      public DataSet creatIndex(String key)
      创建索引
      参数:
      key - key
      返回:
      DataSet crateIndex("ID"); crateIndex("ID:ASC");
    • build

      public static DataSet build(Collection<?> list, String... fields)
    • parse

      public static DataSet parse(Collection<?> list, String... fields)
      list解析成DataSet
      参数:
      list - list
      fields - 如果list是二维数据 fields 下标对应的属性(字段/key)名称 如"ID","CODE","NAME" 如果不输入则以下标作为DataRow的key 如row.put("0","100").put("1","A01").put("2","张三"); 如果属性数量超出list长度, 取null值存入DataRow 如果list是一组数组 fileds对应条目的属性值 如果不输入 则以条目的属性作DataRow的key 如"USER_ID:id","USER_NM:name"
      返回:
      DataSet
    • parseJson

      public static DataSet parseJson(KeyAdapter.KEY_CASE keyCase, String json)
    • parseJson

      public static DataSet parseJson(String json)
    • parseJson

      public static DataSet parseJson(KeyAdapter.KEY_CASE keyCase, com.fasterxml.jackson.databind.JsonNode json)
    • parseJson

      public static DataSet parseJson(com.fasterxml.jackson.databind.JsonNode json)
    • getOverride

      public Boolean getOverride()
    • setOverride

      public void setOverride(Boolean override)
    • attr

      public DataSet attr(String key, Object value)
    • setAttribute

      public DataSet setAttribute(String key, Object value)
    • attr

      public Object attr(String key)
    • getAttribute

      public Object getAttribute(String key)
    • getAttributes

      public DataRow getAttributes()
    • setAttributes

      public DataSet setAttributes(DataRow attributes)
    • setMetadata

      public DataSet setMetadata(LinkedHashMap<String,Column> metadatas)
    • setMetadata

      public DataSet setMetadata(String name, Column column)
    • setMetadata

      public DataSet setMetadata(Column column)
    • getMetadatas

      public LinkedHashMap<String,Column> getMetadatas()
    • getMetadata

      public Column getMetadata(String column)
    • getMetadataTypeName

      public String getMetadataTypeName(String column)
    • getMetadataType

      public Integer getMetadataType(String column)
    • getMetadataFullType

      public String getMetadataFullType(String column)
    • getMetadataClassName

      public String getMetadataClassName(String column)
    • Camel

      public DataSet Camel()
      下划线转大驼峰
      返回:
      DataSet
    • camel_

      public DataSet camel_()
      驼峰转下划线
      返回:
      DataSet
    • camel

      public DataSet camel()
      下划线转小驼峰
      返回:
      DataSet
    • camel

      public DataSet camel(boolean lower)
      下划线转小驼峰
      参数:
      lower - 是否先转换成小写 遇到全大写但没有下划线的情况 false:不处理 true:全部转成小写
      返回:
      DataSet
    • setIsNew

      public DataSet setIsNew(boolean bol)
    • remove

      public DataSet remove(String... keys)
      移除每个条目中指定的key
      参数:
      keys - keys
      返回:
      DataSet
    • compress

      public DataSet compress()
      多个空白压缩成一个空格
      返回:
      DataSet
    • compress

      public DataSet compress(String... keys)
    • trim

      public DataSet trim()
      所有String类型的值执行trim
      返回:
      this
    • trim

      public DataSet trim(String... keys)
    • sbc2dbc

      public DataSet sbc2dbc()
      全角转半角
      返回:
      this
    • sbc2dbc

      public DataSet sbc2dbc(String... keys)
    • addPrimaryKey

      public DataSet addPrimaryKey(boolean applyItem, String... pks)
      添加主键
      参数:
      applyItem - 是否应用到集合中的DataRow 默认true
      pks - pks
      返回:
      DataSet
    • addPrimaryKey

      public DataSet addPrimaryKey(String... pks)
    • addPrimaryKey

      public DataSet addPrimaryKey(boolean applyItem, Collection<String> pks)
    • addPrimaryKey

      public DataSet addPrimaryKey(Collection<String> pks)
    • setPrimaryKey

      public DataSet setPrimaryKey(boolean applyItem, String... pks)
      设置主键
      参数:
      applyItem - applyItem
      pks - pks
      返回:
      DataSet
    • setPrimaryKey

      public DataSet setPrimaryKey(String... pks)
    • setPrimaryKey

      public DataSet setPrimaryKey(boolean applyItem, Collection<String> pks)
    • setPrimaryKey

      public DataSet setPrimaryKey(Collection<String> pks)
    • set

      public DataSet set(int index, DataRow item)
    • hasPrimaryKeys

      public boolean hasPrimaryKeys()
      是否有主键
      返回:
      boolean
    • getPrimaryColumn

      public Column getPrimaryColumn()
    • getPrimaryColumns

      public LinkedHashMap<String,Column> getPrimaryColumns()
    • getPrimaryKeys

      public List<String> getPrimaryKeys()
      提取主键
      返回:
      List
    • tag

      public DataSet tag(String key, Object value)
    • setTag

      public DataSet setTag(String key, Object value)
    • tag

      public Object tag(String key)
    • getTag

      public Object getTag(String key)
    • getTags

      public Map<String,Object> getTags()
    • addHead

      public DataSet addHead(String col)
      添加表头
      参数:
      col - col
      返回:
      DataSet
    • getHead

      public List<String> getHead()
      表头
      返回:
      List
    • indexOf

      public int indexOf(Object obj)
    • ellipsis

      public DataSet ellipsis(int length, String... columns)
      超长部分忽略
      参数:
      length - 最长显示长度
      columns - 检测列
      返回:
      this
    • truncates

      public DataSet truncates(int begin, int end)
      从begin开始截断到end, 方法执行将改变原DataSet长度
      参数:
      begin - 开始位置
      end - 结束位置
      返回:
      DataSet
    • truncates

      public DataSet truncates(int begin)
      从begin开始截断到最后一个
      参数:
      begin - 开始位置
      返回:
      DataSet
    • truncate

      public DataRow truncate(int begin)
      从begin开始截断到最后一个并返回其中第一个DataRow
      参数:
      begin - 开始位置
      返回:
      DataRow
    • truncate

      public DataRow truncate(int begin, int end)
      从begin开始截断到end位置并返回其中第一个DataRow
      参数:
      begin - 开始位置
      end - 结束位置
      返回:
      DataRow
    • cuts

      public DataSet cuts(int begin)
      从begin开始截取到最后一个
      参数:
      begin - 开始位置 如果输入负数则取后n个, 如果造成数量不足, 则取全部
      返回:
      DataSet
    • cuts

      public DataSet cuts(int begin, int end)
      从begin开始截取到end位置, 方法执行时会创建新的DataSet并不改变原有set长度
      参数:
      begin - 开始位置
      end - 结束位置
      返回:
      DataSet
    • cut

      public DataRow cut(int begin)
      从begin开始截取到最后一个, 并返回其中第一个DataRow
      参数:
      begin - 开始位置
      返回:
      DataSet
    • cut

      public DataRow cut(int begin, int end)
      从begin开始截取到end位置, 并返回其中第一个DataRow, 方法执行时会创建新的DataSet并不改变原有set长度
      参数:
      begin - 开始位置
      end - 结束位置
      返回:
      DataSet
    • size

      public int size()
      记录数量
      指定者:
      size 在接口中 Collection<DataRow>
      返回:
      int
    • total

      public long total()
      总行数 如果没有分页则与size()一致, 否则取navi的total row
      返回:
      int
    • count

      public int count(boolean empty, String key)
      计算行数
      参数:
      empty - 空值是否参与计算
      key - 判断空值的属性
      返回:
      int
    • getSize

      public int getSize()
    • isException

      public boolean isException()
      是否出现异常
      返回:
      boolean
    • isFromCache

      public boolean isFromCache()
    • setIsFromCache

      public DataSet setIsFromCache(boolean bol)
    • isEmpty

      public boolean isEmpty()
      返回数据是否为空
      指定者:
      isEmpty 在接口中 Collection<DataRow>
      返回:
      boolean
    • getRow

      public DataRow getRow(int index)
      读取一行数据
      参数:
      index - 索引
      返回:
      DataRow
    • exists

      public boolean exists(String... params)
    • getRow

      public DataRow getRow(Compare compare, String... params)
    • getRow

      public DataRow getRow(String... params)
    • getRow

      public DataRow getRow(Compare compare, DataRow params)
    • getRow

      public DataRow getRow(DataRow params)
    • getRow

      public DataRow getRow(Compare compare, List<String> params)
    • getRow

      public DataRow getRow(List<String> params)
    • getRow

      public DataRow getRow(Compare compare, int begin, String... params)
    • getRows

      public DataSet getRows(Map<String,String> kvs)
    • getRows

      public DataSet getRows(Compare compare, Map<String,String> kvs)
    • getRow

      public DataRow getRow(int begin, String... params)
    • getRow

      public DataRow getRow(Compare compare, int begin, DataRow params)
    • getRow

      public DataRow getRow(int begin, DataRow params)
    • getRowById

      public DataRow getRowById(String value)
    • getRowByPrimvaryValue

      public DataRow getRowByPrimvaryValue(String value)
    • distinct

      public DataSet distinct(String... keys)
      根据keys去重
      参数:
      keys - keys
      返回:
      DataSet
    • distinct

      public DataSet distinct(List<String> keys)
    • clone

      public Object clone()
      覆盖:
      clone 在类中 Object
    • cloneProperty

      public static DataSet cloneProperty(DataSet from, DataSet to)
    • convertNumber

      public DataSet convertNumber(String... keys)
      指定key转换成number
      参数:
      keys - keys
      返回:
      DataRow
    • convertString

      public DataSet convertString(String... keys)
    • convertInt

      public DataSet convertInt(Integer def, String... keys)
    • convertInt

      public DataSet convertInt(String... keys)
    • convertLong

      public DataSet convertLong(String... keys)
    • convertLong

      public DataSet convertLong(Long def, String... keys)
    • convertDouble

      public DataSet convertDouble(String... keys)
    • convertDouble

      public DataSet convertDouble(Double def, String... keys)
    • convertDecimal

      public DataSet convertDecimal(String... keys)
    • convertDecimal

      public DataSet convertDecimal(BigDecimal def, String... keys)
    • skip

      public DataSet skip(boolean skip)
    • getRows

      public DataSet getRows(int begin, int qty, String... params)
      筛选符合条件的集合 注意如果String类型 1与1.0比较不相等, 可以先调用convertNumber转换一下数据类型
      参数:
      params - key1, value1, key2:value2, key3, value3 "NM:zh%","AGE:>20","NM","%zh%"
      begin - begin
      qty - 最多筛选多少个 0表示不限制
      返回:
      DataSet
    • getRows

      public DataSet getRows(PageNavi navi, String... params)
    • getRows

      public DataSet getRows(Compare compare, int begin, int qty, String... params)
    • getRows

      public DataSet getRows(Compare compare, int begin, int qty, DataRow kvs)
    • getRows

      public DataSet getRows(int begin, int qty, DataRow kvs)
    • getRows

      public DataSet getRows(int begin, int qty, Map<String,String> kvs)
    • getRows

      public DataSet getRows(Compare compare, int begin, int qty, Map<String,String> kvs)
      参数:
      compare - 对比方式, 如果不指定则根据k:v解析 如 k:%v%
      begin - 开始
      qty - 结果最大数量
      kvs - 条件
      返回:
      DataSet
    • getRows

      public DataSet getRows(Compare compare, int begin, String... params)
    • getRows

      public DataSet getRows(int begin, String... params)
    • getRows

      public DataSet getRows(Compare compare, String... params)
    • getRows

      public DataSet getRows(String... params)
    • getRows

      public DataSet getRows(Compare compare, DataSet set, String key)
    • getRows

      public DataSet getRows(DataSet set, String key)
    • getRows

      public DataSet getRows(Compare compare, DataRow row, String... keys)
    • getRows

      public DataSet getRows(DataRow row, String... keys)
    • filter

      public DataSet filter(int begin, int end, String key, String value)
      提取符合指定属性值的集合
      参数:
      begin - begin
      end - end
      key - key
      value - value
      返回:
      DataSet
    • getRows

      public DataSet getRows(int fr, int to)
    • sum

      public BigDecimal sum(int begin, int end, String key)
      合计
      参数:
      begin - 开始
      end - 结束
      key - key
      返回:
      BigDecimal
    • sum

      public BigDecimal sum(String key)
    • sums

      public DataRow sums(DataRow result, List<String> keys)
      多列合计
      参数:
      result - 保存合计结果
      keys - keys
      返回:
      DataRow
    • sums

      public DataRow sums(DataRow result, String... keys)
    • sums

      public DataRow sums(String... keys)
    • avgs

      public DataRow avgs(DataRow result, List<String> keys)
      多列平均值
      参数:
      result - 保存合计结果
      keys - keys
      返回:
      DataRow
    • avgs

      public DataRow avgs(DataRow result, String... keys)
    • avgs

      public DataRow avgs(String... keys)
    • avgs

      public DataRow avgs(DataRow result, boolean empty, int scale, int round, List<String> keys)
      多列平均值
      参数:
      result - 保存合计结果
      scale - scale
      round - round
      keys - keys
      返回:
      DataRow
    • avgs

      public DataRow avgs(DataRow result, boolean empty, int scale, int round, String... keys)
    • avgs

      public DataRow avgs(boolean empty, int scale, int round, String... keys)
    • maxDecimal

      public BigDecimal maxDecimal(int top, String key)
      最大值
      参数:
      top - 多少行
      key - key
      返回:
      BigDecimal
    • maxDecimal

      public BigDecimal maxDecimal(String key)
    • maxInt

      public int maxInt(int top, String key)
    • maxInt

      public int maxInt(String key)
    • maxDouble

      public double maxDouble(int top, String key)
    • maxDouble

      public double maxDouble(String key)
    • maxLong

      public long maxLong(int top, String key)
    • maxLong

      public long maxLong(String key)
    • maxFloat

      public double maxFloat(int top, String key)
    • maxFloat

      public double maxFloat(String key)
    • minDecimal

      public BigDecimal minDecimal(int top, String key)
      最小值
      参数:
      top - 多少行
      key - key
      返回:
      BigDecimal
    • minDecimal

      public BigDecimal minDecimal(String key)
    • minInt

      public int minInt(int top, String key)
    • minInt

      public int minInt(String key)
    • minDouble

      public double minDouble(int top, String key)
    • minDouble

      public double minDouble(String key)
    • minFloat

      public double minFloat(int top, String key)
    • minFloat

      public double minFloat(String key)
    • max

      public DataRow max(String key)
      key对应的value最大的一行
      参数:
      key - key
      返回:
      DataRow
    • min

      public DataRow min(String key)
    • avg

      public BigDecimal avg(boolean empty, int scale, int round, int top, String key)
      平均值 空数据不参与加法但参与除法
      参数:
      empty - 空值是否参与计算
      top - 多少行
      key - key
      scale - scale
      round - round
      返回:
      BigDecimal
    • avg

      public BigDecimal avg(int scale, int round, String key)
    • avg

      public BigDecimal avg(boolean empty, int scale, int round, String key)
    • avg

      public BigDecimal avg(boolean empty, String key)
    • avg

      public BigDecimal avg(String key)
    • sum

      public DataSet sum(String result, String items, String field, Compare compare, String... conditions)
      求和 [ {NM:部门1, USERS:[{LVL:1, SCORE:6}, {LVL:1, SCORE:7}, {LVL:2, SCORE:8}]} , {NM:部门2, USERS:[{LVL:1, SCORE:60}, {LVL:3, SCORE:70}, {LVL:2, SCORE:80}]} , {NM:部门3, USERS:[{LVL:1, SCORE:600}, {LVL:5, SCORE:700}, {LVL:2, SCORE:800}]} ] sum("TOTAL","USERS","SCORE","LVL>1") 计算每个部门中 LVL大于1部分的用户子集 的SCORE合计 计算结果存储在TOTAL属性中 [ {NM:部门1, TOTAL:8, USERS:[{LVL:1, SCORE:6}, {LVL:1, SCORE:7}, {LVL:2, SCORE:8}]} , {NM:部门2, TOTAL:150, USERS:[{LVL:1, SCORE:60}, {LVL:3, SCORE:70}, {LVL:2, SCORE:80}]} , {NM:部门3, TOTAL:2100, USERS:[{LVL:6, SCORE:600}, {LVL:5, SCORE:700}, {LVL:2, SCORE:800}]} ]
      参数:
      result - 合计结果存储
      compare - 条件过滤对比方式
      items - 计算条目中的 items 集合
      field - 根据field列 求和
      conditions - items子集过滤条件
      返回:
      DataSet
    • avg

      public DataSet avg(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • var

      public DataSet var(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • min

      public DataSet min(String result, String items, String field, Compare compare, String... conditions)
    • max

      public DataSet max(String result, String items, String field, Compare compare, String... conditions)
    • count

      public DataSet count(String result, String items, boolean empty, String field, Compare compare, String... conditions)
    • vara

      public DataSet vara(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • varp

      public DataSet varp(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • varpa

      public DataSet varpa(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • stdev

      public DataSet stdev(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • stdeva

      public DataSet stdeva(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • stdevp

      public DataSet stdevp(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • stdevpa

      public DataSet stdevpa(String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • agg

      public DataSet agg(Aggregation agg, String result, String items, int scale, int round, String field, Compare compare, String... conditions)
    • sum

      public DataSet sum(String result, String items, String field, String... conditions)
    • avg

      public DataSet avg(String result, String items, int scale, int round, String field, String... conditions)
    • var

      public DataSet var(String result, String items, int scale, int round, String field, String... conditions)
    • min

      public DataSet min(String result, String items, String field, String... conditions)
    • max

      public DataSet max(String result, String items, String field, String... conditions)
    • count

      public DataSet count(String result, String items, boolean empty, String field, String... conditions)
    • vara

      public DataSet vara(String result, String items, int scale, int round, String field, String... conditions)
    • varp

      public DataSet varp(String result, String items, int scale, int round, String field, String... conditions)
    • varpa

      public DataSet varpa(String result, String items, int scale, int round, String field, String... conditions)
    • stdev

      public DataSet stdev(String result, String items, int scale, int round, String field, String... conditions)
    • stdeva

      public DataSet stdeva(String result, String items, int scale, int round, String field, String... conditions)
    • stdevp

      public DataSet stdevp(String result, String items, int scale, int round, String field, String... conditions)
    • agg

      public DataSet agg(Aggregation agg, String result, String items, int scale, int round, String field, String... conditions)
    • addRow

      public DataSet addRow(DataRow row)
    • addRow

      public DataSet addRow(int idx, DataRow row)
    • concat

      public String concat(String key, String connector)
      合并key例的值 以connector连接
      参数:
      key - key
      connector - connector
      返回:
      String v1, v2, v3
    • concatNvl

      public String concatNvl(String key, String connector)
    • concatWithoutNull

      public String concatWithoutNull(String key, String connector)
      合并key例的值 以connector连接(不取null值)
      参数:
      key - key
      connector - connector
      返回:
      String v1, v2, v3
    • concatWithoutEmpty

      public String concatWithoutEmpty(String key, String connector)
      合并key例的值 以connector连接(不取空值)
      参数:
      key - key
      connector - connector
      返回:
      String v1, v2, v3
    • concatNvl

      public String concatNvl(String key)
    • concatWithoutNull

      public String concatWithoutNull(String key)
    • concatWithoutEmpty

      public String concatWithoutEmpty(String key)
    • concat

      public String concat(String key)
    • fetchValues

      public List<Object> fetchValues(String key)
      提取单列值
      参数:
      key - key
      返回:
      List
    • fetchDistinctValue

      public List<String> fetchDistinctValue(String key)
      取单列不重复的值
      参数:
      key - key
      返回:
      List
    • fetchDistinctValues

      public List<String> fetchDistinctValues(String key)
    • displayNavi

      public String displayNavi(String link)
      分页
      参数:
      link - link
      返回:
      String
    • displayNavi

      public String displayNavi()
    • put

      public DataSet put(int idx, String key, Object value)
    • removes

      public DataSet removes(String... keys)
    • getString

      public String getString(int index, String key) throws Exception
      String
      参数:
      index - 索引
      key - key
      返回:
      String
      抛出:
      Exception - 异常 Exception
    • getString

      public String getString(int index, String key, String def)
    • getPoint

      public Point getPoint(int index, String key, Point def)
    • getPoint

      public Point getPoint(int index, String key) throws Exception
      抛出:
      Exception
    • getString

      public String getString(String key) throws Exception
      抛出:
      Exception
    • getString

      public String getString(String key, String def)
    • get

      public Object get(int index, String key)
    • gets

      public List<Object> gets(String key)
    • getSets

      public List<DataSet> getSets(String key)
    • getStrings

      public List<String> getStrings(String key)
    • getStrings

      public List<String> getStrings(String key, String... defs)
    • getStringArrays

      public List<String[]> getStringArrays(String... keys)
      根据keys返回数组列表 [ {120.1, 36.1} , {120.2, 36.2} ]
      参数:
      keys - keys 如 lng, lat
      返回:
      List
    • getDecimals

      public List<BigDecimal> getDecimals(String key, BigDecimal def)
    • getInts

      public List<Integer> getInts(String key) throws Exception
      抛出:
      Exception
    • getDistinctInts

      public List<Integer> getDistinctInts(String key) throws Exception
      抛出:
      Exception
    • getInts

      public List<Integer> getInts(String key, int def)
    • getIntArrays

      public List<Integer[]> getIntArrays(String... keys) throws Exception
      抛出:
      Exception
    • getIntArrays

      public List<Integer[]> getIntArrays(Integer def, List<String> keys)
    • getIntArrays

      public List<Integer[]> getIntArrays(Integer def, String... keys)
    • getLongs

      public List<Long> getLongs(String key) throws Exception
      抛出:
      Exception
    • getLongs

      public List<Long> getLongs(String key, Long def)
    • getDistinctLongs

      public List<Long> getDistinctLongs(String key, Long def)
    • getLongArrays

      public List<Long[]> getLongArrays(String... keys) throws Exception
      抛出:
      Exception
    • getLongArrays

      public List<Long[]> getLongArrays(Long def, List<String> keys)
    • getLongArrays

      public List<Long[]> getLongArrays(Long def, String... keys)
    • getDoubles

      public List<Double> getDoubles(String key) throws Exception
      抛出:
      Exception
    • getDistinctDoubles

      public List<Double> getDistinctDoubles(String key) throws Exception
      抛出:
      Exception
    • getDoubles

      public List<Double> getDoubles(String key, Double def)
    • getDoubleArrays

      public List<Double[]> getDoubleArrays(String... keys) throws Exception
      抛出:
      Exception
    • getDoubleArrays

      public List<Double[]> getDoubleArrays(Double def, List<String> keys)
    • getDoubleArrays

      public List<Double[]> getDoubleArrays(Double def, String... keys)
    • getObjects

      public List<Object> getObjects(String key)
    • getDistinctStrings

      public List<String> getDistinctStrings(String key)
    • getNvlStrings

      public List<String> getNvlStrings(String key)
    • getStringsWithoutEmpty

      public List<String> getStringsWithoutEmpty(String key)
    • getStringsWithoutNull

      public List<String> getStringsWithoutNull(String key)
    • getDecimal

      public BigDecimal getDecimal(int idx, String key) throws Exception
      抛出:
      Exception
    • getDecimal

      public BigDecimal getDecimal(int idx, String key, double def)
    • getDecimal

      public BigDecimal getDecimal(int idx, String key, BigDecimal def)
    • extract

      public DataSet extract(boolean regex, String... keys)
      抽取指定列生成新的DataSet 新的DataSet只包括指定列的值与分页信息,不包含其他附加信息(如来源表)
      参数:
      regex - 是否开启正则匹配
      keys - keys
      返回:
      DataSet
    • extract

      public DataSet extract(boolean regex, List<String> keys)
    • extract

      public DataSet extract(String... keys)
    • getEscapeString

      public String getEscapeString(int index, String key) throws Exception
      escape String
      参数:
      index - 索引
      key - key
      返回:
      String
      抛出:
      Exception - 异常 Exception
    • getEscapeString

      public String getEscapeString(int index, String key, String def)
    • getDoubleEscapeString

      public String getDoubleEscapeString(int index, String key) throws Exception
      抛出:
      Exception
    • getDoubleEscapeString

      public String getDoubleEscapeString(int index, String key, String def)
    • getEscapeString

      public String getEscapeString(String key) throws Exception
      抛出:
      Exception
    • getDoubleEscapeString

      public String getDoubleEscapeString(String key) throws Exception
      抛出:
      Exception
    • getInt

      public int getInt(int index, String key) throws Exception
      int
      参数:
      index - 索引
      key - key
      返回:
      int
      抛出:
      Exception - 异常 Exception
    • getInt

      public int getInt(int index, String key, int def)
    • getInt

      public int getInt(String key) throws Exception
      抛出:
      Exception
    • getInt

      public int getInt(String key, int def)
    • getDouble

      public double getDouble(int index, String key) throws Exception
      double
      参数:
      index - 索引
      key - key
      返回:
      double
      抛出:
      Exception - 异常 Exception
    • getDouble

      public double getDouble(int index, String key, double def)
    • getDouble

      public double getDouble(String key) throws Exception
      抛出:
      Exception
    • getDouble

      public double getDouble(String key, double def)
    • add

      public DataSet add(String target, String key, int value)
      在key列基础上 +value,如果原来没有key列则默认0并put到target 如果target与key一致则覆盖原值
      参数:
      target - 计算结果key
      key - key
      value - value
      返回:
      this
    • add

      public DataSet add(String target, String key, double value)
    • add

      public DataSet add(String target, String key, short value)
    • add

      public DataSet add(String target, String key, float value)
    • add

      public DataSet add(String target, String key, BigDecimal value)
    • add

      public DataSet add(String key, int value)
    • add

      public DataSet add(String key, double value)
    • add

      public DataSet add(String key, short value)
    • add

      public DataSet add(String key, float value)
    • add

      public DataSet add(String key, BigDecimal value)
    • subtract

      public DataSet subtract(String target, String key, int value)
    • subtract

      public DataSet subtract(String target, String key, double value)
    • subtract

      public DataSet subtract(String target, String key, short value)
    • subtract

      public DataSet subtract(String target, String key, float value)
    • subtract

      public DataSet subtract(String target, String key, BigDecimal value)
    • subtract

      public DataSet subtract(String key, int value)
    • subtract

      public DataSet subtract(String key, double value)
    • subtract

      public DataSet subtract(String key, short value)
    • subtract

      public DataSet subtract(String key, float value)
    • subtract

      public DataSet subtract(String key, BigDecimal value)
    • multiply

      public DataSet multiply(String target, String key, int value)
    • multiply

      public DataSet multiply(String target, String key, double value)
    • multiply

      public DataSet multiply(String target, String key, short value)
    • multiply

      public DataSet multiply(String target, String key, float value)
    • multiply

      public DataSet multiply(String target, String key, BigDecimal value)
    • multiply

      public DataSet multiply(String key, int value)
    • multiply

      public DataSet multiply(String key, double value)
    • multiply

      public DataSet multiply(String key, short value)
    • multiply

      public DataSet multiply(String key, float value)
    • multiply

      public DataSet multiply(String key, BigDecimal value)
    • divide

      public DataSet divide(String target, String key, int value)
    • divide

      public DataSet divide(String target, String key, double value)
    • divide

      public DataSet divide(String target, String key, short value)
    • divide

      public DataSet divide(String target, String key, float value)
    • divide

      public DataSet divide(String target, String key, BigDecimal value, int mode)
    • divide

      public DataSet divide(String key, int value)
    • divide

      public DataSet divide(String key, double value)
    • divide

      public DataSet divide(String key, short value)
    • divide

      public DataSet divide(String key, float value)
    • divide

      public DataSet divide(String key, BigDecimal value, int mode)
    • round

      public DataSet round(String target, String key, int scale, int mode)
    • round

      public DataSet round(String key, int scale, int mode)
      舍入
      参数:
      key - 属性
      scale - 小数位
      mode - 舍入模式 参考BigDecimal静态常量 ROUND_UP = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字(始终对非零舍弃部分前面的数字加 1) 如:2.36 转成 2.4
      ROUND_DOWN = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1,即截短). 如:2.36 转成 2.3
      ROUND_CEILING = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_UP 相同 如果为负,则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集
      ROUND_FLOOR = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_DOWN 相同 如果为负,则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反
      ROUND_HALF_UP = 4 四舍五入
      ROUND_HALF_DOWN = 5 五舍六入
      ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)
      如果舍弃部分左边的数字为奇数,则舍入行为与 ROUND_HALF_UP 相同(四舍五入)
      如果为偶数,则舍入行为与 ROUND_HALF_DOWN 相同(五舍六入)
      如:1.15 转成 1.2,因为5前面的1是奇数;1.25 转成 1.2,因为5前面的2是偶数
      ROUND_UNNECESSARY=7 断言所请求的操作具有准确的结果,因此不需要舍入。如果在产生不精确结果的操作上指定了该舍入模式,则会抛出ArithmeticException异常
      返回:
      DataSet
    • split

      public List<DataSet> split(int page)
      每页最少1行,最少分1页,最多分DataSet.size()页 多余的从第1页开始追加 5行分2页:共分成2页(3+2) 5行分3页:共分成3页(2+2+1) 10行分3页:共分成3页(4+3+3) 10行分6页:共分成6页(2+2+2+2+1+1) 5行分0页:共分成1页(5) 2行分3页:共分成2页(1+1) DataSet拆分成size部分
      参数:
      page - 拆成多少部分
      返回:
      list
    • page

      public List<DataSet> page(int vol)
      分页
      参数:
      vol - 每页多少行
      返回:
      List
    • toString

      public String toString()
      rows 列表中的数据格式化成json格式 不同与toJSON map.put("type","list"); map.put("result", result); map.put("message", message); map.put("rows", rows); map.put("success", result); map.put("navi", navi);
      覆盖:
      toString 在类中 Object
    • toJson

      public String toJson()
      rows 列表中的数据格式化成json格式 不同与toString
      返回:
      String
    • getJson

      public String getJson()
    • toJSON

      public String toJSON()
      指定者:
      toJSON 在接口中 AnyData<DataSet>
    • toJson

      public String toJson(com.fasterxml.jackson.annotation.JsonInclude.Include include)
    • getJson

      public String getJson(com.fasterxml.jackson.annotation.JsonInclude.Include include)
    • toJSON

      public String toJSON(com.fasterxml.jackson.annotation.JsonInclude.Include include)
    • toMap

      public Map<String,DataRow> toMap(String key)
      根据指定列生成map
      参数:
      key - ID,{ID}_{NM}
      返回:
      Map
    • entity

      public <T> T entity(int index, Class<T> clazz, String... configs)
      转换成对象
      类型参数:
      T - T
      参数:
      index - 索引
      clazz - clazz
      configs - 属性对应关系 name:USER_NAME
      返回:
      T
    • entity

      public <T> List<T> entity(Class<T> clazz)
      转换成对象集合
      类型参数:
      T - T
      参数:
      clazz - clazz
      返回:
      List
    • entity

      public <T> T entity(Class<T> clazz, int idx)
    • entitys

      public <T> EntitySet<T> entitys(Class<T> clazz)
    • setDest

      public DataSet setDest(String dest)
    • union

      public DataSet union(DataSet set, List<String> keys)
      合并
      参数:
      set - DataSet
      keys - 根据keys去重
      返回:
      DataSet
    • union

      public DataSet union(DataSet set, String... keys)
    • unionAll

      public DataSet unionAll(DataSet set)
      合并合并不去重
      参数:
      set - set
      返回:
      DataSet
    • contains

      public boolean contains(DataRow row, List<String> keys)
      是否包含这一行
      参数:
      row - row
      keys - keys
      返回:
      boolean
    • contains

      public boolean contains(DataRow row, String... keys)
    • packParam

      public String[] packParam(DataRow row, String... keys)
    • packParam

      public String[] packParam(DataRow row, List<String> keys)
      根据数据与属性列表 封装kvs ["ID","1","CODE","A01"]
      参数:
      row - 数据 DataRow
      keys - 属性 ID,CODE
      返回:
      kvs
    • setParent

      public DataSet setParent(String key, DataRow parent)
    • dispatchs

      public DataSet dispatchs(Compare compare, String field, boolean unique, boolean recursion, DataSet items, List<String> keys)
      从items中按相应的key提取数据 存入 dispatch("children",items, "DEPAT_CD") dispatchs("children",items, "CD:BASE_CD")
      参数:
      compare - 匹配方式 默认=
      field - 默认"ITEMS"
      unique - 是否只分配一次(同一个条目不能分配到多个组中)
      recursion - 是否递归 所有子级以相同条件执行dispatchs
      items - items默认this
      keys - ID:DEPT_ID或ID
      返回:
      DataSet
    • dispatchs

      public DataSet dispatchs(Compare compare, String field, boolean unique, boolean recursion, DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(Compare compare, boolean unique, boolean recursion, DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(Compare compare, String field, DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(Compare compare, DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(Compare compare, boolean unique, boolean recursion, String... keys)
    • dispatchs

      public DataSet dispatchs(Compare compare, String field, boolean unique, boolean recursion, String... keys)
    • dispatch

      public DataSet dispatch(Compare compare, String field, boolean unique, boolean recursion, DataSet items, List<String> keys)
      没有匹配成功的情况下,field依然会保留,如果需要清空可以调用set.removeEmptyRow(field)
      参数:
      compare - 对比方式
      field - file
      unique - 是否唯一 items中同一个条目只能匹配成功一次
      recursion - 是否递归
      items - items
      keys - 匹配条件
      返回:
      this
    • dispatch

      public DataSet dispatch(Compare compare, String field, boolean unique, boolean recursion, DataSet items, String... keys)
    • dispatch

      public DataSet dispatch(Compare compare, String field, DataSet items, String... keys)
    • dispatch

      public DataSet dispatch(Compare compare, DataSet items, String... keys)
    • dispatch

      public DataSet dispatch(Compare compare, boolean unique, boolean recursion, String... keys)
    • dispatch

      public DataSet dispatch(Compare compare, String field, boolean unique, boolean recursion, String... keys)
    • dispatchs

      public DataSet dispatchs(String field, boolean unique, boolean recursion, DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(boolean unique, boolean recursion, DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(String field, DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(DataSet items, String... keys)
    • dispatchs

      public DataSet dispatchs(boolean unique, boolean recursion, String... keys)
    • dispatchs

      public DataSet dispatchs(String field, boolean unique, boolean recursion, String... keys)
    • dispatch

      public DataSet dispatch(String field, boolean unique, boolean recursion, DataSet items, String... keys)
    • dispatch

      public DataSet dispatch(String field, DataSet items, String... keys)
    • dispatch

      public DataSet dispatch(DataSet items, String... keys)
    • dispatch

      public DataSet dispatch(boolean unique, boolean recursion, String... keys)
    • dispatch

      public DataSet dispatch(String field, boolean unique, boolean recursion, String... keys)
    • dispatchItems

      @Deprecated public DataSet dispatchItems(String field, boolean unique, boolean recursion, DataSet items, String... keys)
      已过时。
      直接调用dispatchs
      参数:
      field - 默认"ITEMS"
      unique - 是否只分配一次(同一个条目不能分配到多个组中)
      recursion - 是否递归
      items - items
      keys - ID:DEPT_ID或ID
      返回:
      DataSet
    • dispatchItems

      @Deprecated public DataSet dispatchItems(boolean unique, boolean recursion, DataSet items, String... keys)
      已过时。
    • dispatchItems

      @Deprecated public DataSet dispatchItems(String field, DataSet items, String... keys)
      已过时。
    • dispatchItems

      @Deprecated public DataSet dispatchItems(DataSet items, String... keys)
      已过时。
    • dispatchItems

      @Deprecated public DataSet dispatchItems(boolean unique, boolean recursion, String... keys)
      已过时。
    • dispatchItems

      @Deprecated public DataSet dispatchItems(String field, boolean unique, boolean recursion, String... keys)
      已过时。
    • dispatchItem

      @Deprecated public DataSet dispatchItem(String field, boolean unique, boolean recursion, DataSet items, String... keys)
      已过时。
    • dispatchItem

      @Deprecated public DataSet dispatchItem(String field, DataSet items, String... keys)
      已过时。
    • dispatchItem

      @Deprecated public DataSet dispatchItem(DataSet items, String... keys)
      已过时。
    • dispatchItem

      @Deprecated public DataSet dispatchItem(boolean unique, boolean recursion, String... keys)
      已过时。
    • dispatchItem

      @Deprecated public DataSet dispatchItem(String field, boolean unique, boolean recursion, String... keys)
      已过时。
    • join

      public DataSet join(DataSet items, List<String> keys)
      根据keys列建立关联,并将关联出来的结果拼接到集合的条目上,如果有重复则覆盖条目
      参数:
      items - 被查询的集合
      keys - 关联条件列
      返回:
      DataSet
    • join

      public DataSet join(DataSet items, String... keys)
    • toLowerKey

      public DataSet toLowerKey(boolean recursion, String... keys)
      从接口复制的说明: AnyData
      key转小写,转换后删除原来的key
      指定者:
      toLowerKey 在接口中 AnyData<DataSet>
      参数:
      recursion - 是否递归执行(仅支持AnyData类型)
      keys - 需要转换的key,如果不提供则转换全部
      返回:
      this
    • toUpperKey

      public DataSet toUpperKey(boolean recursion, String... keys)
      从接口复制的说明: AnyData
      key转小写,转换后删除原来的key
      指定者:
      toUpperKey 在接口中 AnyData<DataSet>
      参数:
      recursion - 是否递归执行(仅支持AnyData类型)
      keys - 需要转换的key,如果不提供则转换全部
      返回:
      this
    • toLowerValue

      public DataSet toLowerValue()
    • toUpperValue

      public DataSet toUpperValue()
    • setUpdateNullColumn

      public DataSet setUpdateNullColumn(boolean updateNullColumn)
      设置是否更新null列
      参数:
      updateNullColumn - updateNullColumn
      返回:
      DataRow
    • setUpdateEmptyColumn

      public DataSet setUpdateEmptyColumn(boolean updateEmptyColumn)
      设置是否更新null列
      参数:
      updateEmptyColumn - updateEmptyColumn
      返回:
      DataRow
    • group

      public DataSet group(String field, Compare compare, String... keys)
      按keys分组
      参数:
      keys - keys
      返回:
      DataSet
    • group

      public DataSet group(String... keys)
    • group

      public DataSet group(String items, String field, String factor, Aggregation agg, int scale, int round, String... keys)
      分组聚合
      参数:
      items - 是否保留条目 如果为空则不保留 否则保留会在每个分组中添加items属性用来保存当前分组中的条件
      field - 聚合结果保存属性 如果不指定则以 factor_agg命名 如 age_avg
      factor - 计算因子属性 取条目中的factor属性的值参与计算
      agg - 聚合公式 参考Aggregation枚举
      keys - 分组条件 指定属性相同的条目合成一组
      scale - 精度(小数位)
      round - 舍入模式 参考BigDecimal静态常量 ROUND_UP = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字(始终对非零舍弃部分前面的数字加 1) 如:2.36 转成 2.4
      ROUND_DOWN = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1,即截短). 如:2.36 转成 2.3
      ROUND_CEILING = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_UP 相同 如果为负,则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集
      ROUND_FLOOR = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_DOWN 相同 如果为负,则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反
      ROUND_HALF_UP = 4 四舍五入
      ROUND_HALF_DOWN = 5 五舍六入
      ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)
      如果舍弃部分左边的数字为奇数,则舍入行为与 ROUND_HALF_UP 相同(四舍五入)
      如果为偶数,则舍入行为与 ROUND_HALF_DOWN 相同(五舍六入)
      如:1.15 转成 1.2,因为5前面的1是奇数;1.25 转成 1.2,因为5前面的2是偶数
      ROUND_UNNECESSARY=7 断言所请求的操作具有准确的结果,因此不需要舍入。如果在产生不精确结果的操作上指定了该舍入模式,则会抛出ArithmeticException异常
      返回:
      DataSet
    • group

      public DataSet group(String items, List<AggregationConfig> aggs, String... keys)
      同一规则分组后,多次聚合
      参数:
      items - 是否保留条目 如果为空则不保留 否则保留会在每个分组中添加items属性用来保存当前分组中的条件
      aggs - 聚合规则
      keys - 分组条件 指定属性相同的条目合成一组
      返回:
      DataSet
    • group

      public DataSet group(String factor, Aggregation agg, String... keys)
    • group

      public DataSet group(Aggregation agg, String... keys)
    • agg

      public Object agg(String type, String key)
    • agg

      public Object agg(Aggregation agg, String key)
    • agg

      public Object agg(Aggregation agg, int scale, int round, String key)
      聚合计算
      参数:
      agg - 公式
      key - 计算因子属性
      scale - 小数位
      round - 舍入模式 参考BigDecimal静态常量 ROUND_UP = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字(始终对非零舍弃部分前面的数字加 1) 如:2.36 转成 2.4
      ROUND_DOWN = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1,即截短). 如:2.36 转成 2.3
      ROUND_CEILING = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_UP 相同 如果为负,则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集
      ROUND_FLOOR = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_DOWN 相同 如果为负,则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反
      ROUND_HALF_UP = 4 四舍五入
      ROUND_HALF_DOWN = 5 五舍六入
      ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)
      如果舍弃部分左边的数字为奇数,则舍入行为与 ROUND_HALF_UP 相同(四舍五入)
      如果为偶数,则舍入行为与 ROUND_HALF_DOWN 相同(五舍六入)
      如:1.15 转成 1.2,因为5前面的1是奇数;1.25 转成 1.2,因为5前面的2是偶数
      ROUND_UNNECESSARY=7 断言所请求的操作具有准确的结果,因此不需要舍入。如果在产生不精确结果的操作上指定了该舍入模式,则会抛出ArithmeticException异常
      返回:
      Object
    • stdev

      public BigDecimal stdev(int scale, int round, String key)
      抽样标准差 抽样标准差σ=sqrt(s^2),即标准差=方差的平方根
      参数:
      key - 取值属性
      scale - 小数位
      round - 舍入模式 参考BigDecimal静态常量 ROUND_UP = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字(始终对非零舍弃部分前面的数字加 1) 如:2.36 转成 2.4
      ROUND_DOWN = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1,即截短). 如:2.36 转成 2.3
      ROUND_CEILING = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_UP 相同 如果为负,则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集
      ROUND_FLOOR = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_DOWN 相同 如果为负,则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反
      ROUND_HALF_UP = 4 四舍五入
      ROUND_HALF_DOWN = 5 五舍六入
      ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)
      如果舍弃部分左边的数字为奇数,则舍入行为与 ROUND_HALF_UP 相同(四舍五入)
      如果为偶数,则舍入行为与 ROUND_HALF_DOWN 相同(五舍六入)
      如:1.15 转成 1.2,因为5前面的1是奇数;1.25 转成 1.2,因为5前面的2是偶数
      ROUND_UNNECESSARY=7 断言所请求的操作具有准确的结果,因此不需要舍入。如果在产生不精确结果的操作上指定了该舍入模式,则会抛出ArithmeticException异常
      返回:
      标准差
    • stdeva

      public BigDecimal stdeva(int scale, int round, String key)
    • stdevp

      public BigDecimal stdevp(int scale, int round, String key)
      总体标准差 总体标准差σ=sqrt(s^2),即标准差=方差的平方根
      参数:
      key - 取值属性
      scale - 小数位
      round - 舍入模式 参考BigDecimal静态常量 ROUND_UP = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字(始终对非零舍弃部分前面的数字加 1) 如:2.36 转成 2.4
      ROUND_DOWN = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1,即截短). 如:2.36 转成 2.3
      ROUND_CEILING = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_UP 相同 如果为负,则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集
      ROUND_FLOOR = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_DOWN 相同 如果为负,则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反
      ROUND_HALF_UP = 4 四舍五入
      ROUND_HALF_DOWN = 5 五舍六入
      ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)
      如果舍弃部分左边的数字为奇数,则舍入行为与 ROUND_HALF_UP 相同(四舍五入)
      如果为偶数,则舍入行为与 ROUND_HALF_DOWN 相同(五舍六入)
      如:1.15 转成 1.2,因为5前面的1是奇数;1.25 转成 1.2,因为5前面的2是偶数
      ROUND_UNNECESSARY=7 断言所请求的操作具有准确的结果,因此不需要舍入。如果在产生不精确结果的操作上指定了该舍入模式,则会抛出ArithmeticException异常
      返回:
      标准差
    • stdevpa

      public BigDecimal stdevpa(int scale, int round, String key)
    • var

      public BigDecimal var(int scale, int round, String key)
      抽样方差 s^2=[(x1-x)^2+(x2-x)^2+......(xn-x)^2]/(n-1)(x为平均数)
      参数:
      key - 取值属性
      scale - 小数位
      round - 舍入模式 参考BigDecimal静态常量 ROUND_UP = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字(始终对非零舍弃部分前面的数字加 1) 如:2.36 转成 2.4
      ROUND_DOWN = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1,即截短). 如:2.36 转成 2.3
      ROUND_CEILING = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_UP 相同 如果为负,则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集
      ROUND_FLOOR = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_DOWN 相同 如果为负,则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反
      ROUND_HALF_UP = 4 四舍五入
      ROUND_HALF_DOWN = 5 五舍六入
      ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)
      如果舍弃部分左边的数字为奇数,则舍入行为与 ROUND_HALF_UP 相同(四舍五入)
      如果为偶数,则舍入行为与 ROUND_HALF_DOWN 相同(五舍六入)
      如:1.15 转成 1.2,因为5前面的1是奇数;1.25 转成 1.2,因为5前面的2是偶数
      ROUND_UNNECESSARY=7 断言所请求的操作具有准确的结果,因此不需要舍入。如果在产生不精确结果的操作上指定了该舍入模式,则会抛出ArithmeticException异常
      返回:
      标准差
    • vara

      public BigDecimal vara(int scale, int round, String key)
    • varp

      public BigDecimal varp(int scale, int round, String key)
      总体方差 s^2=[(x1-x)^2+(x2-x)^2+......(xn-x)^2]/n(x为平均数)
      参数:
      key - 取值属性
      scale - 小数位
      round - 舍入模式 参考BigDecimal静态常量 ROUND_UP = 0 舍入远离零的舍入模式 在丢弃非零部分之前始终增加数字(始终对非零舍弃部分前面的数字加 1) 如:2.36 转成 2.4
      ROUND_DOWN = 1 接近零的舍入模式 在丢弃某部分之前始终不增加数字(从不对舍弃部分前面的数字加1,即截短). 如:2.36 转成 2.3
      ROUND_CEILING = 2 接近正无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_UP 相同 如果为负,则舍入行为与 ROUND_DOWN 相同 相当于是 ROUND_UP 和 ROUND_DOWN 的合集
      ROUND_FLOOR = 3 接近负无穷大的舍入模式 如果 BigDecimal 为正,则舍入行为与 ROUND_DOWN 相同 如果为负,则舍入行为与 ROUND_UP 相同 与ROUND_CEILING 正好相反
      ROUND_HALF_UP = 4 四舍五入
      ROUND_HALF_DOWN = 5 五舍六入
      ROUND_HALF_EVEN = 6 四舍六入 五留双(银行家舍入法)
      如果舍弃部分左边的数字为奇数,则舍入行为与 ROUND_HALF_UP 相同(四舍五入)
      如果为偶数,则舍入行为与 ROUND_HALF_DOWN 相同(五舍六入)
      如:1.15 转成 1.2,因为5前面的1是奇数;1.25 转成 1.2,因为5前面的2是偶数
      ROUND_UNNECESSARY=7 断言所请求的操作具有准确的结果,因此不需要舍入。如果在产生不精确结果的操作上指定了该舍入模式,则会抛出ArithmeticException异常
      返回:
      标准差
    • varpa

      public BigDecimal varpa(int scale, int round, String key)
    • or

      public DataSet or(DataSet set, String... keys)
    • intersection

      public static DataSet intersection(boolean distinct, List<DataSet> sets, String... keys)
      多个集合的交集
      参数:
      distinct - 是否根据keys抽取不重复的集合
      sets - 集合
      keys - 判断依据
      返回:
      DataSet
    • intersection

      public static DataSet intersection(List<DataSet> sets, String... keys)
    • intersection

      public DataSet intersection(boolean distinct, DataSet set, String... keys)
      交集
      参数:
      distinct - 是否根据keys抽取不重复的集合(根据keys去重)
      set - set
      keys - 根据keys列比较是否相等,如果列名不一致"ID:USER_ID",ID表示当前DataSet的列,USER_ID表示参数中DataSet的列
      返回:
      DataSet
    • intersection

      public DataSet intersection(DataSet set, String... keys)
    • and

      public DataSet and(boolean distinct, DataSet set, String... keys)
    • and

      public DataSet and(DataSet set, String... keys)
    • complement

      public DataSet complement(boolean distinct, DataSet set, String... keys)
      补集 在this中,但不在set中 this作为超集 set作为子集
      参数:
      distinct - 是否根据keys抽取不重复的集合
      set - set
      keys - keys
      返回:
      DataSet
    • complement

      public DataSet complement(DataSet set, String... keys)
    • difference

      public DataSet difference(boolean distinct, DataSet set, String... keys)
      差集 从当前集合中删除set中存在的row,生成新的DataSet并不修改当前对象 this中有 set中没有的
      参数:
      distinct - 是否根据keys抽取不重复的集合
      set - set
      keys - CD,"CD:WORK_CD"
      返回:
      DataSet
    • difference

      public DataSet difference(DataSet set, String... keys)
    • removeEmptyRow

      public DataSet removeEmptyRow(String... keys)
      清除指定列全为空的行,如果不指定keys,则清除所有列都为空的行
      参数:
      keys - keys
      返回:
      DataSet
    • changeKey

      public DataSet changeKey(String key, String target, boolean remove)
      修改key
      参数:
      key - key
      target - 修改后key
      remove - 修改后是否把来的key删除
      返回:
      this
    • changeKey

      public DataSet changeKey(String key, String target)
    • removeColumn

      public DataSet removeColumn(String... columns)
      删除rows中的columns列
      参数:
      columns - 检测的列,如果不输入则检测所有列
      返回:
      DataSet
    • removeEmptyColumn

      public DataSet removeEmptyColumn(String... columns)
      删除rows中值为空(null|'')的列
      参数:
      columns - 检测的列,如果不输入则检测所有列
      返回:
      DataSet
    • nvl

      public DataSet nvl()
      NULL > ""
      返回:
      DataSet
    • add

      public DataRow add(KeyAdapter.KEY_CASE cs)
    • add

      public DataRow add()
    • add

      public boolean add(DataRow e)
      指定者:
      add 在接口中 Collection<DataRow>
    • addAll

      public boolean addAll(Collection c)
      指定者:
      addAll 在接口中 Collection<DataRow>
    • clear

      public void clear()
      指定者:
      clear 在接口中 Collection<DataRow>
    • contains

      public boolean contains(Object o)
      指定者:
      contains 在接口中 Collection<DataRow>
    • containsAll

      public boolean containsAll(Collection<?> c)
      指定者:
      containsAll 在接口中 Collection<DataRow>
    • iterator

      public Iterator<DataRow> iterator()
      指定者:
      iterator 在接口中 Collection<DataRow>
      指定者:
      iterator 在接口中 Iterable<DataRow>
    • remove

      public boolean remove(Object o)
      指定者:
      remove 在接口中 Collection<DataRow>
    • removeAll

      public boolean removeAll(Collection<?> c)
      指定者:
      removeAll 在接口中 Collection<DataRow>
    • retainAll

      public boolean retainAll(Collection<?> c)
      指定者:
      retainAll 在接口中 Collection<DataRow>
    • toArray

      public Object[] toArray()
      指定者:
      toArray 在接口中 Collection<DataRow>
    • toArray

      public Object[] toArray(Object[] a)
      指定者:
      toArray 在接口中 Collection<DataRow>
    • getCatalog

      public Catalog getCatalog()
    • getCatalogName

      public String getCatalogName()
    • setCatalog

      public DataSet setCatalog(Catalog catalog)
    • setCatalog

      public DataSet setCatalog(String catalog)
    • getSchema

      public Schema getSchema()
    • getSchemaName

      public String getSchemaName()
    • setSchema

      public DataSet setSchema(Schema schema)
    • setSchema

      public DataSet setSchema(String schema)
    • getTable

      public Table getTable(boolean checkItem)
    • getTable

      public Table getTable()
    • getTableName

      public String getTableName()
    • getTableFullName

      public String getTableFullName()
    • getTables

      public LinkedHashMap<String,Table> getTables(boolean checkItem)
    • setTables

      public DataSet setTables(List<Table> tables)
    • setTables

      public DataSet setTables(LinkedHashMap<String,Table> tables)
    • setTable

      public DataSet setTable(Table table)
    • addTable

      public DataSet addTable(Table table)
    • setTable

      public DataSet setTable(String table)
    • isExpire

      public boolean isExpire(int millisecond)
      验证是否过期 根据当前时间与创建时间对比 过期返回 true
      参数:
      millisecond - 过期时间(毫秒) millisecond 过期时间(毫秒)
      返回:
      boolean
    • isExpire

      public boolean isExpire(long millisecond)
    • isExpire

      public boolean isExpire()
    • getCreateTime

      public long getCreateTime()
    • getRows

      public List<DataRow> getRows()
    • getExpires

      public long getExpires()
      过期时间(毫秒)
      返回:
      long
    • setExpires

      public DataSet setExpires(long millisecond)
    • setExpires

      public DataSet setExpires(int millisecond)
    • isResult

      public boolean isResult()
    • isSuccess

      public boolean isSuccess()
    • setResult

      public DataSet setResult(boolean result)
    • getException

      public Exception getException()
    • setException

      public DataSet setException(Exception exception)
    • getMessage

      public String getMessage()
    • setMessage

      public DataSet setMessage(String message)
    • getNavi

      public PageNavi getNavi()
    • setNavi

      public DataSet setNavi(PageNavi navi)
    • setRows

      public DataSet setRows(List<DataRow> rows)
    • getDest

      public String getDest()
    • order

      public DataSet order(String... keys)
    • put

      public DataSet put(String key, Object value, boolean pk, boolean override)
    • putWithoutNull

      public DataSet putWithoutNull(String key, Object value)
    • putWithoutEmpty

      public DataSet putWithoutEmpty(String key, Object value)
    • putIfNull

      public DataSet putIfNull(String key, Object value)
    • putIfEmpty

      public DataSet putIfEmpty(String key, Object value)
    • put

      public DataSet put(String key, Object value, boolean pk)
    • put

      public DataSet put(String key, Object value)
    • derive

      public DataSet derive(String key, Object origin)
      通过origin派生新列
      derive("ADDRESS","${PROVINCE_NAME}-%{CITY_NAME}"),执行完成后每个条目上会添加一个新列ADDRESS
      参数:
      key - 新列名
      origin - 原列名,以${列名1}${列名2}格式提供,${}之外的原样输出
      返回:
      DataSet
    • putVar

      public DataSet putVar(String key, Object value)
    • pivot

      public DataSet pivot(List<String> pks, List<String> classKeys, List<String> valueKeys)
      行转列 表结构(编号, 姓名, 年度, 科目, 分数, 等级)
      参数:
      pks - 唯一标识key(如编号,姓名)
      classKeys - 分类key(如年度,科目)
      valueKeys - 取值key(如分数,等级),如果不指定key则将整行作为value
      返回:
      DataSet 如果指定key 返回结构 [ {编号:01,姓名:张三,2010-数学-分数:100}, {编号:01,姓名:张三,2010-数学-等级:A}, {编号:01,姓名:张三,2010-物理-分数:100} ] 如果只有一个valueKey则返回[ {编号:01,姓名:张三,2010-数学:100}, {编号:01,姓名:张三,2010-物理:90} ] 不指定valuekey则返回 [ {编号:01,姓名:张三,2010-数学:{分数:100,等级:A}}, {编号:01,姓名:张三,2010-物理:{分数:100,等级:A}} ]
    • pivot

      public DataSet pivot(String[] pks, String[] classKeys, String[] valueKeys)
    • pivot

      public DataSet pivot(String pk, String classKey, String valueKey)
      行转列
      参数:
      pk - 唯一标识key(如姓名)多个key以,分隔如(编号,姓名)
      classKey - 分类key(如科目)多个key以,分隔如(科目,年度)
      valueKey - 取值key(如分数)多个key以,分隔如(分数,等级)
      返回:
      DataSet 表结构(姓名,科目,分数) 返回结构 [{姓名:张三,数学:100,物理:90,英语:80},{姓名:李四,数学:100,物理:90,英语:80}]
    • pivot

      public DataSet pivot(String pk, String classKey)
    • pivot

      public DataSet pivot(List<String> pks, List<String> classKeys, String... valueKeys)
    • map

      public Map map(String key, String value)
      [{code:"A", type:"A1"},{code:"B", type:"B1"}] map("code","type") 转换成{A:"A1",B:"B1"}
      如果需要排序、去重 可以先调用asc/desc distinct
      参数:
      key - 作为key的列
      value - 作为value的列
      返回:
      LinkedHashMap
    • map

      public Map map(String key)
      将key列的值作为新map的key,this作为value
      参数:
      key - key
      返回:
      map
    • map

      public Map map(int key)
    • map

      public Map map(int key, int value)
      参数:
      key - 作为key的列的下标
      value - 作为value的列的下标
      返回:
      LinkedHashMap
    • map

      public Map map()
      默认第0列值作为key,第1列值作为value
      返回:
      LinkedHashMap
    • row

      public DataRow row(String key, String value)
      [{code:"A", type:"A1"},{code:"B", type:"B1"}] map("code","type") 转换成{A:"A1",B:"B1"}
      如果需要排序、去重 可以先调用asc/desc distinct
      参数:
      key - 作为key的列
      value - 作为value的列
      返回:
      DataRow
    • row

      public DataRow row(int key, int value)
      参数:
      key - 作为key的列的下标
      value - 作为value的列的下标
      返回:
      DataRow
    • row

      public DataRow row()
      默认第0列值作为key,第1列值作为value
      返回:
      DataRow
    • asc

      public DataSet asc(String... keys)
      排序(正序)
      参数:
      keys - 参与排序的列
      返回:
      this
    • desc

      public DataSet desc(String... keys)
      排序(倒序)
      参数:
      keys - 参与排序的列
      返回:
      this
    • sort

      public DataSet sort(int factor, String... keys)
      排序默认根据元数据类型,如果没有设置的一律按String执行
      参数:
      factor - 1:正序 -1:倒序
      keys - 参与排序的列
      返回:
      this
    • addAllUpdateColumns

      public DataSet addAllUpdateColumns()
    • clearUpdateColumns

      public DataSet clearUpdateColumns()
    • removeNull

      public DataSet removeNull(String... keys)
    • replaceNull

      public DataSet replaceNull(String replace, String... keys)
      替换所有NULL值
      参数:
      replace - replace
      keys - 需要替换的key 如果不指定则替换全部key
      返回:
      DataSet
    • replaceEmpty

      public DataSet replaceEmpty(String replace, String... keys)
      替换所有空值
      参数:
      replace - replace
      keys - 需要替换的key 如果不指定则替换全部key
      返回:
      DataSet
    • replaces

      public DataSet replaces(String oldChar, String replace, String... keys)
    • replaces

      public DataSet replaces(boolean regex, String oldChar, String replace, String... keys)
    • replaceRegex

      public DataSet replaceRegex(String regex, String replace, String... keys)
    • random

      public DataRow random()
      随机取一行
      返回:
      DataRow
    • randoms

      public DataSet randoms(int qty)
      随机取qty行
      参数:
      qty - 行数
      返回:
      DataSet
    • ognl

      public DataSet ognl(String key, String formula, Object values, int strategy, boolean exception) throws Exception
      根据ognl表达式 设置集合中每个DataRow.key的值
      参数:
      key - key
      formula - ognl表达式
      values - 运行时值
      strategy - 发生异常时执行策略 0:忽略异常继续下一个 1:全部回滚
      exception - 发生异常时是否抛出
      返回:
      DataSet
      抛出:
      Exception - Exception
    • ognl

      public DataSet ognl(String key, String formula, int strategy, boolean exception) throws Exception
      抛出:
      Exception
    • ognl

      public DataSet ognl(String key, String formula) throws Exception
      抛出:
      Exception
    • randoms

      public DataSet randoms(int min, int max)
      随机取min到max行
      参数:
      min - min
      max - max
      返回:
      DataSet
    • unique

      public DataSet unique(String... keys)
    • regex

      public DataSet regex(String key, String regex, Regular.MATCH_MODE mode)
      根据正则提取集合
      参数:
      key - key
      regex - 正则
      mode - 匹配方式
      返回:
      DataSet
    • regex

      public DataSet regex(String key, String regex)
    • checkRequired

      public boolean checkRequired(String... keys)
    • getDatalink

      public String getDatalink()
    • setDatalink

      public void setDatalink(String datalink)
    • copy

      public DataSet copy(boolean regex, DataRow data, String... keys)
    • copy

      public DataSet copy(boolean regex, DataRow data, List<String> keys)
    • copy

      public DataSet copy(DataRow data, String... keys)
    • copyString

      public DataSet copyString(DataRow data, String... keys)
      复制String类型数据
      参数:
      data - data
      keys - keys
      返回:
      DataSet