org.apache.mahout.cf.taste.impl.common
Class FastIDSet
java.lang.Object
org.apache.mahout.cf.taste.impl.common.FastIDSet
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<Long>
public final class FastIDSet
- extends Object
- implements Serializable, Cloneable, Iterable<Long>
- See Also:
FastByIDMap
,
Serialized Form
FastIDSet
public FastIDSet()
- Creates a new
FastIDSet
with default capacity.
FastIDSet
public FastIDSet(long[] initialKeys)
FastIDSet
public FastIDSet(int size)
FastIDSet
public FastIDSet(int size,
float loadFactor)
size
public int size()
isEmpty
public boolean isEmpty()
contains
public boolean contains(long key)
add
public boolean add(long key)
iterator
public LongPrimitiveIterator iterator()
- Specified by:
iterator
in interface Iterable<Long>
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
FastIDSet
.
- Parameters:
other
- FastIDSet
to intersect with
- Returns:
- number of elements in intersection
clone
public FastIDSet clone()
- Overrides:
clone
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object other)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.