Java 类gnu.trove.map.TLongLongMap 实例源码

项目:xcc    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:HCFCore    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:HCFCore    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:trove-3.0.3    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:easyrec_major    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:recalot.com    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:UnsafeAdapter    文件:UnsafeTLongLongHashMap.java   
/**
     * Creates a new <code>UnsafeTLongLongHashMap</code> instance containing
     * all of the entries in the map passed in.
     *
     * @param map a <tt>TLongLongMap</tt> that will be duplicated.
     */
    public UnsafeTLongLongHashMap( TLongLongMap map ) {
        super( map.size() );
        if ( map instanceof UnsafeTLongLongHashMap ) {
            UnsafeTLongLongHashMap hashmap = ( UnsafeTLongLongHashMap ) map;
            this._loadFactor = hashmap._loadFactor;
            this.no_entry_key = hashmap.no_entry_key;
            this.no_entry_value = hashmap.no_entry_value;
            //noinspection RedundantCast
            if ( this.no_entry_key != ( long ) 0 ) {
//                Arrays.fill( _set, this.no_entry_key );
                Arraysfill( keyAddresses[0][0], this.no_entry_key );
            }
            //noinspection RedundantCast
            if ( this.no_entry_value != ( long ) 0 ) {
//                Arrays.fill( _values, this.no_entry_value );
                Arraysfill( addresses[0][0], this.no_entry_key );
            }
            setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
        }
        putAll( map );
    }
项目:easyrec-PoC    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:easyrec    文件:TLongLongHashMap.java   
/**
 * Creates a new <code>TLongLongHashMap</code> instance containing
 * all of the entries in the map passed in.
 *
 * @param map a <tt>TLongLongMap</tt> that will be duplicated.
 */
public TLongLongHashMap( TLongLongMap map ) {
    super( map.size() );
    if ( map instanceof TLongLongHashMap ) {
        TLongLongHashMap hashmap = ( TLongLongHashMap ) map;
        this._loadFactor = hashmap._loadFactor;
        this.no_entry_key = hashmap.no_entry_key;
        this.no_entry_value = hashmap.no_entry_value;
        //noinspection RedundantCast
        if ( this.no_entry_key != ( long ) 0 ) {
            Arrays.fill( _set, this.no_entry_key );
        }
        //noinspection RedundantCast
        if ( this.no_entry_value != ( long ) 0 ) {
            Arrays.fill( _values, this.no_entry_value );
        }
        setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
    }
    putAll( map );
}
项目:xcc    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:xcc    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:xcc    文件:TLongLongMapDecorator.java   
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:HCFCore    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:HCFCore    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:HCFCore    文件:TLongLongMapDecorator.java   
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:HCFCore    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:HCFCore    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:HCFCore    文件:TLongLongMapDecorator.java   
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:trove-3.0.3    文件:TLongLongOffheapHashMap.java   
/** {@inheritDoc} */
@Override
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:trove-3.0.3    文件:TLongLongOffheapHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    TLongOffheapArray values = _values;
    TByteOffheapArray states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = capacity(); i-- > 0; ) {
        if ( states.get( i ) == FULL ) {
            long key = _set.get( i );
            long that_value = that.get( key );
            long this_value = values.get( i );
            if ( ( this_value != that_value ) &&
                 ( this_value != this_no_entry_value ) &&
                 ( that_value != that_no_entry_value ) ) {
                return false;
            }
        }
    }
    return true;
}
项目:trove-3.0.3    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:trove-3.0.3    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:trove-3.0.3    文件:TLongLongMapDecorator.java   
@Override
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:easyrec_major    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:easyrec_major    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:easyrec_major    文件:TLongLongMapDecorator.java   
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:recalot.com    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:recalot.com    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:recalot.com    文件:TLongLongMapDecorator.java   
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:UnsafeAdapter    文件:UnsafeTLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:UnsafeAdapter    文件:UnsafeTLongLongHashMap.java   
/** {@inheritDoc} */
    @Override
    public boolean equals( Object other ) {
        if ( ! ( other instanceof TLongLongMap ) ) {
            return false;
        }
        TLongLongMap that = ( TLongLongMap ) other;
        if ( that.size() != this.size() ) {
            return false;
        }
//        long[] values = _values;
//        byte[] states = _states;
        long this_no_entry_value = getNoEntryValue();
        long that_no_entry_value = that.getNoEntryValue();
        final int len = unsafe.getInt(addresses[0][0]);
        for ( int i = len; i-- > 0; ) {
            if ( stateAt(i) == FULL ) {
                long key = keyAt(i);
                long that_value = that.get( key );
                long this_value = valueAt(i);
                if ( ( this_value != that_value ) &&
                     ( this_value != this_no_entry_value ) &&
                     ( that_value != that_no_entry_value ) ) {
                    return false;
                }
            }
        }
        return true;
    }
