java.lang.Object org.apache.mahout.math.PersistentObject org.apache.mahout.math.set.AbstractSet
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
OpenHashSet, OpenHashMap
Field Summary  

protected int  distinct  The number of distinct associations in the map; its "size()". 
protected int  lowWaterMark  The table capacity c=table.length always satisfies the invariant c * minLoadFactor <= s <= c * maxLoadFactor, where s=size() is the number of associations currently contained. The term "c * minLoadFactor" is called the "lowWaterMark", "c * maxLoadFactor" is called the "highWaterMark". In other words, the table capacity (and proportionally the memory used by this class) oscillates within these constraints. The terms are precomputed and cached to avoid recalculating them each time put(..) or removeKey(...) is called. 
protected int  highWaterMark  
protected double  minLoadFactor  The minimum load factor for the hashtable. 
protected double  maxLoadFactor  The maximum load factor for the hashtable. 
public static final int  defaultCapacity  
public static final double  defaultMinLoadFactor  
public static final double  defaultMaxLoadFactor 
Method from org.apache.mahout.math.set.AbstractSet Summary: 

chooseGrowCapacity, chooseHighWaterMark, chooseLowWaterMark, chooseMeanCapacity, chooseShrinkCapacity, clear, ensureCapacity, equalsMindTheNull, isEmpty, nextPrime, setUp, size, trimToSize 
Methods from org.apache.mahout.math.PersistentObject: 

clone 
Methods from java.lang.Object: 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Method from org.apache.mahout.math.set.AbstractSet Detail: 

protected int chooseGrowCapacity(int size, double minLoad, double maxLoad){ return nextPrime(Math.max(size + 1, (int) ((4 * size / (3 * minLoad + maxLoad))))); }

protected int chooseHighWaterMark(int capacity, double maxLoad){ return Math.min(capacity  2, (int) (capacity * maxLoad)); //makes sure there is always at least one FREE slot }

protected int chooseLowWaterMark(int capacity, double minLoad){ return (int) (capacity * minLoad); }

protected int chooseMeanCapacity(int size, double minLoad, double maxLoad){ return nextPrime(Math.max(size + 1, (int) ((2 * size / (minLoad + maxLoad))))); }

protected int chooseShrinkCapacity(int size, double minLoad, double maxLoad){ return nextPrime(Math.max(size + 1, (int) ((4 * size / (minLoad + 3 * maxLoad))))); }

abstract public void clear()

public void ensureCapacity(int minCapacity){ }
This method never need be called; it is for performance tuning only. Calling this method before put()ing a large number of associations boosts performance, because the receiver will grow only once instead of potentially many times. This default implementation does nothing. Override this method if necessary. 
protected static boolean equalsMindTheNull(Object a, Object b){ if (a == null && b == null) { return true; } if (a == null  b == null) { return false; } return a.equals(b); } 
public boolean isEmpty(){ return distinct == 0; }

protected int nextPrime(int desiredCapacity){ return PrimeFinder.nextPrime(desiredCapacity); }
>= desiredCapacity and very close to desiredCapacity
(within 11% if desiredCapacity >= 1000 ). 
protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor){ if (initialCapacity < 0) { throw new IllegalArgumentException("Initial Capacity must not be less than zero: " + initialCapacity); } if (minLoadFactor < 0.0  minLoadFactor >= 1.0) { throw new IllegalArgumentException("Illegal minLoadFactor: " + minLoadFactor); } if (maxLoadFactor < = 0.0  maxLoadFactor >= 1.0) { throw new IllegalArgumentException("Illegal maxLoadFactor: " + maxLoadFactor); } if (minLoadFactor >= maxLoadFactor) { throw new IllegalArgumentException( "Illegal minLoadFactor: " + minLoadFactor + " and maxLoadFactor: " + maxLoadFactor); } }

public int size(){ return distinct; }

public void trimToSize(){ }
This default implementation does nothing. Override this method if necessary. 