org.apache.metamodel.data.DataSet.next()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中org.apache.metamodel.data.DataSet.next()方法的一些代码示例,展示了DataSet.next()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataSet.next()方法的具体详情如下:
包路径:org.apache.metamodel.data.DataSet
类名称:DataSet
方法名:next

DataSet.next介绍

[英]Moves forward to the next row.
[中]向前移动到下一行。

代码示例

代码示例来源:origin: apache/metamodel

@Override
  public boolean next() {
    if (_rowsLeft > 0) {
      boolean next = _dataSet.next();
      if (next) {
        _rowsLeft--;
      }
      return next;
    }
    return false;
  }
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
  public boolean next() {
    if (_rowsLeft > 0) {
      boolean next = _dataSet.next();
      if (next) {
        _rowsLeft--;
      }
      return next;
    }
    return false;
  }
}

代码示例来源:origin: apache/metamodel

@Override
public boolean next() {
  return _dataSet.next();
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
public boolean next() {
  return _dataSet.next();
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
public boolean next() {
  return _dataSet.next();
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
public boolean next() {
  return _dataSet.next();
}

代码示例来源:origin: apache/metamodel

@Override
public boolean next() {
  return _dataSet.next();
}

代码示例来源:origin: apache/metamodel

@Override
public boolean next() {
  return _dataSet.next();
}

代码示例来源:origin: org.eobjects.datacleaner/DataCleaner-monitor-services

private List<List<String>> createRowList(DataSet dataSet) {
  final List<List<String>> rows = new ArrayList<>();
  while (dataSet.next()) {
    rows.add(createRowValueList(dataSet));
  }
  return rows;
}

代码示例来源:origin: org.eobjects.analyzerbeans/AnalyzerBeans-core

public DataSetResult(DataSet ds) {
  _rows = new ArrayList<Row>();
  while (ds.next()) {
    _rows.add(ds.getRow());
  }
  ds.close();
}

代码示例来源:origin: datacleaner/DataCleaner

public DataSetResult(final DataSet ds) {
  _rows = new ArrayList<>();
  while (ds.next()) {
    _rows.add(ds.getRow());
  }
  ds.close();
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

private void materialize() {
  if (!_materialized) {
    try {
      while (_dataSet.next()) {
        _materializedRows.add(_dataSet.getRow());
      }
    } finally {
      _dataSet.close();
    }
    _materialized = true;
  }
}

代码示例来源:origin: apache/metamodel

private void materialize() {
  if (!_materialized) {
    try {
      while (_dataSet.next()) {
        _materializedRows.add(_dataSet.getRow());
      }
    } finally {
      _dataSet.close();
    }
    _materialized = true;
  }
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
public boolean next() {
  if (_iterator == null) {
    _iterator = _dataSetProviders.iterator();
  }
  while (_currentDataSet == null || !_currentDataSet.next()) {
    if (!_iterator.hasNext()) {
      _currentDataSet = null;
      return false;
    }
    _currentDataSet = _iterator.next().get();
    assert getHeader().size() == _currentDataSet.getSelectItems().size();
  }
  return true;
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

public static List<Row> readDataSetFull(DataSet dataSet) {
  final List<Row> result;
  if (dataSet instanceof InMemoryDataSet) {
    // if dataset is an in memory dataset we have a shortcut to avoid
    // creating a new list
    result = ((InMemoryDataSet) dataSet).getRows();
  } else {
    result = new ArrayList<Row>();
    while (dataSet.next()) {
      result.add(dataSet.getRow());
    }
  }
  dataSet.close();
  return result;
}

代码示例来源:origin: org.apache.metamodel/MetaModel-core

@Override
public boolean hasNext() {
  if (_iterationState == 0 || _iterationState == 2) {
    if (_dataSet.next()) {
      _iterationState = 1;
      _row = _dataSet.getRow();
    } else {
      _iterationState = 3;
      _row = null;
      _dataSet.close();
    }
  }
  return _iterationState == 1;
}

代码示例来源:origin: apache/metamodel

@Override
public boolean hasNext() {
  if (_iterationState == 0 || _iterationState == 2) {
    if (_dataSet.next()) {
      _iterationState = 1;
      _row = _dataSet.getRow();
    } else {
      _iterationState = 3;
      _row = null;
      _dataSet.close();
    }
  }
  return _iterationState == 1;
}

代码示例来源:origin: apache/metamodel

private int getLastRowNum(Sheet sheet) {
  final int lastRowNum = sheet.getLastRowNum();
  if (lastRowNum == 0 && sheet instanceof SXSSFSheet) {
    // streaming sheets have bad behaviour in this scenario - since no
    // rows are in cache, it will return 0!
    DataSet ds = _dataContext.query().from(sheet.getSheetName()).selectCount().execute();
    ds.next();
    final Number count = (Number) ds.getRow().getValue(0);
    final int columnNameLineNumber = _configuration.getColumnNameLineNumber();
    int oneBasedResult = count.intValue()
        + (columnNameLineNumber == ExcelConfiguration.NO_COLUMN_NAME_LINE ? 0 : columnNameLineNumber);
    return oneBasedResult - 1;
  }
  return lastRowNum;
}

代码示例来源:origin: org.apache.metamodel/MetaModel-excel

private int getLastRowNum(Sheet sheet) {
  final int lastRowNum = sheet.getLastRowNum();
  if (lastRowNum == 0 && sheet instanceof SXSSFSheet) {
    // streaming sheets have bad behaviour in this scenario - since no
    // rows are in cache, it will return 0!
    DataSet ds = _dataContext.query().from(sheet.getSheetName()).selectCount().execute();
    ds.next();
    final Number count = (Number) ds.getRow().getValue(0);
    final int columnNameLineNumber = _configuration.getColumnNameLineNumber();
    int oneBasedResult = count.intValue()
        + (columnNameLineNumber == ExcelConfiguration.NO_COLUMN_NAME_LINE ? 0 : columnNameLineNumber);
    return oneBasedResult - 1;
  }
  return lastRowNum;
}

代码示例来源:origin: datacleaner/DataCleaner

@Override
public boolean containsValue(final String value) {
  final DataContext dataContext = _datastoreConnection.getDataContext();
  final Column column = _dictionary.getColumn(_datastoreConnection);
  try (DataSet dataSet = dataContext.query().from(column.getTable()).select(column).where(column).eq(value)
      .maxRows(1).execute()) {
    if (dataSet.next()) {
      return true;
    }
    return false;
  }
}

相关文章