项目:easyrec-PoC    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:easyrec-PoC    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:easyrec-PoC    文件:TLongLongMapDecorator.java   
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:easyrec    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
public void putAll( TLongLongMap map ) {
    ensureCapacity( map.size() );
    TLongLongIterator iter = map.iterator();
    while ( iter.hasNext() ) {
        iter.advance();
        this.put( iter.key(), iter.value() );
    }
}
项目:easyrec    文件:TLongLongHashMap.java   
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongLongMap ) ) {
        return false;
    }
    TLongLongMap that = ( TLongLongMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    long[] values = _values;
    byte[] states = _states;
    long this_no_entry_value = getNoEntryValue();
    long that_no_entry_value = that.getNoEntryValue();
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            long key = _set[i];
            long that_value = that.get( key );
            long 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;
}
项目:easyrec    文件:TLongLongMapDecorator.java   
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // MAP
    _map = ( TLongLongMap ) in.readObject();
}
项目:SketchOnStorm    文件:CMSTest.java   
@Test
    public void testHeavyHitters() {
        double epsOfTotalCount = 0.0001;
        double confidence = 0.99;
        int seed = 7364181;
        CountMinSketch sketch = new CountMinSketch(epsOfTotalCount, confidence, seed);

        int maxItems = 1000;
        Random random = new Random();
        TLongLongMap actualItemCount = new TLongLongHashMap(maxItems);

        random.setSeed(12102);
        for (int i = 0; i < maxItems; i++) {
            int itemCount = random.nextInt(20000);
            sketch.add(i, itemCount);
            actualItemCount.put(i, itemCount);
        }

        List<Item> itemsBagFromSketch = new ArrayList<Item>();
        List<Item> itemsBagActual = new ArrayList<Item>();

        for (int i = 0; i < maxItems; i++) {
            itemsBagFromSketch.add(new Item(i, sketch.estimateCount(i)));
            itemsBagActual.add(new Item(i, actualItemCount.get(i)));
        }

        Ordering<Item> ordering = new Ordering<Item>() {

            @Override
            public int compare(Item me, Item other) {
                return Long.compare(me.count, other.count);
            }
        };

        List<Item> topKItemsEstimated = ordering.greatestOf(itemsBagFromSketch, 5);
        List<Item> topKItemsActual = ordering.greatestOf(itemsBagActual, 5);
/*

        System.out.println("Top 5 estimated items");
        for (Item  item : topKItemsEstimated) {
            System.out.println(item);
        }
*/
/*
        System.out.println("Top 5 actual");*/
        for (int i = 0; i < topKItemsActual.size(); i++) {
            assertEquals(true, topKItemsActual.get(i).checkForEquality(topKItemsEstimated.get(i)));
        }
    }
项目:pre-cu    文件:AutoDeltaLongLongMap.java   
public TLongLongMap getMap() {
    return container;
}
项目:xcc    文件:TLongLongMapDecorator.java   
/**
 * Creates a wrapper that decorates the specified primitive map.
 *
 * @param map the <tt>TLongLongMap</tt> to wrap.
 */
public TLongLongMapDecorator( TLongLongMap map ) {
    super();
    this._map = map;
}