## 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

Constructor Summary
`FastIDSet()` Creates a new `FastIDSet` with default capacity.
`FastIDSet(int size)`
`FastIDSet(int size, float loadFactor)`
`FastIDSet(long[] initialKeys)`

Method Summary
`boolean` `add(long key)`
`boolean` `addAll(FastIDSet c)`
`boolean` `addAll(long[] c)`
`void` `clear()`
`FastIDSet` `clone()`
`boolean` `contains(long key)`
`boolean` `equals(Object other)`
`int` `hashCode()`
`int` `intersectionSize(FastIDSet other)` Convenience method to quickly compute just the size of the intersection with another `FastIDSet`.
`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()`
`String` `toString()`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### 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)

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()

  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.