本文整理汇总了Java中org.eclipse.collections.impl.list.mutable.FastList类的典型用法代码示例。如果您正苦于以下问题:Java FastList类的具体用法?Java FastList怎么用?Java FastList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FastList类属于org.eclipse.collections.impl.list.mutable包,在下文中一共展示了FastList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: function0
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
@Test
public void function0()
{
// TODO - Convert this anonymous inner class to a lambda and then to a constructor reference
Function0<List<String>> supplier = new Function0<List<String>>()
{
@Override
public List<String> value()
{
return FastList.newList();
}
};
Assert.assertEquals(Lists.mutable.empty(), supplier.get());
Assert.assertNotSame(supplier.get(), supplier.get());
List<String> list = Stream.of("1", "2", "3").collect(Collectors.toCollection(supplier));
Assert.assertEquals(Lists.mutable.with("1", "2", "3"), list);
}
开发者ID:BNYMellon,项目名称:CodeKatas,代码行数:18,代码来源:EclipseCollectionsFunctionalInterfaceTest.java
示例2: assertDirectoriesEqual
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
/**
* Primitive DB comparison method
* We just compare file names, not the subdirecory structure also
* (so this would fail if multiple subdirectories had the same file name)
*/
public static void assertDirectoriesEqual(File expected, File actual) {
MutableList<File> expectedFiles = FastList.newList(FileUtils.listFiles(expected, new WildcardFileFilter("*"),
DIR_FILE_FILTER));
expectedFiles = expectedFiles.sortThisBy(toRelativePath(expected));
MutableList<File> actualFiles = FastList.newList(FileUtils.listFiles(actual, new WildcardFileFilter("*"),
DIR_FILE_FILTER));
actualFiles = actualFiles.sortThisBy(toRelativePath(actual));
assertEquals(
String.format("Directories did not have same # of files:\nExpected: %1$s\nbut was: %2$s",
expectedFiles.makeString("\n"), actualFiles.makeString("\n")),
expectedFiles.size(), actualFiles.size());
for (int i = 0; i < expectedFiles.size(); i++) {
File expectedFile = expectedFiles.get(i);
File actualFile = actualFiles.get(i);
String expectedFilePath = getRelativePath(expectedFile, expected);
String actualFilePath = getRelativePath(actualFile, actual);
System.out.println("Comparing" + expectedFilePath + " vs " + actualFilePath);
assertEquals("File " + i + " [" + expectedFile + " vs " + actualFile
+ " does not match paths relative from their roots", expectedFilePath, actualFilePath);
FileAssert.assertEquals("Mismatch on file " + expectedFile.getAbsolutePath(), expectedFile, actualFile);
}
}
开发者ID:goldmansachs,项目名称:obevo,代码行数:31,代码来源:DirectoryAssert.java
示例3: createTable
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private void createTable(Connection conn, String tableName, boolean requireReorg) {
try {
executorJdbc.update(conn, "DROP TABLE " + tableName);
} catch (Exception ignore) {
// Ignoring the exception, as no clear "DROP TABLE IF EXISTS" is
// available in DB2
}
executorJdbc.update(conn, "create table " + tableName + " (a integer, b integer, c integer, d integer, e integer) ");
executorJdbc.update(conn, "insert into " + tableName + " (a) values (3)");
MutableList<String> expectedColumns;
if (requireReorg) {
executorJdbc.update(conn, "alter table " + tableName + " drop column b");
executorJdbc.update(conn, "alter table " + tableName + " drop column c");
executorJdbc.update(conn, "alter table " + tableName + " drop column d");
expectedColumns = Lists.mutable.with("A", "E");
} else {
expectedColumns = Lists.mutable.with("A", "B", "C", "D", "E");
}
// Assert the columns which are available in table A
String columnListSql = "select colname from syscat.COLUMNS where tabschema = '" + physicalSchema.getPhysicalName() + "' AND tabname = '"
+ tableName + "'";
List<String> columnsInTableA = this.db2JdbcTemplate.query(conn, columnListSql,
new ColumnListHandler<String>());
assertEquals(expectedColumns, FastList.newList(columnsInTableA));
}
开发者ID:goldmansachs,项目名称:obevo,代码行数:27,代码来源:Db2ReOrgStatementExecutorIT.java
示例4: getRowKeys
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private List<Object> getRowKeys(ResultTable results, int drilldownLimit)
{
List<Object> rowKeys = FastList.newList();
List<List<ResultCell>> table = results.getVerifiedRows();
int rowIndex = 1;
while (rowIndex < table.size() && rowKeys.size() < drilldownLimit)
{
List<ResultCell> values = table.get(rowIndex);
int passedCount = Iterate.count(values, ResultCell.IS_PASSED_CELL);
int failedCount = Iterate.count(values, ResultCell.IS_FAILED_CELL);
if (passedCount == 0 || failedCount > 0)
{
ResultCell cell = Iterate.getLast(values);
rowKeys.add(cell.getActual() == null ? cell.getExpected() : cell.getActual());
}
rowIndex++;
}
return rowKeys;
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:20,代码来源:Watson.java
示例5: collectReverseMatchingRows
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private static void collectReverseMatchingRows(MutableList<IndexMap> columnIndices, List<List<ResultCell>> reverseHappyPathResults, VerifiableTable actualData, VerifiableTable expectedData, ColumnComparators columnComparators, int firstUnMatchedIndex)
{
int actualIndex = actualData.getRowCount() - 1;
int expectedIndex = expectedData.getRowCount() - 1;
int minActualIndex = firstUnMatchedIndex + 1;
int minExpectedIndex = firstUnMatchedIndex + 1;
while (expectedIndex >= minExpectedIndex && actualIndex >= minActualIndex)
{
MutableList<ResultCell> row = FastList.newList(columnIndices.size());
if (!checkRowMatches(columnIndices, reverseHappyPathResults, actualData, expectedData, columnComparators, actualIndex, expectedIndex, row))
{
return;
}
expectedIndex--;
actualIndex--;
}
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:19,代码来源:IndexMapTableVerifier.java
示例6: verifyTables
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
public Map<String, ResultTable> verifyTables(Map<String, ? extends VerifiableTable> expectedResults, Map<String, ? extends VerifiableTable> actualResults)
{
Map<String, ResultTable> results = new LinkedHashMap<>();
List<String> allTableNames = FastList.newList(expectedResults.keySet());
for (String actualTable : actualResults.keySet())
{
if (!expectedResults.containsKey(actualTable))
{
allTableNames.add(actualTable);
}
}
for (String tableName : allTableNames)
{
verifyTable(tableName, actualResults, expectedResults, results);
}
return results;
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:18,代码来源:MultiTableVerifier.java
示例7: getStackLineCount
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private static List<Pair<String, List<String>>> getStackLineCount(String string) throws IOException
{
List<Pair<String, List<String>>> stackTraces = FastList.newList();
Pair<String, List<String>> stackTrace = null;
BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(string.getBytes())));
String line = reader.readLine();
while (line != null)
{
if (line.startsWith(" "))
{
stackTrace.getTwo().add(line);
}
else
{
stackTrace = Tuples.<String, List<String>>pair(line, FastList.<String>newList());
stackTraces.add(stackTrace);
}
line = reader.readLine();
}
return stackTraces;
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:22,代码来源:ExceptionHtmlTest.java
示例8: createInMemoryDefault
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
public static SqlTranslatorConfigHelper createInMemoryDefault() {
SqlTranslatorConfigHelper configHelper = new SqlTranslatorConfigHelper();
configHelper.setNameMapper(new DefaultSqlTranslatorNameMapper());
configHelper.setColumnSqlTranslators(FastList.<ColumnSqlTranslator>newListWith());
configHelper.setPostColumnSqlTranslators(FastList.<PostColumnSqlTranslator>newListWith());
configHelper.setPostParsedSqlTranslators(FastList.<PostParsedSqlTranslator>newListWith(new ForeignKeyNameRemovalSqlTranslator()));
configHelper.setPreParsedSqlTranslators(FastList.<PreParsedSqlTranslator>newListWith(new RemoveWithPreParsedSqlTranslator()));
configHelper.setUnparsedSqlTranslators(FastList.<UnparsedSqlTranslator>newListWith(new DefaultUnparsedSqlTranslator()));
return configHelper;
}
开发者ID:goldmansachs,项目名称:obevo,代码行数:11,代码来源:SqlTranslatorConfigHelper.java
示例9: DelimitedStreamDataSource
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
public DelimitedStreamDataSource(String name, Reader reader, List<String> fields, String delimiter) {
super(name, reader);
this.delimiter = delimiter;
this.fields = FastList.newList(fields);
if (delimiter.equals("|")) {
LOG.warn("The delimiter is a regex, are you sure you want to use \"|\" instead of \"\\|\"?");
}
}
开发者ID:goldmansachs,项目名称:obevo,代码行数:10,代码来源:DelimitedStreamDataSource.java
示例10: readLines
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
public static MutableList<String> readLines(File file) {
try {
return FastList.newList(FileUtils.readLines(file));
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}
开发者ID:goldmansachs,项目名称:obevo,代码行数:8,代码来源:FileUtilsCobra.java
示例11: getColumns
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private List<String> getColumns(VerifiableTable table)
{
List<String> cols = FastList.newList(table.getColumnCount());
for (int i = 0; i < table.getColumnCount(); i++)
{
cols.add(table.getColumnName(i));
}
return cols;
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:10,代码来源:Watson.java
示例12: collectMatchingRows
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private static void collectMatchingRows(MutableList<IndexMap> columnIndices, List<List<ResultCell>> results, VerifiableTable actualData, VerifiableTable expectedData, ColumnComparators columnComparators)
{
int minRowCount = Math.min(actualData.getRowCount(), expectedData.getRowCount());
for (int rowIndex = 0; rowIndex < minRowCount; rowIndex++)
{
MutableList<ResultCell> row = FastList.newList(columnIndices.size());
if (!checkRowMatches(columnIndices, results, actualData, expectedData, columnComparators, rowIndex, rowIndex, row))
{
return;
}
}
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:13,代码来源:IndexMapTableVerifier.java
示例13: getHeadings
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private static List<String> getHeadings(VerifiableTable table, CellComparator comparator)
{
FastList<String> headings = FastList.newList();
for (int i = 0; i < table.getColumnCount(); i++)
{
headings.add(comparator.getFormatter().format(table.getColumnName(i)));
}
return headings;
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:10,代码来源:IndexMapTableVerifier.java
示例14: getKeyColumnIndexMaps
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private List<IndexMap> getKeyColumnIndexMaps(List<IndexMap> columnIndices)
{
List<IndexMap> keyColumns = FastList.newList(columnIndices.size());
for (IndexMap columnIndexMap : columnIndices)
{
if (columnIndexMap.isMatched() && this.actualData.isKeyColumn(columnIndexMap.getActualIndex()))
{
keyColumns.add(columnIndexMap);
}
}
return keyColumns;
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:13,代码来源:KeyColumnPartialMatcher.java
示例15: getAll
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
public MutableList<IndexMap> getAll()
{
Set<IndexMap> all = new TreeSet<>();
all.addAll(this.matched);
all.addAll(this.surplus);
all.addAll(this.missing);
return FastList.newList(all);
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:9,代码来源:IndexMapGenerator.java
示例16: parse
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
@Override
public ParserState parse(StreamTokenizer st) throws IOException, ParseException
{
if (this.sectionName == null)
{
throw new ParseException("no section name found before line " + st.lineno(), st.lineno());
}
// parse the data
int currentAttribute = 0;
int token = st.ttype;
boolean wantData = true;
List<Object> rowValue = FastList.newList();
while (token != StreamTokenizer.TT_EOL && token != StreamTokenizer.TT_EOF)
{
if (wantData)
{
this.getParser().getExpectedTable().parseData(st, currentAttribute, rowValue);
currentAttribute++;
}
else
{
if (token != ',')
{
throw new ParseException("Expected a comma on line " + st.lineno(), st.lineno());
}
}
wantData = !wantData;
token = st.nextToken();
}
if (Iterate.notEmpty(rowValue))
{
this.getParser().getExpectedTable().addRowToList(rowValue);
}
return this.getParser().getBeginningOfLineState();
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:38,代码来源:DataReaderState.java
示例17: getHtmlTagValues
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private List<String> getHtmlTagValues(String tagName)
{
NodeList tdNodes = this.outputHtml.getElementsByTagName(tagName);
List<String> tdValues = FastList.newList(tdNodes.getLength());
for (int i = 0; i < tdNodes.getLength(); i++)
{
tdValues.add(tdNodes.item(i).getFirstChild().getNodeValue());
}
return tdValues;
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:11,代码来源:RebaseAndVerifyTest.java
示例18: createTable
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
public static VerifiableTable createTable(int cols, Object... values)
{
List<List<Object>> headersAndRows = FastList.<List<Object>>newListWith(ArrayAdapter.adapt(values).subList(0, cols));
int start = cols;
while (start < values.length)
{
headersAndRows.add(ArrayAdapter.adapt(values).subList(start, start + cols));
start += cols;
}
// wrapping just to get coverage on default table adapter
return new DefaultVerifiableTableAdapter(new ListVerifiableTable(headersAndRows))
{
};
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:15,代码来源:TableTestUtils.java
示例19: runInnerTest
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
private static Result runInnerTest(Class innerClass)
{
EVENTS.put(innerClass, FastList.<String>newList());
File ouputFile = new File(TableTestUtils.getOutputDirectory(), innerClass.getSimpleName() + ".html");
if (ouputFile.exists())
{
Assert.assertTrue("Deleting " + ouputFile, ouputFile.delete());
}
return new JUnitCore().run(innerClass);
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:11,代码来源:LifecycleTest.java
示例20: setUp
import org.eclipse.collections.impl.list.mutable.FastList; //导入依赖的package包/类
@Before
public void setUp()
{
this.missing = FastList.newList();
for (int i = 0; i < MISSING.getRowCount(); i++)
{
this.missing.add(new UnmatchedIndexMap(i, -1));
}
this.surplus = FastList.newList();
for (int i = 0; i < SURPLUS.getRowCount(); i++)
{
this.surplus.add(new UnmatchedIndexMap(-1, i));
}
}
开发者ID:goldmansachs,项目名称:tablasco,代码行数:15,代码来源:PartialMatcherTest.java
注:本文中的org.eclipse.collections.impl.list.mutable.FastList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论