/** {@inheritDoc} */ public boolean containsAll( Collection<?> collection ) { for ( Object element : collection ) { if ( element instanceof Integer ) { int ele = ( ( Integer ) element ).intValue(); if ( ! TIntIntHashMap.this.containsKey( ele ) ) { return false; } } else { return false; } } return true; }
public int remove(String s) { String str = checkKeyMap(s); int code = hashcode.hashcode(str); int ret = -1; if (intdata.containsKey(code)) { ret = intdata.remove(code); } return ret; }
/** {@inheritDoc} */ public boolean containsAll( TIntCollection collection ) { TIntIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TIntIntHashMap.this.containsKey( iter.next() ) ) { return false; } } return true; }
@Override public ItemStack addMeta(int meta, String name) { if(!values.containsKey(meta)) { throw new RuntimeException("Usage of wrong function. Use the addMeta function that has an amount paired with it with this implementation"); } return super.addMeta(meta, name); } }
/** See {@link gnu.trove.map.hash.TIntIntHashMap#containsKey(int)} */ public boolean containsKey(int key) { return delegate.containsKey(key); }
/** See {@link gnu.trove.map.hash.TIntIntHashMap#containsKey(int)} */ public boolean containsKey(int key) { return delegate.containsKey(key); }
/** {@inheritDoc} */ public boolean containsAll( Collection<?> collection ) { for ( Object element : collection ) { if ( element instanceof Integer ) { int ele = ( ( Integer ) element ).intValue(); if ( ! TIntIntHashMap.this.containsKey( ele ) ) { return false; } } else { return false; } } return true; }
/** {@inheritDoc} */ public boolean containsAll( Collection<?> collection ) { for ( Object element : collection ) { if ( element instanceof Integer ) { int ele = ( ( Integer ) element ).intValue(); if ( ! TIntIntHashMap.this.containsKey( ele ) ) { return false; } } else { return false; } } return true; }
public boolean contains(String f) { return feature2Id.containsKey(getFeatureHash(f)); }
public boolean contains(String f) { return feature2Id.containsKey(getFeatureHash(f)); }
private static Propagator createProp(IntVar[] vars, int[] values, IntVar[] cards) { assert values.length == cards.length; TIntIntHashMap map = new TIntIntHashMap(); int idx = 0; for (int v : values) { if (!map.containsKey(v)) { map.put(v, idx); idx++; } else { throw new UnsupportedOperationException("ERROR: multiple occurrences of value: " + v); } } return new PropFastGCC(vars, values, map, cards); }
/** {@inheritDoc} */ public boolean containsAll( TIntCollection collection ) { TIntIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TIntIntHashMap.this.containsKey( iter.next() ) ) { return false; } } return true; }
/** {@inheritDoc} */ @Override public boolean containsAll( TIntCollection collection ) { TIntIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TIntIntHashMap.this.containsKey( iter.next() ) ) { return false; } } return true; }
/** * Increment the count for featureId. */ public synchronized void countFeature(int featureId) { synchronized (featureCounts) { if (!featureCounts.containsKey(featureId)) featureCounts.put(featureId, 1); else featureCounts.put(featureId, featureCounts.get(featureId) + 1); } }
public synchronized void countFeature(int featureId) { synchronized (featureCounts) { if (!featureCounts.containsKey(featureId)) featureCounts.put(featureId, 1); else featureCounts.put(featureId, featureCounts.get(featureId) + 1); } } }
/** {@inheritDoc} */ public boolean containsAll( TIntCollection collection ) { TIntIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TIntIntHashMap.this.containsKey( iter.next() ) ) { return false; } } return true; }
/** * Increment the count for featureId. */ public synchronized void countFeature(int featureId) { synchronized (featureCounts) { if (!featureCounts.containsKey(featureId)) featureCounts.put(featureId, 1); else featureCounts.put(featureId, featureCounts.get(featureId) + 1); } }
public synchronized void countFeature(int featureId) { synchronized (featureCounts) { if (!featureCounts.containsKey(featureId)) featureCounts.put(featureId, 1); else featureCounts.put(featureId, featureCounts.get(featureId) + 1); } } }
/** {@inheritDoc} */ public boolean containsAll( TIntCollection collection ) { TIntIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TIntIntHashMap.this.containsKey( iter.next() ) ) { return false; } } return true; }
private static int[] findSentenceEndTokenIndexes(IntPair[] goldTokCharOffsets, IntPair[] goldSentCharOffsets) { int[] goldSentTokIndexes = new int[goldSentCharOffsets.length]; TIntIntHashMap tokEndCharToIndex = new TIntIntHashMap(); for (int index = 0; index < goldTokCharOffsets.length; ++index) tokEndCharToIndex.put(goldTokCharOffsets[index].getSecond(), index); for (int index = 0; index < goldSentCharOffsets.length; ++index) { int sentEndCharOffset = goldSentCharOffsets[index].getSecond(); if (!tokEndCharToIndex.containsKey(sentEndCharOffset)) { throw new IllegalArgumentException("saw gold sent end char offset '" + sentEndCharOffset + "' but there was no corresponding gold tok end offset."); } goldSentTokIndexes[index] = tokEndCharToIndex.get(sentEndCharOffset); } return goldSentTokIndexes; }