it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap Java Examples
The following examples show how to use
it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DataFixerBuilder.java From DataFixerUpper with MIT License | 6 votes |
public DataFixer build(final Executor executor) { final DataFixerUpper fixerUpper = new DataFixerUpper(new Int2ObjectAVLTreeMap<>(schemas), new ArrayList<>(globalList), new IntAVLTreeSet(fixerVersions)); final IntBidirectionalIterator iterator = fixerUpper.fixerVersions().iterator(); while (iterator.hasNext()) { final int versionKey = iterator.nextInt(); final Schema schema = schemas.get(versionKey); for (final String typeName : schema.types()) { CompletableFuture.runAsync(() -> { final Type<?> dataType = schema.getType(() -> typeName); final TypeRewriteRule rule = fixerUpper.getRule(DataFixUtils.getVersion(versionKey), dataVersion); dataType.rewrite(rule, DataFixerUpper.OPTIMIZATION_RULE); }, executor).exceptionally(e -> { LOGGER.error("Unable to build datafixers", e); Runtime.getRuntime().exit(1); return null; }); } } return fixerUpper; }
Example #2
Source File: SparseTableTestCase.java From jstarcraft-ai with Apache License 2.0 | 5 votes |
@Override protected MathTable<Integer> getTable(boolean orientation, int dimension, Table<Integer, Integer, Integer> data) { SparseTable<Integer> table = new SparseTable<>(orientation, dimension, dimension, new Int2ObjectAVLTreeMap<>()); for (Cell<Integer, Integer, Integer> cell : data.cellSet()) { table.setValue(cell.getRowKey(), cell.getColumnKey(), cell.getValue()); } return table; }