public int get( long key ) { synchronized( mutex ) { return m.get( key ); } }
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Integer get( Object key ) { long k; if ( key != null ) { if ( key instanceof Long ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } int v = _map.get( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( ! ( other instanceof TLongIntMap ) ) { return false; } TLongIntMap that = ( TLongIntMap ) other; if ( that.size() != this.size() ) { return false; } int[] values = _values; byte[] states = _states; int this_no_entry_value = getNoEntryValue(); int that_no_entry_value = that.getNoEntryValue(); for ( int i = values.length; i-- > 0; ) { if ( states[i] == FULL ) { long key = _set[i]; int that_value = that.get( key ); int this_value = values[i]; if ( ( this_value != that_value ) && ( this_value != this_no_entry_value ) && ( that_value != that_no_entry_value ) ) { return false; } } } return true; }
public int get( long key) { return m.get( key ); }
public int get( long key ) { synchronized( mutex ) { return m.get( key ); } }
@Override public int get( long key ) { synchronized( mutex ) { return m.get( key ); } }
public int get( long key) { return m.get( key ); }
/** * Returns the number of times the specified pair of objects has been seen * by this counter. */ public int getCount(Pair<T> obj) { // REMINDER: check for indexing? return counts.get(getIndex(obj)); }
/** * Returns the number of times the specified pair of objects has been seen * by this counter. */ public int getCount(T x, T y) { // REMINDER: check for indexing? return counts.get(getIndex(x, y)); }
@Override public int getIndexForKey(Long key) { final int index = indexMap.get(key); if (index < 0) { throw new IndexException("No match for key in index: " + key); } else { return index; } }
/** * Returns the number of times the specified pair of objects has been seen * by this counter. */ public int getCount(Pair<T> obj) { // REMINDER: check for indexing? return counts.get(getIndex(obj)); }
/** * Returns the number of times the specified pair of objects has been seen * by this counter. */ public int getCount(T x, T y) { // REMINDER: check for indexing? return counts.get(getIndex(x, y)); }
public int getUnigramCount(String bigram) { return unigramCounts.get(getHash(bigram)); }
/** * Counts the pair of objects, increasing its total count by 1. */ public int count(T x, T y) { long index = getIndex(x, y); int count = counts.get(index); count++; counts.put(index, count); sum++; return count; }
/** * Counts the pair of objects, increasing its total count by 1. */ public int count(Pair<T> obj) { long index = getIndex(obj); int count = counts.get(index); count++; counts.put(index, count); sum++; return count; }
/** * Counts the pair of objects, increasing its total count by 1. */ public int count(Pair<T> obj) { long index = getIndex(obj); int count = counts.get(index); count++; counts.put(index, count); sum++; return count; }
@Override public final int getIndexForKey(T key) { final long code = coding.getCode(key); final int index = indexMap.get(code); if (index < 0) { throw new IndexException("No match for key in index: " + key); } else { return index; } }
/** * Counts the pair of objects, increasing its total count by 1. */ public int count(T x, T y) { long index = getIndex(x, y); int count = counts.get(index); count++; counts.put(index, count); sum++; return count; }
@Override() public final void forEachEntry(IndexConsumer<Long> consumer) { final int size = size(); for (int i=0; i<size; ++i) { final Long key = keyArray().getValue(i); final int index = indexMap.get(key); consumer.accept(key, index); } }
@Override() public final void forEachEntry(IndexConsumer<T> consumer) { final int size = size(); for (int i=0; i<size; ++i) { final T key = keyArray().getValue(i); final long code = coding.getCode(key); final int index = indexMap.get(code); consumer.accept(key, index); } }