本文整理匯總了Java中it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.put方法的典型用法代碼示例。如果您正苦於以下問題:Java Long2ObjectOpenHashMap.put方法的具體用法?Java Long2ObjectOpenHashMap.put怎麽用?Java Long2ObjectOpenHashMap.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap
的用法示例。
在下文中一共展示了Long2ObjectOpenHashMap.put方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkAndStore
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
protected <T> void checkAndStore(long entityId, Class<? super T> type) {
if (isTransaction) {
LongOpenHashSet entityAdded = added.get(type);
if (entityAdded.contains(entityId))
return;
T oldT = repository.get((Class<T>)type, entityId);
Long2ObjectOpenHashMap<Object> data = snapshotted.get(type);
if (oldT == null) {
entityAdded.add(entityId);
} else if (!data.containsKey(entityId)) {
data.put(entityId, oldT);
}
}
}
示例2: readFieldsForPartition
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
@Override
public void readFieldsForPartition(DataInput in,
int partitionId) throws IOException {
int size = in.readInt();
Long2ObjectOpenHashMap<DataInputOutput> partitionMap =
new Long2ObjectOpenHashMap<DataInputOutput>(size);
while (size-- > 0) {
long vertexId = in.readLong();
DataInputOutput dataInputOutput = config.createMessagesInputOutput();
dataInputOutput.readFields(in);
partitionMap.put(vertexId, dataInputOutput);
}
synchronized (map) {
map.put(partitionId, partitionMap);
}
}
示例3: purgeIntersectingClusterEntries
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
protected Long2ObjectOpenHashMap<LongArrayList> purgeIntersectingClusterEntries(
Long2ObjectOpenHashMap<LongArrayList> result) {
Long2ObjectOpenHashMap<LongArrayList> purgedResult = new Long2ObjectOpenHashMap<>();
Iterator<Long> resultIterator = result.keySet().iterator();
while (resultIterator.hasNext()) {
long uniqueCluster = resultIterator.next();
if (result.get(uniqueCluster).size() != 1) {
purgedResult.put(uniqueCluster, result.get(uniqueCluster));
}
}
return purgedResult;
}
示例4: synchronizedLong2ObjectOpenHashMapCopy
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
@Benchmark
public Long2ObjectOpenHashMap synchronizedLong2ObjectOpenHashMapCopy(Context context) {
Long2ObjectOpenHashMap<Object> map = new Long2ObjectOpenHashMap<>();
synchronized (map) {
//Populate the map the first time
for (int i = 0; i < context.testValues.length; i++)
map.put(context.testKeys[i], context.testValues[i]);
//Copy!
Long2ObjectOpenHashMap<Object> copy = map.clone();
return copy;
}
}
示例5: getDataInputOutput
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
/**
* Get the DataInputOutput for a vertex id, creating if necessary.
*
* @param partitionMap Partition map to look in
* @param vertexId Id of the vertex
* @return DataInputOutput for this vertex id (created if necessary)
*/
private DataInputOutput getDataInputOutput(
Long2ObjectOpenHashMap<DataInputOutput> partitionMap,
long vertexId) {
DataInputOutput dataInputOutput = partitionMap.get(vertexId);
if (dataInputOutput == null) {
dataInputOutput = config.createMessagesInputOutput();
partitionMap.put(vertexId, dataInputOutput);
}
return dataInputOutput;
}
示例6: combineClusterIntoResult
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
protected void combineClusterIntoResult(ColumnCombinationBitset partialUnique)
throws AlgorithmExecutionException {
LongArrayList touchedCluster = new LongArrayList();
Long2LongOpenHashMap partialUniqueHash = this.algorithm.getPLI(partialUnique).asHashMap();
Set<ColumnCombinationBitset> startPoints = this.getConditionStartPoints();
for (ColumnCombinationBitset minimalConditionStartPoint : startPoints) {
if (minimalConditionStartPoint.getSetBits().size() != 1) {
minimalConditionStartPoint =
minimalConditionStartPoint.getContainedOneColumnCombinations().get(0);
}
List<ConditionEntry> satisfiedCluster = new ArrayList<>();
Long2ObjectOpenHashMap<LongArrayList> intersectingCluster = new Long2ObjectOpenHashMap<>();
int clusterNumber = 0;
//build intersecting cluster
for (ConditionEntry singleCluster : this.singleConditions.get(minimalConditionStartPoint)) {
satisfiedCluster.add(singleCluster.setClusterNumber(clusterNumber));
touchedCluster.clear();
for (long rowNumber : singleCluster.cluster) {
if (partialUniqueHash.containsKey(rowNumber)) {
touchedCluster.add(partialUniqueHash.get(rowNumber));
}
}
for (long partialUniqueClusterNumber : touchedCluster) {
if (intersectingCluster.containsKey(partialUniqueClusterNumber)) {
intersectingCluster.get(partialUniqueClusterNumber).add(clusterNumber);
} else {
LongArrayList newConditionClusterNumbers = new LongArrayList();
newConditionClusterNumbers.add(clusterNumber);
intersectingCluster.put(partialUniqueClusterNumber, newConditionClusterNumbers);
}
}
clusterNumber++;
}
intersectingCluster = purgeIntersectingClusterEntries(intersectingCluster);
//convert into list
List<LongArrayList> intersectingClusterList = new ArrayList<>();
for (long partialUniqueCluster : intersectingCluster.keySet()) {
intersectingClusterList.add(intersectingCluster.get(partialUniqueCluster));
}
Object2FloatArrayMap<List<ConditionEntry>>
clustergroups =
this.combineClusters(this.algorithm.frequency, satisfiedCluster,
intersectingClusterList);
for (List<ConditionEntry> singleCondition : clustergroups.keySet()) {
ResultSingleton.getInstance().addConditionToResult(partialUnique, singleCondition,
clustergroups.get(singleCondition));
}
}
}
示例7: addOrUpdateDelegate
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; //導入方法依賴的package包/類
/**
* Should be called by devices during {@link IDevice#onConnect()}
* or whenever a connected device adds or changes a block.
* Tracks the device block so that it is discoverable.<p>
*
* Does NOT form connections or notify neighbors of the new block.
* The caller is responsible for doing so. Done this way
* because some device blocks are inherently unable to
* form connections or are entirely contained within other
* blocks owned by the same device.<p>
*
* DOES notify old block of removal if a block was already present.
* In this case, the old block is responsible for handling
* tear down of existing connections, notifying neighbors, etc.
*
*/
public void addOrUpdateDelegate(@Nonnull IDeviceBlock block)
{
if(Configurator.logDeviceChanges)
Log.info("DeviceWorldManager.addOrUpdateDelegate: " + block.description());
Long2ObjectOpenHashMap<IDeviceBlock> blocks = this.getBlocksForDimension(block.dimensionID());
synchronized(blocks)
{
IDeviceBlock oldBlock = blocks.put(block.packedBlockPos(), block);
if(oldBlock != null) oldBlock.onRemoval();
}
}