@Override public synchronized boolean add(Long aLong) { version++; return map.put(aLong, TRUE); }
@Override public synchronized boolean add(Long aLong) { version++; return map.put(aLong.longValue(), TRUE); }
void addTier(ITier tier) { tiers.add(tier); tiersHash3.put(tier.canonicalHashCode(), tier); }
private void addTiersHash2(ITier tier, int varName1, int varName2) { long key = varName1 < varName2 ? (long)varName1 << 21 | varName2 : (long)varName2 << 21 | varName1; ObjectArrayList tiers = (ObjectArrayList) tiersHash2.get(key); if (tiers == null) { tiersHash2.put(key, new ObjectArrayList(new ITier[] {tier})); } else { tiers.add(tier); } }
private void addVarName(int varName) { LongArrayList pairs = fullIndex.getPairs(varName); if (pairs == null) { // There is no any pairs that contain this varName. // No need to add it to the index. return; } for (int i = 0; i < pairs.size(); i++) { long key = pairs.getQuick(i); if (!pairsToTiersIndex.containsKey(key)) { pairsToTiersIndex.put(key, fullIndex.pairsToTiersIndex.get(key)); } } } }
int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor); rehash(newCapacity); return put(key, value);
int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor); rehash(newCapacity); return put(key, value);
this.minLoadFactor, this.maxLoadFactor); rehash(newCapacity); return put(key, value);
pairsToTiersIndex.put(key, tiers);
/** * Creates copy of <code>formula</code>. * * New formula uses the same instance of <code>permutation</code> and cloned instances of tiers. * Be careful about modifying permutation of new formula, because these changes will also affect initial formula. * * @param formula */ private SimpleFormula(SimpleFormula formula, final boolean fillTiersHash3) { this.permutation = formula.permutation; int tiersCount = formula.tiers.size(); this.tiers = new ObjectArrayList(tiersCount); this.tiersHash3 = fillTiersHash3 ? new OpenLongObjectHashMap(tiersCount) : null; Object[] tiersElements = formula.tiers.elements(); for (int i = 0; i < tiersCount; i++) { ITier clone = ((ITier) tiersElements[i]).clone(); tiers.add(clone); if (fillTiersHash3) { tiersHash3.put(clone.canonicalHashCode(), clone); } } }