org.apache.mahout.cf.taste.impl.common
Class FastIDSet

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.common.FastIDSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public final class FastIDSet
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

See Also:
FastByIDMap, Serialized Form

Constructor Summary
FastIDSet()
          Creates a new with default capacity.
FastIDSet(int size)
           
 
Method Summary
 boolean add(long key)
           
 boolean addAll(FastIDSet c)
           
 boolean addAll(long[] c)
           
 void clear()
           
 FastIDSet clone()
           
 boolean contains(long key)
           
 boolean equals(java.lang.Object other)
           
 int hashCode()
           
 int intersectionSize(FastIDSet other)
          Convenience method to quickly compute just the size of the intersection with another .
 boolean isEmpty()
           
 LongPrimitiveIterator iterator()
           
 void rehash()
           
 boolean remove(long key)
           
 boolean removeAll(FastIDSet c)
           
 boolean removeAll(long[] c)
           
 boolean retainAll(FastIDSet c)
           
 int size()
           
 long[] toArray()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FastIDSet

public FastIDSet()
Creates a new with default capacity.


FastIDSet

public FastIDSet(int size)
Method Detail

size

public int size()

isEmpty

public boolean isEmpty()

contains

public boolean contains(long key)

add

public boolean add(long key)

iterator

public LongPrimitiveIterator iterator()

toArray

public long[] toArray()

remove

public boolean remove(long key)

addAll

public boolean addAll(long[] c)

addAll

public boolean addAll(FastIDSet c)

removeAll

public boolean removeAll(long[] c)

removeAll

public boolean removeAll(FastIDSet c)

retainAll

public boolean retainAll(FastIDSet c)

clear

public void clear()

rehash

public void rehash()

intersectionSize

public int intersectionSize(FastIDSet other)
Convenience method to quickly compute just the size of the intersection with another .

Parameters:
other - to intersect with
Returns:
number of elements in intersection

clone

public FastIDSet clone()
Overrides:
clone in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.