org.apache.mahout.cf.taste.impl.common
Class FastIDSet
java.lang.Object
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
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
FastIDSet
public FastIDSet()
- Creates a new with default capacity.
FastIDSet
public FastIDSet(int size)
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.