double value
- * @return true if the collection contains the specified element.
- */
- boolean contains( double entry );
-
-
- /**
- * Creates an iterator over the values of the collection. The iterator
- * supports element deletion.
- *
- * @return an TDoubleIterator value
- */
- TDoubleIterator iterator();
-
-
- /**
- * Returns an array containing all of the elements in this collection.
- * If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the
- * elements in the same order.
- *
- * The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *
This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - double[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *
If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *
If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *
If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the elements
- * in the same order.
- *
- * @param dest the array into which the elements of this collection are to be
- * stored.
- * @return an double[] containing all the elements in this collection
- * @throws NullPointerException if the specified array is null
- */
- double[] toArray( double[] dest );
-
-
- /**
- * Inserts a value into the collection.
- *
- * @param entry a double value
- * @return true if the collection was modified by the add operation
- */
- boolean add( double entry );
-
-
- /**
- * Removes entry from the collection.
- *
- * @param entry an double value
- * @return true if the collection was modified by the remove operation.
- */
- boolean remove( double entry );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * collection are present.
- *
- * @param collection a Collection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( Collection> collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * TDoubleCollection are present.
- *
- * @param collection a TDoubleCollection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( TDoubleCollection collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * array are present.
- *
- * @param array as array of double primitives.
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( double[] array );
-
-
- /**
- * Adds all of the elements in collection to the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( Collection extends Double> collection );
-
-
- /**
- * Adds all of the elements in the TDoubleCollection to the collection.
- *
- * @param collection a TDoubleCollection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( TDoubleCollection collection );
-
-
- /**
- * Adds all of the elements in the array to the collection.
- *
- * @param array a array of double primitives.
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( double[] array );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( Collection> collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * TDoubleCollection.
- *
- * @param collection a TDoubleCollection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( TDoubleCollection collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * array.
- *
- * @param array an array of double primitives.
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( double[] array );
-
-
- /**
- * Removes all of the elements in collection from the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( Collection> collection );
-
-
- /**
- * Removes all of the elements in TDoubleCollection from the collection.
- *
- * @param collection a TDoubleCollection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( TDoubleCollection collection );
-
-
- /**
- * Removes all of the elements in array from the collection.
- *
- * @param array an array of double primitives.
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( double[] array );
-
-
- /**
- * Empties the collection.
- */
- void clear();
-
-
- /**
- * Executes procedure for each element in the collection.
- *
- * @param procedure a TDoubleProcedure value
- * @return false if the loop over the collection terminated because
- * the procedure returned false for some value.
- */
- boolean forEach( TDoubleProcedure procedure );
-
-
- // Comparison and hashing
-
- /**
- * Compares the specified object with this collection for equality. Returns
- * true if the specified object is also a collection, the two collection
- * have the same size, and every member of the specified collection is
- * contained in this collection (or equivalently, every member of this collection is
- * contained in the specified collection). This definition ensures that the
- * equals method works properly across different implementations of the
- * collection interface.
- *
- * @param o object to be compared for equality with this collection
- * @return true if the specified object is equal to this collection
- */
- boolean equals( Object o );
-
-
- /**
- * Returns the hash code value for this collection. The hash code of a collection is
- * defined to be the sum of the hash codes of the elements in the collection.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two collection s1
- * and s2, as required by the general contract of
- * {@link Object#hashCode}.
- *
- * @return the hash code value for this collection
- * @see Object#equals(Object)
- * @see Collection#equals(Object)
- */
- int hashCode();
-
-
-} // TDoubleCollection
diff --git a/src/gnu/trove/TFloatCollection.java b/src/gnu/trove/TFloatCollection.java
deleted file mode 100644
index 7117d06..0000000
--- a/src/gnu/trove/TFloatCollection.java
+++ /dev/null
@@ -1,316 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-import gnu.trove.iterator.TFloatIterator;
-import gnu.trove.procedure.TFloatProcedure;
-
-import java.util.Collection;
-import java.io.Serializable;
-
-/**
- * An interface that mimics the Collection interface.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $
- */
-
-public interface TFloatCollection extends Serializable {
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- float getNoEntryValue();
-
-
- /**
- * Returns the number of elements in this collection (its cardinality). If this
- * collection contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
- *
- * @return the number of elements in this collection (its cardinality)
- */
- int size();
-
-
- /**
- * Returns true if this collection contains no elements.
- *
- * @return true if this collection contains no elements
- */
- boolean isEmpty();
-
-
- /**
- * Returns true if this collection contains the specified element.
- *
- * @param entry an float value
- * @return true if the collection contains the specified element.
- */
- boolean contains( float entry );
-
-
- /**
- * Creates an iterator over the values of the collection. The iterator
- * supports element deletion.
- *
- * @return an TFloatIterator value
- */
- TFloatIterator iterator();
-
-
- /**
- * Returns an array containing all of the elements in this collection.
- * If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the
- * elements in the same order.
- *
- *
The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *
This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - float[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *
If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *
If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *
If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the elements
- * in the same order.
- *
- * @param dest the array into which the elements of this collection are to be
- * stored.
- * @return an float[] containing all the elements in this collection
- * @throws NullPointerException if the specified array is null
- */
- float[] toArray( float[] dest );
-
-
- /**
- * Inserts a value into the collection.
- *
- * @param entry a float value
- * @return true if the collection was modified by the add operation
- */
- boolean add( float entry );
-
-
- /**
- * Removes entry from the collection.
- *
- * @param entry an float value
- * @return true if the collection was modified by the remove operation.
- */
- boolean remove( float entry );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * collection are present.
- *
- * @param collection a Collection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( Collection> collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * TFloatCollection are present.
- *
- * @param collection a TFloatCollection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( TFloatCollection collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * array are present.
- *
- * @param array as array of float primitives.
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( float[] array );
-
-
- /**
- * Adds all of the elements in collection to the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( Collection extends Float> collection );
-
-
- /**
- * Adds all of the elements in the TFloatCollection to the collection.
- *
- * @param collection a TFloatCollection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( TFloatCollection collection );
-
-
- /**
- * Adds all of the elements in the array to the collection.
- *
- * @param array a array of float primitives.
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( float[] array );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( Collection> collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * TFloatCollection.
- *
- * @param collection a TFloatCollection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( TFloatCollection collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * array.
- *
- * @param array an array of float primitives.
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( float[] array );
-
-
- /**
- * Removes all of the elements in collection from the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( Collection> collection );
-
-
- /**
- * Removes all of the elements in TFloatCollection from the collection.
- *
- * @param collection a TFloatCollection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( TFloatCollection collection );
-
-
- /**
- * Removes all of the elements in array from the collection.
- *
- * @param array an array of float primitives.
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( float[] array );
-
-
- /**
- * Empties the collection.
- */
- void clear();
-
-
- /**
- * Executes procedure for each element in the collection.
- *
- * @param procedure a TFloatProcedure value
- * @return false if the loop over the collection terminated because
- * the procedure returned false for some value.
- */
- boolean forEach( TFloatProcedure procedure );
-
-
- // Comparison and hashing
-
- /**
- * Compares the specified object with this collection for equality. Returns
- * true if the specified object is also a collection, the two collection
- * have the same size, and every member of the specified collection is
- * contained in this collection (or equivalently, every member of this collection is
- * contained in the specified collection). This definition ensures that the
- * equals method works properly across different implementations of the
- * collection interface.
- *
- * @param o object to be compared for equality with this collection
- * @return true if the specified object is equal to this collection
- */
- boolean equals( Object o );
-
-
- /**
- * Returns the hash code value for this collection. The hash code of a collection is
- * defined to be the sum of the hash codes of the elements in the collection.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two collection s1
- * and s2, as required by the general contract of
- * {@link Object#hashCode}.
- *
- * @return the hash code value for this collection
- * @see Object#equals(Object)
- * @see Collection#equals(Object)
- */
- int hashCode();
-
-
-} // TFloatCollection
diff --git a/src/gnu/trove/TIntCollection.java b/src/gnu/trove/TIntCollection.java
deleted file mode 100644
index 4b71cc2..0000000
--- a/src/gnu/trove/TIntCollection.java
+++ /dev/null
@@ -1,316 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-import gnu.trove.iterator.TIntIterator;
-import gnu.trove.procedure.TIntProcedure;
-
-import java.util.Collection;
-import java.io.Serializable;
-
-/**
- * An interface that mimics the Collection interface.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $
- */
-
-public interface TIntCollection extends Serializable {
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- int getNoEntryValue();
-
-
- /**
- * Returns the number of elements in this collection (its cardinality). If this
- * collection contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
- *
- * @return the number of elements in this collection (its cardinality)
- */
- int size();
-
-
- /**
- * Returns true if this collection contains no elements.
- *
- * @return true if this collection contains no elements
- */
- boolean isEmpty();
-
-
- /**
- * Returns true if this collection contains the specified element.
- *
- * @param entry an int value
- * @return true if the collection contains the specified element.
- */
- boolean contains( int entry );
-
-
- /**
- * Creates an iterator over the values of the collection. The iterator
- * supports element deletion.
- *
- * @return an TIntIterator value
- */
- TIntIterator iterator();
-
-
- /**
- * Returns an array containing all of the elements in this collection.
- * If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the
- * elements in the same order.
- *
- *
The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *
This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - int[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *
If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *
If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *
If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the elements
- * in the same order.
- *
- * @param dest the array into which the elements of this collection are to be
- * stored.
- * @return an int[] containing all the elements in this collection
- * @throws NullPointerException if the specified array is null
- */
- int[] toArray( int[] dest );
-
-
- /**
- * Inserts a value into the collection.
- *
- * @param entry a int value
- * @return true if the collection was modified by the add operation
- */
- boolean add( int entry );
-
-
- /**
- * Removes entry from the collection.
- *
- * @param entry an int value
- * @return true if the collection was modified by the remove operation.
- */
- boolean remove( int entry );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * collection are present.
- *
- * @param collection a Collection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( Collection> collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * TIntCollection are present.
- *
- * @param collection a TIntCollection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( TIntCollection collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * array are present.
- *
- * @param array as array of int primitives.
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( int[] array );
-
-
- /**
- * Adds all of the elements in collection to the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( Collection extends Integer> collection );
-
-
- /**
- * Adds all of the elements in the TIntCollection to the collection.
- *
- * @param collection a TIntCollection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( TIntCollection collection );
-
-
- /**
- * Adds all of the elements in the array to the collection.
- *
- * @param array a array of int primitives.
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( int[] array );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( Collection> collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * TIntCollection.
- *
- * @param collection a TIntCollection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( TIntCollection collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * array.
- *
- * @param array an array of int primitives.
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( int[] array );
-
-
- /**
- * Removes all of the elements in collection from the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( Collection> collection );
-
-
- /**
- * Removes all of the elements in TIntCollection from the collection.
- *
- * @param collection a TIntCollection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( TIntCollection collection );
-
-
- /**
- * Removes all of the elements in array from the collection.
- *
- * @param array an array of int primitives.
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( int[] array );
-
-
- /**
- * Empties the collection.
- */
- void clear();
-
-
- /**
- * Executes procedure for each element in the collection.
- *
- * @param procedure a TIntProcedure value
- * @return false if the loop over the collection terminated because
- * the procedure returned false for some value.
- */
- boolean forEach( TIntProcedure procedure );
-
-
- // Comparison and hashing
-
- /**
- * Compares the specified object with this collection for equality. Returns
- * true if the specified object is also a collection, the two collection
- * have the same size, and every member of the specified collection is
- * contained in this collection (or equivalently, every member of this collection is
- * contained in the specified collection). This definition ensures that the
- * equals method works properly across different implementations of the
- * collection interface.
- *
- * @param o object to be compared for equality with this collection
- * @return true if the specified object is equal to this collection
- */
- boolean equals( Object o );
-
-
- /**
- * Returns the hash code value for this collection. The hash code of a collection is
- * defined to be the sum of the hash codes of the elements in the collection.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two collection s1
- * and s2, as required by the general contract of
- * {@link Object#hashCode}.
- *
- * @return the hash code value for this collection
- * @see Object#equals(Object)
- * @see Collection#equals(Object)
- */
- int hashCode();
-
-
-} // TIntCollection
diff --git a/src/gnu/trove/TLongCollection.java b/src/gnu/trove/TLongCollection.java
deleted file mode 100644
index d169391..0000000
--- a/src/gnu/trove/TLongCollection.java
+++ /dev/null
@@ -1,316 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-import gnu.trove.iterator.TLongIterator;
-import gnu.trove.procedure.TLongProcedure;
-
-import java.util.Collection;
-import java.io.Serializable;
-
-/**
- * An interface that mimics the Collection interface.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $
- */
-
-public interface TLongCollection extends Serializable {
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- long getNoEntryValue();
-
-
- /**
- * Returns the number of elements in this collection (its cardinality). If this
- * collection contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
- *
- * @return the number of elements in this collection (its cardinality)
- */
- int size();
-
-
- /**
- * Returns true if this collection contains no elements.
- *
- * @return true if this collection contains no elements
- */
- boolean isEmpty();
-
-
- /**
- * Returns true if this collection contains the specified element.
- *
- * @param entry an long value
- * @return true if the collection contains the specified element.
- */
- boolean contains( long entry );
-
-
- /**
- * Creates an iterator over the values of the collection. The iterator
- * supports element deletion.
- *
- * @return an TLongIterator value
- */
- TLongIterator iterator();
-
-
- /**
- * Returns an array containing all of the elements in this collection.
- * If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the
- * elements in the same order.
- *
- *
The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *
This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - long[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *
If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *
If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *
If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the elements
- * in the same order.
- *
- * @param dest the array into which the elements of this collection are to be
- * stored.
- * @return an long[] containing all the elements in this collection
- * @throws NullPointerException if the specified array is null
- */
- long[] toArray( long[] dest );
-
-
- /**
- * Inserts a value into the collection.
- *
- * @param entry a long value
- * @return true if the collection was modified by the add operation
- */
- boolean add( long entry );
-
-
- /**
- * Removes entry from the collection.
- *
- * @param entry an long value
- * @return true if the collection was modified by the remove operation.
- */
- boolean remove( long entry );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * collection are present.
- *
- * @param collection a Collection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( Collection> collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * TLongCollection are present.
- *
- * @param collection a TLongCollection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( TLongCollection collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * array are present.
- *
- * @param array as array of long primitives.
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( long[] array );
-
-
- /**
- * Adds all of the elements in collection to the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( Collection extends Long> collection );
-
-
- /**
- * Adds all of the elements in the TLongCollection to the collection.
- *
- * @param collection a TLongCollection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( TLongCollection collection );
-
-
- /**
- * Adds all of the elements in the array to the collection.
- *
- * @param array a array of long primitives.
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( long[] array );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( Collection> collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * TLongCollection.
- *
- * @param collection a TLongCollection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( TLongCollection collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * array.
- *
- * @param array an array of long primitives.
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( long[] array );
-
-
- /**
- * Removes all of the elements in collection from the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( Collection> collection );
-
-
- /**
- * Removes all of the elements in TLongCollection from the collection.
- *
- * @param collection a TLongCollection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( TLongCollection collection );
-
-
- /**
- * Removes all of the elements in array from the collection.
- *
- * @param array an array of long primitives.
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( long[] array );
-
-
- /**
- * Empties the collection.
- */
- void clear();
-
-
- /**
- * Executes procedure for each element in the collection.
- *
- * @param procedure a TLongProcedure value
- * @return false if the loop over the collection terminated because
- * the procedure returned false for some value.
- */
- boolean forEach( TLongProcedure procedure );
-
-
- // Comparison and hashing
-
- /**
- * Compares the specified object with this collection for equality. Returns
- * true if the specified object is also a collection, the two collection
- * have the same size, and every member of the specified collection is
- * contained in this collection (or equivalently, every member of this collection is
- * contained in the specified collection). This definition ensures that the
- * equals method works properly across different implementations of the
- * collection interface.
- *
- * @param o object to be compared for equality with this collection
- * @return true if the specified object is equal to this collection
- */
- boolean equals( Object o );
-
-
- /**
- * Returns the hash code value for this collection. The hash code of a collection is
- * defined to be the sum of the hash codes of the elements in the collection.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two collection s1
- * and s2, as required by the general contract of
- * {@link Object#hashCode}.
- *
- * @return the hash code value for this collection
- * @see Object#equals(Object)
- * @see Collection#equals(Object)
- */
- int hashCode();
-
-
-} // TLongCollection
diff --git a/src/gnu/trove/TShortCollection.java b/src/gnu/trove/TShortCollection.java
deleted file mode 100644
index b19506c..0000000
--- a/src/gnu/trove/TShortCollection.java
+++ /dev/null
@@ -1,316 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-import gnu.trove.iterator.TShortIterator;
-import gnu.trove.procedure.TShortProcedure;
-
-import java.util.Collection;
-import java.io.Serializable;
-
-/**
- * An interface that mimics the Collection interface.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $
- */
-
-public interface TShortCollection extends Serializable {
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- short getNoEntryValue();
-
-
- /**
- * Returns the number of elements in this collection (its cardinality). If this
- * collection contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
- *
- * @return the number of elements in this collection (its cardinality)
- */
- int size();
-
-
- /**
- * Returns true if this collection contains no elements.
- *
- * @return true if this collection contains no elements
- */
- boolean isEmpty();
-
-
- /**
- * Returns true if this collection contains the specified element.
- *
- * @param entry an short value
- * @return true if the collection contains the specified element.
- */
- boolean contains( short entry );
-
-
- /**
- * Creates an iterator over the values of the collection. The iterator
- * supports element deletion.
- *
- * @return an TShortIterator value
- */
- TShortIterator iterator();
-
-
- /**
- * Returns an array containing all of the elements in this collection.
- * If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the
- * elements in the same order.
- *
- *
The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *
This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - short[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *
If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *
If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *
If this collection makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the elements
- * in the same order.
- *
- * @param dest the array into which the elements of this collection are to be
- * stored.
- * @return an short[] containing all the elements in this collection
- * @throws NullPointerException if the specified array is null
- */
- short[] toArray( short[] dest );
-
-
- /**
- * Inserts a value into the collection.
- *
- * @param entry a short value
- * @return true if the collection was modified by the add operation
- */
- boolean add( short entry );
-
-
- /**
- * Removes entry from the collection.
- *
- * @param entry an short value
- * @return true if the collection was modified by the remove operation.
- */
- boolean remove( short entry );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * collection are present.
- *
- * @param collection a Collection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( Collection> collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * TShortCollection are present.
- *
- * @param collection a TShortCollection value
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( TShortCollection collection );
-
-
- /**
- * Tests the collection to determine if all of the elements in
- * array are present.
- *
- * @param array as array of short primitives.
- * @return true if all elements were present in the collection.
- */
- boolean containsAll( short[] array );
-
-
- /**
- * Adds all of the elements in collection to the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( Collection extends Short> collection );
-
-
- /**
- * Adds all of the elements in the TShortCollection to the collection.
- *
- * @param collection a TShortCollection value
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( TShortCollection collection );
-
-
- /**
- * Adds all of the elements in the array to the collection.
- *
- * @param array a array of short primitives.
- * @return true if the collection was modified by the add all operation.
- */
- boolean addAll( short[] array );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( Collection> collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * TShortCollection.
- *
- * @param collection a TShortCollection value
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( TShortCollection collection );
-
-
- /**
- * Removes any values in the collection which are not contained in
- * array.
- *
- * @param array an array of short primitives.
- * @return true if the collection was modified by the retain all operation
- */
- boolean retainAll( short[] array );
-
-
- /**
- * Removes all of the elements in collection from the collection.
- *
- * @param collection a Collection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( Collection> collection );
-
-
- /**
- * Removes all of the elements in TShortCollection from the collection.
- *
- * @param collection a TShortCollection value
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( TShortCollection collection );
-
-
- /**
- * Removes all of the elements in array from the collection.
- *
- * @param array an array of short primitives.
- * @return true if the collection was modified by the remove all operation.
- */
- boolean removeAll( short[] array );
-
-
- /**
- * Empties the collection.
- */
- void clear();
-
-
- /**
- * Executes procedure for each element in the collection.
- *
- * @param procedure a TShortProcedure value
- * @return false if the loop over the collection terminated because
- * the procedure returned false for some value.
- */
- boolean forEach( TShortProcedure procedure );
-
-
- // Comparison and hashing
-
- /**
- * Compares the specified object with this collection for equality. Returns
- * true if the specified object is also a collection, the two collection
- * have the same size, and every member of the specified collection is
- * contained in this collection (or equivalently, every member of this collection is
- * contained in the specified collection). This definition ensures that the
- * equals method works properly across different implementations of the
- * collection interface.
- *
- * @param o object to be compared for equality with this collection
- * @return true if the specified object is equal to this collection
- */
- boolean equals( Object o );
-
-
- /**
- * Returns the hash code value for this collection. The hash code of a collection is
- * defined to be the sum of the hash codes of the elements in the collection.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two collection s1
- * and s2, as required by the general contract of
- * {@link Object#hashCode}.
- *
- * @return the hash code value for this collection
- * @see Object#equals(Object)
- * @see Collection#equals(Object)
- */
- int hashCode();
-
-
-} // TShortCollection
diff --git a/src/gnu/trove/function/TByteFunction.java b/src/gnu/trove/function/TByteFunction.java
deleted file mode 100644
index 1fa50ba..0000000
--- a/src/gnu/trove/function/TByteFunction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for functions that accept and return one byte primitive.
- */
-public interface TByteFunction {
- /**
- * Execute this function with value
- *
- * @param value a byte input
- * @return a byte result
- */
- public byte execute( byte value );
-}
diff --git a/src/gnu/trove/function/TCharFunction.java b/src/gnu/trove/function/TCharFunction.java
deleted file mode 100644
index 8f57b66..0000000
--- a/src/gnu/trove/function/TCharFunction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for functions that accept and return one char primitive.
- */
-public interface TCharFunction {
- /**
- * Execute this function with value
- *
- * @param value a char input
- * @return a char result
- */
- public char execute( char value );
-}
diff --git a/src/gnu/trove/function/TDoubleFunction.java b/src/gnu/trove/function/TDoubleFunction.java
deleted file mode 100644
index d46f5ae..0000000
--- a/src/gnu/trove/function/TDoubleFunction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for functions that accept and return one double primitive.
- */
-public interface TDoubleFunction {
- /**
- * Execute this function with value
- *
- * @param value a double input
- * @return a double result
- */
- public double execute( double value );
-}
diff --git a/src/gnu/trove/function/TFloatFunction.java b/src/gnu/trove/function/TFloatFunction.java
deleted file mode 100644
index 2b72646..0000000
--- a/src/gnu/trove/function/TFloatFunction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for functions that accept and return one float primitive.
- */
-public interface TFloatFunction {
- /**
- * Execute this function with value
- *
- * @param value a float input
- * @return a float result
- */
- public float execute( float value );
-}
diff --git a/src/gnu/trove/function/TIntFunction.java b/src/gnu/trove/function/TIntFunction.java
deleted file mode 100644
index 642eabd..0000000
--- a/src/gnu/trove/function/TIntFunction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for functions that accept and return one int primitive.
- */
-public interface TIntFunction {
- /**
- * Execute this function with value
- *
- * @param value a int input
- * @return a int result
- */
- public int execute( int value );
-}
diff --git a/src/gnu/trove/function/TLongFunction.java b/src/gnu/trove/function/TLongFunction.java
deleted file mode 100644
index 64219cb..0000000
--- a/src/gnu/trove/function/TLongFunction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for functions that accept and return one long primitive.
- */
-public interface TLongFunction {
- /**
- * Execute this function with value
- *
- * @param value a long input
- * @return a long result
- */
- public long execute( long value );
-}
diff --git a/src/gnu/trove/function/TObjectFunction.java b/src/gnu/trove/function/TObjectFunction.java
deleted file mode 100644
index e8873b7..0000000
--- a/src/gnu/trove/function/TObjectFunction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-/**
- * Interface for functions that accept and return one Object reference.
- *
Object input
- * @return an Object result
- */
- public R execute( T value );
-}// TObjectFunction
diff --git a/src/gnu/trove/function/TShortFunction.java b/src/gnu/trove/function/TShortFunction.java
deleted file mode 100644
index ea3c8de..0000000
--- a/src/gnu/trove/function/TShortFunction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.function;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for functions that accept and return one short primitive.
- */
-public interface TShortFunction {
- /**
- * Execute this function with value
- *
- * @param value a short input
- * @return a short result
- */
- public short execute( short value );
-}
diff --git a/src/gnu/trove/impl/Constants.java b/src/gnu/trove/impl/Constants.java
deleted file mode 100644
index 09237a2..0000000
--- a/src/gnu/trove/impl/Constants.java
+++ /dev/null
@@ -1,165 +0,0 @@
-// ////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// ////////////////////////////////////////////////////////////////////////////
-package gnu.trove.impl;
-
-/**
- * Central location for constants needed by various implementations.
- */
-public class Constants {
-
- private static final boolean VERBOSE =
- System.getProperty( "gnu.trove.verbose", null ) != null;
-
- /** the default capacity for new collections */
- public static final int DEFAULT_CAPACITY = 10;
-
- /** the load above which rehashing occurs. */
- public static final float DEFAULT_LOAD_FACTOR = 0.5f;
-
-
- /** the default value that represents for byte types. */
- public static final byte DEFAULT_BYTE_NO_ENTRY_VALUE;
- static {
- byte value;
- String property = System.getProperty( "gnu.trove.no_entry.byte", "0" );
- if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Byte.MAX_VALUE;
- else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Byte.MIN_VALUE;
- else value = Byte.valueOf( property );
-
- if ( value > Byte.MAX_VALUE ) value = Byte.MAX_VALUE;
- else if ( value < Byte.MIN_VALUE ) value = Byte.MIN_VALUE;
- DEFAULT_BYTE_NO_ENTRY_VALUE = value;
- if ( VERBOSE ) {
- System.out.println( "DEFAULT_BYTE_NO_ENTRY_VALUE: " +
- DEFAULT_BYTE_NO_ENTRY_VALUE );
- }
- }
-
-
- /** the default value that represents for short types. */
- public static final short DEFAULT_SHORT_NO_ENTRY_VALUE;
- static {
- short value;
- String property = System.getProperty( "gnu.trove.no_entry.short", "0" );
- if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Short.MAX_VALUE;
- else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Short.MIN_VALUE;
- else value = Short.valueOf( property );
-
- if ( value > Short.MAX_VALUE ) value = Short.MAX_VALUE;
- else if ( value < Short.MIN_VALUE ) value = Short.MIN_VALUE;
- DEFAULT_SHORT_NO_ENTRY_VALUE = value;
- if ( VERBOSE ) {
- System.out.println( "DEFAULT_SHORT_NO_ENTRY_VALUE: " +
- DEFAULT_SHORT_NO_ENTRY_VALUE );
- }
- }
-
-
- /** the default value that represents for char types. */
- public static final char DEFAULT_CHAR_NO_ENTRY_VALUE;
- static {
- char value;
- String property = System.getProperty( "gnu.trove.no_entry.char", "\0" );
- if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Character.MAX_VALUE;
- else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Character.MIN_VALUE;
- else value = property.toCharArray()[0];
-
- if ( value > Character.MAX_VALUE ) value = Character.MAX_VALUE;
- else if ( value < Character.MIN_VALUE ) value = Character.MIN_VALUE;
- DEFAULT_CHAR_NO_ENTRY_VALUE = value;
- if ( VERBOSE ) {
- System.out.println( "DEFAULT_CHAR_NO_ENTRY_VALUE: " +
- Integer.valueOf( value ) );
- }
- }
-
-
- /** the default value that represents for int types. */
- public static final int DEFAULT_INT_NO_ENTRY_VALUE;
- static {
- int value;
- String property = System.getProperty( "gnu.trove.no_entry.int", "0" );
- if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Integer.MAX_VALUE;
- else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Integer.MIN_VALUE;
- else value = Integer.valueOf( property );
- DEFAULT_INT_NO_ENTRY_VALUE = value;
- if ( VERBOSE ) {
- System.out.println( "DEFAULT_INT_NO_ENTRY_VALUE: " +
- DEFAULT_INT_NO_ENTRY_VALUE );
- }
- }
-
-
- /** the default value that represents for long types. */
- public static final long DEFAULT_LONG_NO_ENTRY_VALUE;
- static {
- long value;
- String property = System.getProperty( "gnu.trove.no_entry.long", "0" );
- if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Long.MAX_VALUE;
- else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Long.MIN_VALUE;
- else value = Long.valueOf( property );
- DEFAULT_LONG_NO_ENTRY_VALUE = value;
- if ( VERBOSE ) {
- System.out.println( "DEFAULT_LONG_NO_ENTRY_VALUE: " +
- DEFAULT_LONG_NO_ENTRY_VALUE );
- }
- }
-
-
- /** the default value that represents for float types. */
- public static final float DEFAULT_FLOAT_NO_ENTRY_VALUE;
- static {
- float value;
- String property = System.getProperty( "gnu.trove.no_entry.float", "0" );
- if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Float.MAX_VALUE;
- else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Float.MIN_VALUE;
- // Value from Float.MIN_NORMAL (introduced in 1.6)
- else if ( "MIN_NORMAL".equalsIgnoreCase( property ) ) value = 0x1.0p-126f;
- else if ( "NEGATIVE_INFINITY".equalsIgnoreCase( property ) ) value = Float.NEGATIVE_INFINITY;
- else if ( "POSITIVE_INFINITY".equalsIgnoreCase( property ) ) value = Float.POSITIVE_INFINITY;
-// else if ( "NaN".equalsIgnoreCase( property ) ) value = Float.NaN;
- else value = Float.valueOf( property );
- DEFAULT_FLOAT_NO_ENTRY_VALUE = value;
- if ( VERBOSE ) {
- System.out.println( "DEFAULT_FLOAT_NO_ENTRY_VALUE: " +
- DEFAULT_FLOAT_NO_ENTRY_VALUE );
- }
- }
-
-
- /** the default value that represents for double types. */
- public static final double DEFAULT_DOUBLE_NO_ENTRY_VALUE;
- static {
- double value;
- String property = System.getProperty( "gnu.trove.no_entry.double", "0" );
- if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Double.MAX_VALUE;
- else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Double.MIN_VALUE;
- // Value from Double.MIN_NORMAL (introduced in 1.6)
- else if ( "MIN_NORMAL".equalsIgnoreCase( property ) ) value = 0x1.0p-1022;
- else if ( "NEGATIVE_INFINITY".equalsIgnoreCase( property ) ) value = Double.NEGATIVE_INFINITY;
- else if ( "POSITIVE_INFINITY".equalsIgnoreCase( property ) ) value = Double.POSITIVE_INFINITY;
-// else if ( "NaN".equalsIgnoreCase( property ) ) value = Double.NaN;
- else value = Double.valueOf( property );
- DEFAULT_DOUBLE_NO_ENTRY_VALUE = value;
- if ( VERBOSE ) {
- System.out.println( "DEFAULT_DOUBLE_NO_ENTRY_VALUE: " +
- DEFAULT_DOUBLE_NO_ENTRY_VALUE );
- }
- }
-}
diff --git a/src/gnu/trove/impl/DualPivotQuicksort.java b/src/gnu/trove/impl/DualPivotQuicksort.java
deleted file mode 100644
index b0345a4..0000000
--- a/src/gnu/trove/impl/DualPivotQuicksort.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package gnu.trove.impl;
-
-/*
- * @author Vladimir Yaroslavskiy
- * @version 2009.09.10 m765
- */
-public class DualPivotQuicksort {
-
- public static void sort(int[] a) {
- sort(a, 0, a.length);
- }
-
- public static void sort(int[] a, int fromIndex, int toIndex) {
- rangeCheck(a.length, fromIndex, toIndex);
- dualPivotQuicksort(a, fromIndex, toIndex - 1, 3);
- }
-
- private static void rangeCheck(int length, int fromIndex, int toIndex) {
- if (fromIndex > toIndex) {
- throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
- }
- if (fromIndex < 0) {
- throw new ArrayIndexOutOfBoundsException(fromIndex);
- }
- if (toIndex > length) {
- throw new ArrayIndexOutOfBoundsException(toIndex);
- }
- }
-
- private static void swap(int[] a, int i, int j) {
- int temp = a[i];
- a[i] = a[j];
- a[j] = temp;
- }
-
- private static void dualPivotQuicksort(int[] a, int left, int right, int div) {
- int len = right - left;
-
- if (len < 27) { // insertion sort for tiny array
- for (int i = left + 1; i <= right; i++) {
- for (int j = i; j > left && a[j] < a[j - 1]; j--) {
- swap(a, j, j - 1);
- }
- }
- return;
- }
- int third = len / div;
-
- // "medians"
- int m1 = left + third;
- int m2 = right - third;
-
- if (m1 <= left) {
- m1 = left + 1;
- }
- if (m2 >= right) {
- m2 = right - 1;
- }
- if (a[m1] < a[m2]) {
- swap(a, m1, left);
- swap(a, m2, right);
- }
- else {
- swap(a, m1, right);
- swap(a, m2, left);
- }
- // pivots
- int pivot1 = a[left];
- int pivot2 = a[right];
-
- // pointers
- int less = left + 1;
- int great = right - 1;
-
- // sorting
- for (int k = less; k <= great; k++) {
- if (a[k] < pivot1) {
- swap(a, k, less++);
- }
- else if (a[k] > pivot2) {
- while (k < great && a[great] > pivot2) {
- great--;
- }
- swap(a, k, great--);
-
- if (a[k] < pivot1) {
- swap(a, k, less++);
- }
- }
- }
- // swaps
- int dist = great - less;
-
- if (dist < 13) {
- div++;
- }
- swap(a, less - 1, left);
- swap(a, great + 1, right);
-
- // subarrays
- dualPivotQuicksort(a, left, less - 2, div);
- dualPivotQuicksort(a, great + 2, right, div);
-
- // equal elements
- if (dist > len - 13 && pivot1 != pivot2) {
- for (int k = less; k <= great; k++) {
- if (a[k] == pivot1) {
- swap(a, k, less++);
- }
- else if (a[k] == pivot2) {
- swap(a, k, great--);
-
- if (a[k] == pivot1) {
- swap(a, k, less++);
- }
- }
- }
- }
- // subarray
- if (pivot1 < pivot2) {
- dualPivotQuicksort(a, less, great, div);
- }
- }
-}
diff --git a/src/gnu/trove/impl/HashFunctions.java b/src/gnu/trove/impl/HashFunctions.java
deleted file mode 100644
index a7be443..0000000
--- a/src/gnu/trove/impl/HashFunctions.java
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 1999 CERN - European Organization for Nuclear Research.
-
-// Permission to use, copy, modify, distribute and sell this software and
-// its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appear in all copies and that
-// both that copyright notice and this permission notice appear in
-// supporting documentation. CERN makes no representations about the
-// suitability of this software for any purpose. It is provided "as is"
-// without expressed or implied warranty.
-
-package gnu.trove.impl;
-
-/**
- * Provides various hash functions.
- *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
- */
-public final class HashFunctions {
- /**
- * Returns a hashcode for the specified value.
- *
- * @return a hash code value for the specified value.
- */
- public static int hash(double value) {
- assert !Double.isNaN(value) : "Values of NaN are not supported.";
-
- long bits = Double.doubleToLongBits(value);
- return (int)(bits ^ (bits >>> 32));
- //return (int) Double.doubleToLongBits(value*663608941.737);
- //this avoids excessive hashCollisions in the case values are
- //of the form (1.0, 2.0, 3.0, ...)
- }
-
- /**
- * Returns a hashcode for the specified value.
- *
- * @return a hash code value for the specified value.
- */
- public static int hash(float value) {
- assert !Float.isNaN(value) : "Values of NaN are not supported.";
-
- return Float.floatToIntBits(value*663608941.737f);
- // this avoids excessive hashCollisions in the case values are
- // of the form (1.0, 2.0, 3.0, ...)
- }
-
- /**
- * Returns a hashcode for the specified value.
- *
- * @return a hash code value for the specified value.
- */
- public static int hash(int value) {
- return value;
- }
-
- /**
- * Returns a hashcode for the specified value.
- *
- * @return a hash code value for the specified value.
- */
- public static int hash(long value) {
- return ((int)(value ^ (value >>> 32)));
- }
-
- /**
- * Returns a hashcode for the specified object.
- *
- * @return a hash code value for the specified object.
- */
- public static int hash(Object object) {
- return object==null ? 0 : object.hashCode();
- }
-
-
- /**
- * In profiling, it has been found to be faster to have our own local implementation
- * of "ceil" rather than to call to {@link Math#ceil(double)}.
- */
- public static int fastCeil( float v ) {
- int possible_result = ( int ) v;
- if ( v - possible_result > 0 ) possible_result++;
- return possible_result;
- }
-}
diff --git a/src/gnu/trove/impl/PrimeFinder.java b/src/gnu/trove/impl/PrimeFinder.java
deleted file mode 100644
index 11abe57..0000000
--- a/src/gnu/trove/impl/PrimeFinder.java
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright (c) 1999 CERN - European Organization for Nuclear Research.
-
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appear in all copies and
-// that both that copyright notice and this permission notice appear in
-// supporting documentation. CERN makes no representations about the
-// suitability of this software for any purpose. It is provided "as is"
-// without expressed or implied warranty.
-package gnu.trove.impl;
-
-import java.util.Arrays;
-
-/*
- * Modified for Trove to use the java.util.Arrays sort/search
- * algorithms instead of those provided with colt.
- */
-
-/**
- * Used to keep hash table capacities prime numbers.
- * Not of interest for users; only for implementors of hashtables.
- *
- * Choosing prime numbers as hash table capacities is a good idea - * to keep them working fast, particularly under hash table - * expansions. - * - *
However, JDK 1.2, JGL 3.1 and many other toolkits do nothing to - * keep capacities prime. This class provides efficient means to - * choose prime capacities. - * - *
Choosing a prime is O(log 300) (binary search in a list
- * of 300 ints). Memory requirements: 1 KB static memory.
- *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
- */
-public final class PrimeFinder {
- /**
- * The largest prime this class can generate; currently equal to
- * Integer.MAX_VALUE.
- */
- public static final int largestPrime = Integer.MAX_VALUE; //yes, it is prime.
-
- /**
- * The prime number list consists of 11 chunks.
- *
- * Each chunk contains prime numbers.
- *
- * A chunk starts with a prime P1. The next element is a prime
- * P2. P2 is the smallest prime for which holds: P2 >= 2*P1.
- *
- * The next element is P3, for which the same holds with respect
- * to P2, and so on.
- *
- * Chunks are chosen such that for any desired capacity >= 1000
- * the list includes a prime number <= desired capacity * 1.11.
- *
- * Therefore, primes can be retrieved which are quite close to any
- * desired capacity, which in turn avoids wasting memory.
- *
- * For example, the list includes
- * 1039,1117,1201,1277,1361,1439,1523,1597,1759,1907,2081.
- *
- * So if you need a prime >= 1040, you will find a prime <=
- * 1040*1.11=1154.
- *
- * Chunks are chosen such that they are optimized for a hashtable
- * growthfactor of 2.0;
- *
- * If your hashtable has such a growthfactor then, after initially
- * "rounding to a prime" upon hashtable construction, it will
- * later expand to prime capacities such that there exist no
- * better primes.
- *
- * In total these are about 32*10=320 numbers -> 1 KB of static
- * memory needed.
- *
- * If you are stingy, then delete every second or fourth chunk.
- */
-
- private static final int[] primeCapacities = {
- //chunk #0
- largestPrime,
-
- //chunk #1
- 5,11,23,47,97,197,397,797,1597,3203,6421,12853,25717,51437,102877,205759,
- 411527,823117,1646237,3292489,6584983,13169977,26339969,52679969,105359939,
- 210719881,421439783,842879579,1685759167,
-
- //chunk #2
- 433,877,1759,3527,7057,14143,28289,56591,113189,226379,452759,905551,1811107,
- 3622219,7244441,14488931,28977863,57955739,115911563,231823147,463646329,927292699,
- 1854585413,
-
- //chunk #3
- 953,1907,3821,7643,15287,30577,61169,122347,244703,489407,978821,1957651,3915341,
- 7830701,15661423,31322867,62645741,125291483,250582987,501165979,1002331963,
- 2004663929,
-
- //chunk #4
- 1039,2081,4177,8363,16729,33461,66923,133853,267713,535481,1070981,2141977,4283963,
- 8567929,17135863,34271747,68543509,137087021,274174111,548348231,1096696463,
-
- //chunk #5
- 31,67,137,277,557,1117,2237,4481,8963,17929,35863,71741,143483,286973,573953,
- 1147921,2295859,4591721,9183457,18366923,36733847,73467739,146935499,293871013,
- 587742049,1175484103,
-
- //chunk #6
- 599,1201,2411,4831,9677,19373,38747,77509,155027,310081,620171,1240361,2480729,
- 4961459,9922933,19845871,39691759,79383533,158767069,317534141,635068283,1270136683,
-
- //chunk #7
- 311,631,1277,2557,5119,10243,20507,41017,82037,164089,328213,656429,1312867,
- 2625761,5251529,10503061,21006137,42012281,84024581,168049163,336098327,672196673,
- 1344393353,
-
- //chunk #8
- 3,7,17,37,79,163,331,673,1361,2729,5471,10949,21911,43853,87719,175447,350899,
- 701819,1403641,2807303,5614657,11229331,22458671,44917381,89834777,179669557,
- 359339171,718678369,1437356741,
-
- //chunk #9
- 43,89,179,359,719,1439,2879,5779,11579,23159,46327,92657,185323,370661,741337,
- 1482707,2965421,5930887,11861791,23723597,47447201,94894427,189788857,379577741,
- 759155483,1518310967,
-
- //chunk #10
- 379,761,1523,3049,6101,12203,24407,48817,97649,195311,390647,781301,1562611,
- 3125257,6250537,12501169,25002389,50004791,100009607,200019221,400038451,800076929,
- 1600153859
- };
-
- static { //initializer
- // The above prime numbers are formatted for human readability.
- // To find numbers fast, we sort them once and for all.
-
- Arrays.sort(primeCapacities);
- }
-
- /**
- * Returns a prime number which is >= desiredCapacity
- * and very close to desiredCapacity (within 11% if
- * desiredCapacity >= 1000).
- *
- * @param desiredCapacity the capacity desired by the user.
- * @return the capacity which should be used for a hashtable.
- */
- public static final int nextPrime(int desiredCapacity) {
- int i = Arrays.binarySearch(primeCapacities, desiredCapacity);
- if (i<0) {
- // desired capacity not found, choose next prime greater
- // than desired capacity
- i = -i -1; // remember the semantics of binarySearch...
- }
- return primeCapacities[i];
- }
-}
diff --git a/src/gnu/trove/impl/hash/THash.java b/src/gnu/trove/impl/hash/THash.java
deleted file mode 100644
index 5625ebc..0000000
--- a/src/gnu/trove/impl/hash/THash.java
+++ /dev/null
@@ -1,428 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.impl.Constants;
-import gnu.trove.impl.HashFunctions;
-import gnu.trove.impl.PrimeFinder;
-
-import java.io.Externalizable;
-import java.io.ObjectOutput;
-import java.io.IOException;
-import java.io.ObjectInput;
-
-
-
-/**
- * Base class for hashtables that use open addressing to resolve
- * collisions.
- *
- * Created: Wed Nov 28 21:11:16 2001
- *
- * @author Eric D. Friedman
- * @author Rob Eden (auto-compaction)
- * @author Jeff Randall
- *
- * @version $Id: THash.java,v 1.1.2.4 2010/03/02 00:55:34 robeden Exp $
- */
-abstract public class THash implements Externalizable {
-
- static final long serialVersionUID = -1792948471915530295L;
-
- /** the load above which rehashing occurs. */
- protected static final float DEFAULT_LOAD_FACTOR = Constants.DEFAULT_LOAD_FACTOR;
-
- /**
- * the default initial capacity for the hash table. This is one
- * less than a prime value because one is added to it when
- * searching for a prime capacity to account for the free slot
- * required by open addressing. Thus, the real default capacity is
- * 11.
- */
- protected static final int DEFAULT_CAPACITY = Constants.DEFAULT_CAPACITY;
-
-
- /** the current number of occupied slots in the hash. */
- protected transient int _size;
-
- /** the current number of free slots in the hash. */
- protected transient int _free;
-
- /**
- * Determines how full the internal table can become before
- * rehashing is required. This must be a value in the range: 0.0 <
- * loadFactor < 1.0. The default value is 0.5, which is about as
- * large as you can get in open addressing without hurting
- * performance. Cf. Knuth, Volume 3., Chapter 6.
- */
- protected float _loadFactor;
-
- /**
- * The maximum number of elements allowed without allocating more
- * space.
- */
- protected int _maxSize;
-
-
- /** The number of removes that should be performed before an auto-compaction occurs. */
- protected int _autoCompactRemovesRemaining;
-
- /**
- * The auto-compaction factor for the table.
- *
- * @see #setAutoCompactionFactor
- */
- protected float _autoCompactionFactor;
-
- /** @see #tempDisableAutoCompaction */
- protected transient boolean _autoCompactTemporaryDisable = false;
-
-
- /**
- * Creates a new THash instance with the default
- * capacity and load factor.
- */
- public THash() {
- this( DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR );
- }
-
-
- /**
- * Creates a new THash instance with a prime capacity
- * at or near the specified capacity and with the default load
- * factor.
- *
- * @param initialCapacity an int value
- */
- public THash( int initialCapacity ) {
- this( initialCapacity, DEFAULT_LOAD_FACTOR );
- }
-
-
- /**
- * Creates a new THash instance with a prime capacity
- * at or near the minimum needed to hold initialCapacity
- * elements with load factor loadFactor without triggering
- * a rehash.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- */
- public THash( int initialCapacity, float loadFactor ) {
- super();
- _loadFactor = loadFactor;
-
- // Through testing, the load factor (especially the default load factor) has been
- // found to be a pretty good starting auto-compaction factor.
- _autoCompactionFactor = loadFactor;
-
- setUp( HashFunctions.fastCeil( initialCapacity / loadFactor ) );
- }
-
-
- /**
- * Tells whether this set is currently holding any elements.
- *
- * @return a boolean value
- */
- public boolean isEmpty() {
- return 0 == _size;
- }
-
-
- /**
- * Returns the number of distinct elements in this collection.
- *
- * @return an int value
- */
- public int size() {
- return _size;
- }
-
-
- /** @return the current physical capacity of the hash table. */
- abstract public int capacity();
-
-
- /**
- * Ensure that this hashtable has sufficient capacity to hold
- * desiredCapacity additional elements without
- * requiring a rehash. This is a tuning method you can call
- * before doing a large insert.
- *
- * @param desiredCapacity an int value
- */
- public void ensureCapacity( int desiredCapacity ) {
- if ( desiredCapacity > ( _maxSize - size() ) ) {
- rehash( PrimeFinder.nextPrime( HashFunctions.fastCeil(
- ( desiredCapacity + size() ) / _loadFactor ) + 1 ) );
- computeMaxSize( capacity() );
- }
- }
-
-
- /**
- * Compresses the hashtable to the minimum prime size (as defined
- * by PrimeFinder) that will hold all of the elements currently in
- * the table. If you have done a lot of remove
- * operations and plan to do a lot of queries or insertions or
- * iteration, it is a good idea to invoke this method. Doing so
- * will accomplish two things:
- *
int value
- */
- protected void removeAt( int index ) {
- _size--;
-
- // If auto-compaction is enabled, see if we need to compact
- if ( _autoCompactionFactor != 0 ) {
- _autoCompactRemovesRemaining--;
-
- if ( !_autoCompactTemporaryDisable && _autoCompactRemovesRemaining <= 0 ) {
- // Do the compact
- // NOTE: this will cause the next compaction interval to be calculated
- compact();
- }
- }
- }
-
-
- /** Empties the collection. */
- public void clear() {
- _size = 0;
- _free = capacity();
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = PrimeFinder.nextPrime( initialCapacity );
- computeMaxSize( capacity );
- computeNextAutoCompactionAmount( initialCapacity );
-
- return capacity;
- }
-
-
- /**
- * Rehashes the set.
- *
- * @param newCapacity an int value
- */
- protected abstract void rehash( int newCapacity );
-
-
- /**
- * Temporarily disables auto-compaction. MUST be followed by calling
- * {@link #reenableAutoCompaction}.
- */
- public void tempDisableAutoCompaction() {
- _autoCompactTemporaryDisable = true;
- }
-
-
- /**
- * Re-enable auto-compaction after it was disabled via
- * {@link #tempDisableAutoCompaction()}.
- *
- * @param check_for_compaction True if compaction should be performed if needed
- * before returning. If false, no compaction will be
- * performed.
- */
- public void reenableAutoCompaction( boolean check_for_compaction ) {
- _autoCompactTemporaryDisable = false;
-
- if ( check_for_compaction && _autoCompactRemovesRemaining <= 0 &&
- _autoCompactionFactor != 0 ) {
-
- // Do the compact
- // NOTE: this will cause the next compaction interval to be calculated
- compact();
- }
- }
-
-
- /**
- * Computes the values of maxSize. There will always be at least
- * one free slot required.
- *
- * @param capacity an int value
- */
- protected void computeMaxSize( int capacity ) {
- // need at least one free slot for open addressing
- _maxSize = Math.min( capacity - 1, (int) ( capacity * _loadFactor ) );
- _free = capacity - _size; // reset the free element count
- }
-
-
- /**
- * Computes the number of removes that need to happen before the next auto-compaction
- * will occur.
- *
- * @param size an int that sets the auto-compaction limit.
- */
- protected void computeNextAutoCompactionAmount( int size ) {
- if ( _autoCompactionFactor != 0 ) {
- // NOTE: doing the round ourselves has been found to be faster than using
- // Math.round.
- _autoCompactRemovesRemaining =
- (int) ( ( size * _autoCompactionFactor ) + 0.5f );
- }
- }
-
-
- /**
- * After an insert, this hook is called to adjust the size/free
- * values of the set and to perform rehashing if necessary.
- *
- * @param usedFreeSlot the slot
- */
- protected final void postInsertHook( boolean usedFreeSlot ) {
- if ( usedFreeSlot ) {
- _free--;
- }
-
- // rehash whenever we exhaust the available space in the table
- if ( ++_size > _maxSize || _free == 0 ) {
- // choose a new capacity suited to the new state of the table
- // if we've grown beyond our maximum size, double capacity;
- // if we've exhausted the free spots, rehash to the same capacity,
- // which will free up any stale removed slots for reuse.
- int newCapacity = _size > _maxSize ? PrimeFinder.nextPrime( capacity() << 1 ) : capacity();
- rehash( newCapacity );
- computeMaxSize( capacity() );
- }
- }
-
-
- protected int calculateGrownCapacity() {
- return capacity() << 1;
- }
-
-
- public void writeExternal( ObjectOutput out ) throws IOException {
- // VERSION
- out.writeByte( 0 );
-
- // LOAD FACTOR
- out.writeFloat( _loadFactor );
-
- // AUTO COMPACTION LOAD FACTOR
- out.writeFloat( _autoCompactionFactor );
- }
-
-
- public void readExternal( ObjectInput in )
- throws IOException, ClassNotFoundException {
-
- // VERSION
- in.readByte();
-
- // LOAD FACTOR
- float old_factor = _loadFactor;
- _loadFactor = in.readFloat();
-
- // AUTO COMPACTION LOAD FACTOR
- _autoCompactionFactor = in.readFloat();
-
- // If we change the laod factor from the default, re-setup
- if ( old_factor != _loadFactor ) {
- setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
- }
- }
-}// THash
\ No newline at end of file
diff --git a/src/gnu/trove/impl/hash/THashIterator.java b/src/gnu/trove/impl/hash/THashIterator.java
deleted file mode 100644
index 4898620..0000000
--- a/src/gnu/trove/impl/hash/THashIterator.java
+++ /dev/null
@@ -1,177 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.iterator.TIterator;
-
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-
-
-/**
- * Implements all iterator functions for the hashed object set.
- * Subclasses may override objectAtIndex to vary the object
- * returned by calls to next() (e.g. for values, and Map.Entry
- * objects).
- *
- * Note that iteration is fastest if you forego the calls to - * hasNext in favor of checking the size of the structure - * yourself and then call next() that many times: - *
- *
- * Iterator i = collection.iterator();
- * for (int size = collection.size(); size-- > 0;) {
- * Object o = i.next();
- * }
- *
- *
- * You may, of course, use the hasNext(), next() idiom too if - * you aren't in a performance critical spot.
- */ -public abstract class THashIteratorObject value
- * @throws ConcurrentModificationException
- * if the structure
- * was changed using a method that isn't on this iterator.
- * @throws NoSuchElementException if this is called on an
- * exhausted iterator.
- */
- public V next() {
- moveToNextIndex();
- return objectAtIndex( _index );
- }
-
-
- /**
- * Returns true if the iterator can be advanced past its current
- * location.
- *
- * @return a boolean value
- */
- public boolean hasNext() {
- return nextIndex() >= 0;
- }
-
-
- /**
- * Removes the last entry returned by the iterator.
- * Invoking this method more than once for a single entry
- * will leave the underlying data structure in a confused
- * state.
- */
- public void remove() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
-
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- _hash.removeAt( _index );
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
-
- _expectedSize--;
- }
-
-
- /**
- * Sets the internal index so that the `next' object
- * can be returned.
- */
- protected final void moveToNextIndex() {
- // doing the assignment && < 0 in one line shaves
- // 3 opcodes...
- if ( ( _index = nextIndex() ) < 0 ) {
- throw new NoSuchElementException();
- }
- }
-
-
- /**
- * Returns the index of the next value in the data structure
- * or a negative value if the iterator is exhausted.
- *
- * @return an int value
- * @throws ConcurrentModificationException
- * if the underlying
- * collection's size has been modified since the iterator was
- * created.
- */
- protected final int nextIndex() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
-
- Object[] set = _object_hash._set;
- int i = _index;
- while ( i-- > 0 && ( set[i] == TObjectHash.FREE || set[i] == TObjectHash.REMOVED ) ) {
- ;
- }
- return i;
- }
-
-
- /**
- * Returns the object at the specified index. Subclasses should
- * implement this to return the appropriate object for the given
- * index.
- *
- * @param index the index of the value to return.
- * @return an Object value
- */
- abstract protected V objectAtIndex( int index );
-} // THashIterator
diff --git a/src/gnu/trove/impl/hash/THashPrimitiveIterator.java b/src/gnu/trove/impl/hash/THashPrimitiveIterator.java
deleted file mode 100644
index 9e7ecb2..0000000
--- a/src/gnu/trove/impl/hash/THashPrimitiveIterator.java
+++ /dev/null
@@ -1,143 +0,0 @@
-// ////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// ////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.iterator.TPrimitiveIterator;
-
-import java.util.ConcurrentModificationException;
-import java.util.NoSuchElementException;
-
-
-/**
- * Implements all iterator functions for the hashed object set.
- * Subclasses may override objectAtIndex to vary the object
- * returned by calls to next() (e.g. for values, and Map.Entry
- * objects).
- *
- * Note that iteration is fastest if you forego the calls to - * hasNext in favor of checking the size of the structure - * yourself and then call next() that many times: - *
- *
- * Iterator i = collection.iterator();
- * for (int size = collection.size(); size-- > 0;) {
- * Object o = i.next();
- * }
- *
- *
- * You may, of course, use the hasNext(), next() idiom too if - * you aren't in a performance critical spot.
- */ -public abstract class THashPrimitiveIterator implements TPrimitiveIterator { - - /** the data structure this iterator traverses */ - protected final TPrimitiveHash _hash; - /** - * the number of elements this iterator believes are in the - * data structure it accesses. - */ - protected int _expectedSize; - /** the index used for iteration. */ - protected int _index; - - - /** - * Creates a TPrimitiveIterator for the specified collection. - * - * @param hash the TPrimitiveHash we want to iterate over. - */ - public THashPrimitiveIterator( TPrimitiveHash hash ) { - _hash = hash; - _expectedSize = _hash.size(); - _index = _hash.capacity(); - } - - - /** - * Returns the index of the next value in the data structure - * or a negative value if the iterator is exhausted. - * - * @return anint value
- * @throws java.util.ConcurrentModificationException
- * if the underlying collection's
- * size has been modified since the iterator was created.
- */
- protected final int nextIndex() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
-
- byte[] states = _hash._states;
- int i = _index;
- while ( i-- > 0 && ( states[i] != TPrimitiveHash.FULL ) ) {
- ;
- }
- return i;
- }
-
-
- /**
- * Returns true if the iterator can be advanced past its current
- * location.
- *
- * @return a boolean value
- */
- public boolean hasNext() {
- return nextIndex() >= 0;
- }
-
-
- /**
- * Removes the last entry returned by the iterator.
- * Invoking this method more than once for a single entry
- * will leave the underlying data structure in a confused
- * state.
- */
- public void remove() {
- if (_expectedSize != _hash.size()) {
- throw new ConcurrentModificationException();
- }
-
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- _hash.removeAt(_index);
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
-
- _expectedSize--;
- }
-
-
- /**
- * Sets the internal index so that the `next' object
- * can be returned.
- */
- protected final void moveToNextIndex() {
- // doing the assignment && < 0 in one line shaves
- // 3 opcodes...
- if ( ( _index = nextIndex() ) < 0 ) {
- throw new NoSuchElementException();
- }
- }
-
-
-} // TPrimitiveIterator
\ No newline at end of file
diff --git a/src/gnu/trove/impl/hash/TIntFloatHash.java b/src/gnu/trove/impl/hash/TIntFloatHash.java
deleted file mode 100644
index ed22965..0000000
--- a/src/gnu/trove/impl/hash/TIntFloatHash.java
+++ /dev/null
@@ -1,341 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.procedure.*;
-import gnu.trove.impl.HashFunctions;
-
-import java.io.ObjectOutput;
-import java.io.ObjectInput;
-import java.io.IOException;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * An open addressed hashing implementation for int/float primitive entries.
- *
- * Created: Sun Nov 4 08:56:06 2001
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: _K__V_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $
- */
-abstract public class TIntFloatHash extends TPrimitiveHash {
-
- /** the set of ints */
- public transient int[] _set;
-
-
- /**
- * key that represents null
- *
- * NOTE: should not be modified after the Hash is created, but is
- * not final because of Externalization
- *
- */
- protected int no_entry_key;
-
-
- /**
- * value that represents null
- *
- * NOTE: should not be modified after the Hash is created, but is
- * not final because of Externalization
- *
- */
- protected float no_entry_value;
-
-
- /**
- * Creates a new T#E#Hash instance with the default
- * capacity and load factor.
- */
- public TIntFloatHash() {
- super();
- no_entry_key = ( int ) 0;
- no_entry_value = ( float ) 0;
- }
-
-
- /**
- * Creates a new T#E#Hash instance whose capacity
- * is the next highest prime above initialCapacity + 1
- * unless that value is already prime.
- *
- * @param initialCapacity an int value
- */
- public TIntFloatHash( int initialCapacity ) {
- super( initialCapacity );
- no_entry_key = ( int ) 0;
- no_entry_value = ( float ) 0;
- }
-
-
- /**
- * Creates a new TIntFloatHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- */
- public TIntFloatHash( int initialCapacity, float loadFactor ) {
- super(initialCapacity, loadFactor);
- no_entry_key = ( int ) 0;
- no_entry_value = ( float ) 0;
- }
-
-
- /**
- * Creates a new TIntFloatHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- * @param no_entry_value value that represents null
- */
- public TIntFloatHash( int initialCapacity, float loadFactor,
- int no_entry_key, float no_entry_value ) {
- super(initialCapacity, loadFactor);
- this.no_entry_key = no_entry_key;
- this.no_entry_value = no_entry_value;
- }
-
-
- /**
- * Returns the value that is used to represent null as a key. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- public int getNoEntryKey() {
- return no_entry_key;
- }
-
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- public float getNoEntryValue() {
- return no_entry_value;
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _set = new int[capacity];
- return capacity;
- }
-
-
- /**
- * Searches the set for val
- *
- * @param val an int value
- * @return a boolean value
- */
- public boolean contains( int val ) {
- return index(val) >= 0;
- }
-
-
- /**
- * Executes procedure for each key in the map.
- *
- * @param procedure a TIntProcedure value
- * @return false if the loop over the set terminated because
- * the procedure returned false for some value.
- */
- public boolean forEach( TIntProcedure procedure ) {
- byte[] states = _states;
- int[] set = _set;
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( set[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Releases the element currently stored at index.
- *
- * @param index an int value
- */
- protected void removeAt( int index ) {
- _set[index] = no_entry_key;
- super.removeAt( index );
- }
-
-
- /**
- * Locates the index of val.
- *
- * @param key an int value
- * @return the index of val or -1 if it isn't in the set.
- */
- protected int index( int key ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final int[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( key ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != key ) ) {
- // see Knuth, p. 529
- probe = 1 + ( hash % ( length - 2 ) );
-
- do {
- index -= probe;
- if ( index < 0 ) {
- index += length;
- }
- } while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != key ) );
- }
-
- return states[index] == FREE ? -1 : index;
- }
-
-
- /**
- * Locates the index at which val can be inserted. if
- * there is already a value equal()ing val in the set,
- * returns that value as a negative integer.
- *
- * @param key an int value
- * @return an int value
- */
- protected int insertionIndex( int key ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final int[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( key ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] == FREE ) {
- return index; // empty, all done
- } else if ( states[index] == FULL && set[index] == key ) {
- return -index -1; // already stored
- } else { // already FULL or REMOVED, must probe
- // compute the double hash
- probe = 1 + ( hash % ( length - 2 ) );
-
- // if the slot we landed on is FULL (but not removed), probe
- // until we find an empty slot, a REMOVED slot, or an element
- // equal to the one we are trying to insert.
- // finding an empty slot means that the value is not present
- // and that we should use that slot as the insertion point;
- // finding a REMOVED slot means that we need to keep searching,
- // however we want to remember the offset of that REMOVED slot
- // so we can reuse it in case a "new" insertion (i.e. not an update)
- // is possible.
- // finding a matching value means that we've found that our desired
- // key is already in the table
-
- if ( states[index] != REMOVED ) {
- // starting at the natural offset, probe until we find an
- // offset that isn't full.
- do {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- } while ( states[index] == FULL && set[index] != key );
- }
-
- // if the index we found was removed: continue probing until we
- // locate a free location or an element which equal()s the
- // one we have.
- if ( states[index] == REMOVED) {
- int firstRemoved = index;
- while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != key ) ) {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- }
- return states[index] == FULL ? -index -1 : firstRemoved;
- }
- // if it's full, the key is already stored
- return states[index] == FULL ? -index -1 : index;
- }
- }
-
-
- /** {@inheritDoc} */
- public void writeExternal( ObjectOutput out ) throws IOException {
- // VERSION
- out.writeByte( 0 );
-
- // SUPER
- super.writeExternal( out );
-
- // NO_ENTRY_KEY
- out.writeInt( no_entry_key );
-
- // NO_ENTRY_VALUE
- out.writeFloat( no_entry_value );
- }
-
-
- /** {@inheritDoc} */
- public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException {
- // VERSION
- in.readByte();
-
- // SUPER
- super.readExternal( in );
-
- // NO_ENTRY_KEY
- no_entry_key = in.readInt();
-
- // NO_ENTRY_VALUE
- no_entry_value = in.readFloat();
- }
-} // TIntFloatHash
diff --git a/src/gnu/trove/impl/hash/TIntHash.java b/src/gnu/trove/impl/hash/TIntHash.java
deleted file mode 100644
index 04c8df7..0000000
--- a/src/gnu/trove/impl/hash/TIntHash.java
+++ /dev/null
@@ -1,293 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.procedure.TIntProcedure;
-import gnu.trove.impl.HashFunctions;
-import gnu.trove.impl.Constants;
-
-import java.util.Arrays;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * An open addressed hashing implementation for int primitives.
- *
- * Created: Sun Nov 4 08:56:06 2001
- *
- * @author Eric D. Friedman, Rob Eden, Jeff Randall
- * @version $Id: _E_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $
- */
-abstract public class TIntHash extends TPrimitiveHash {
-
- /** the set of ints */
- public transient int[] _set;
-
- /**
- * value that represents null
- *
- * NOTE: should not be modified after the Hash is created, but is
- * not final because of Externalization
- *
- */
- protected int no_entry_value;
-
-
- /**
- * Creates a new TIntHash instance with the default
- * capacity and load factor.
- */
- public TIntHash() {
- super();
- no_entry_value = Constants.DEFAULT_INT_NO_ENTRY_VALUE;
- //noinspection RedundantCast
- if ( no_entry_value != ( int ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TIntHash instance whose capacity
- * is the next highest prime above initialCapacity + 1
- * unless that value is already prime.
- *
- * @param initialCapacity an int value
- */
- public TIntHash( int initialCapacity ) {
- super( initialCapacity );
- no_entry_value = Constants.DEFAULT_INT_NO_ENTRY_VALUE;
- //noinspection RedundantCast
- if ( no_entry_value != ( int ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TIntHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- */
- public TIntHash( int initialCapacity, float loadFactor ) {
- super(initialCapacity, loadFactor);
- no_entry_value = Constants.DEFAULT_INT_NO_ENTRY_VALUE;
- //noinspection RedundantCast
- if ( no_entry_value != ( int ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TIntHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- * @param no_entry_value value that represents null
- */
- public TIntHash( int initialCapacity, float loadFactor, int no_entry_value ) {
- super(initialCapacity, loadFactor);
- this.no_entry_value = no_entry_value;
- //noinspection RedundantCast
- if ( no_entry_value != ( int ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- public int getNoEntryValue() {
- return no_entry_value;
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _set = new int[capacity];
- return capacity;
- }
-
-
- /**
- * Searches the set for val
- *
- * @param val an int value
- * @return a boolean value
- */
- public boolean contains( int val ) {
- return index(val) >= 0;
- }
-
-
- /**
- * Executes procedure for each element in the set.
- *
- * @param procedure a TObjectProcedure value
- * @return false if the loop over the set terminated because
- * the procedure returned false for some value.
- */
- public boolean forEach( TIntProcedure procedure ) {
- byte[] states = _states;
- int[] set = _set;
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( set[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Releases the element currently stored at index.
- *
- * @param index an int value
- */
- protected void removeAt( int index ) {
- _set[index] = no_entry_value;
- super.removeAt( index );
- }
-
-
- /**
- * Locates the index of val.
- *
- * @param val an int value
- * @return the index of val or -1 if it isn't in the set.
- */
- protected int index( int val ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final int[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( val ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != val ) ) {
- // see Knuth, p. 529
- probe = 1 + ( hash % ( length - 2 ) );
-
- do {
- index -= probe;
- if ( index < 0 ) {
- index += length;
- }
- } while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != val ) );
- }
-
- return states[index] == FREE ? -1 : index;
- }
-
-
- /**
- * Locates the index at which val can be inserted. if
- * there is already a value equal()ing val in the set,
- * returns that value as a negative integer.
- *
- * @param val an int value
- * @return an int value
- */
- protected int insertionIndex( int val ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final int[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( val ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] == FREE ) {
- return index; // empty, all done
- } else if ( states[index] == FULL && set[index] == val ) {
- return -index -1; // already stored
- } else { // already FULL or REMOVED, must probe
- // compute the double hash
- probe = 1 + ( hash % ( length - 2 ) );
-
- // if the slot we landed on is FULL (but not removed), probe
- // until we find an empty slot, a REMOVED slot, or an element
- // equal to the one we are trying to insert.
- // finding an empty slot means that the value is not present
- // and that we should use that slot as the insertion point;
- // finding a REMOVED slot means that we need to keep searching,
- // however we want to remember the offset of that REMOVED slot
- // so we can reuse it in case a "new" insertion (i.e. not an update)
- // is possible.
- // finding a matching value means that we've found that our desired
- // key is already in the table
-
- if ( states[index] != REMOVED ) {
- // starting at the natural offset, probe until we find an
- // offset that isn't full.
- do {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- } while ( states[index] == FULL && set[index] != val );
- }
-
- // if the index we found was removed: continue probing until we
- // locate a free location or an element which equal()s the
- // one we have.
- if ( states[index] == REMOVED) {
- int firstRemoved = index;
- while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != val ) ) {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- }
- return states[index] == FULL ? -index -1 : firstRemoved;
- }
- // if it's full, the key is already stored
- return states[index] == FULL ? -index -1 : index;
- }
- }
-} // TIntHash
diff --git a/src/gnu/trove/impl/hash/TLongDoubleHash.java b/src/gnu/trove/impl/hash/TLongDoubleHash.java
deleted file mode 100644
index b1b77a6..0000000
--- a/src/gnu/trove/impl/hash/TLongDoubleHash.java
+++ /dev/null
@@ -1,341 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.procedure.*;
-import gnu.trove.impl.HashFunctions;
-
-import java.io.ObjectOutput;
-import java.io.ObjectInput;
-import java.io.IOException;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * An open addressed hashing implementation for long/double primitive entries.
- *
- * Created: Sun Nov 4 08:56:06 2001
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: _K__V_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $
- */
-abstract public class TLongDoubleHash extends TPrimitiveHash {
-
- /** the set of longs */
- public transient long[] _set;
-
-
- /**
- * key that represents null
- *
- * NOTE: should not be modified after the Hash is created, but is
- * not final because of Externalization
- *
- */
- protected long no_entry_key;
-
-
- /**
- * value that represents null
- *
- * NOTE: should not be modified after the Hash is created, but is
- * not final because of Externalization
- *
- */
- protected double no_entry_value;
-
-
- /**
- * Creates a new T#E#Hash instance with the default
- * capacity and load factor.
- */
- public TLongDoubleHash() {
- super();
- no_entry_key = ( long ) 0;
- no_entry_value = ( double ) 0;
- }
-
-
- /**
- * Creates a new T#E#Hash instance whose capacity
- * is the next highest prime above initialCapacity + 1
- * unless that value is already prime.
- *
- * @param initialCapacity an int value
- */
- public TLongDoubleHash( int initialCapacity ) {
- super( initialCapacity );
- no_entry_key = ( long ) 0;
- no_entry_value = ( double ) 0;
- }
-
-
- /**
- * Creates a new TLongDoubleHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- */
- public TLongDoubleHash( int initialCapacity, float loadFactor ) {
- super(initialCapacity, loadFactor);
- no_entry_key = ( long ) 0;
- no_entry_value = ( double ) 0;
- }
-
-
- /**
- * Creates a new TLongDoubleHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- * @param no_entry_value value that represents null
- */
- public TLongDoubleHash( int initialCapacity, float loadFactor,
- long no_entry_key, double no_entry_value ) {
- super(initialCapacity, loadFactor);
- this.no_entry_key = no_entry_key;
- this.no_entry_value = no_entry_value;
- }
-
-
- /**
- * Returns the value that is used to represent null as a key. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- public long getNoEntryKey() {
- return no_entry_key;
- }
-
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- public double getNoEntryValue() {
- return no_entry_value;
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _set = new long[capacity];
- return capacity;
- }
-
-
- /**
- * Searches the set for val
- *
- * @param val an long value
- * @return a boolean value
- */
- public boolean contains( long val ) {
- return index(val) >= 0;
- }
-
-
- /**
- * Executes procedure for each key in the map.
- *
- * @param procedure a TLongProcedure value
- * @return false if the loop over the set terminated because
- * the procedure returned false for some value.
- */
- public boolean forEach( TLongProcedure procedure ) {
- byte[] states = _states;
- long[] set = _set;
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( set[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Releases the element currently stored at index.
- *
- * @param index an int value
- */
- protected void removeAt( int index ) {
- _set[index] = no_entry_key;
- super.removeAt( index );
- }
-
-
- /**
- * Locates the index of val.
- *
- * @param key an long value
- * @return the index of val or -1 if it isn't in the set.
- */
- protected int index( long key ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final long[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( key ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != key ) ) {
- // see Knuth, p. 529
- probe = 1 + ( hash % ( length - 2 ) );
-
- do {
- index -= probe;
- if ( index < 0 ) {
- index += length;
- }
- } while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != key ) );
- }
-
- return states[index] == FREE ? -1 : index;
- }
-
-
- /**
- * Locates the index at which val can be inserted. if
- * there is already a value equal()ing val in the set,
- * returns that value as a negative integer.
- *
- * @param key an long value
- * @return an int value
- */
- protected int insertionIndex( long key ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final long[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( key ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] == FREE ) {
- return index; // empty, all done
- } else if ( states[index] == FULL && set[index] == key ) {
- return -index -1; // already stored
- } else { // already FULL or REMOVED, must probe
- // compute the double hash
- probe = 1 + ( hash % ( length - 2 ) );
-
- // if the slot we landed on is FULL (but not removed), probe
- // until we find an empty slot, a REMOVED slot, or an element
- // equal to the one we are trying to insert.
- // finding an empty slot means that the value is not present
- // and that we should use that slot as the insertion point;
- // finding a REMOVED slot means that we need to keep searching,
- // however we want to remember the offset of that REMOVED slot
- // so we can reuse it in case a "new" insertion (i.e. not an update)
- // is possible.
- // finding a matching value means that we've found that our desired
- // key is already in the table
-
- if ( states[index] != REMOVED ) {
- // starting at the natural offset, probe until we find an
- // offset that isn't full.
- do {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- } while ( states[index] == FULL && set[index] != key );
- }
-
- // if the index we found was removed: continue probing until we
- // locate a free location or an element which equal()s the
- // one we have.
- if ( states[index] == REMOVED) {
- int firstRemoved = index;
- while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != key ) ) {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- }
- return states[index] == FULL ? -index -1 : firstRemoved;
- }
- // if it's full, the key is already stored
- return states[index] == FULL ? -index -1 : index;
- }
- }
-
-
- /** {@inheritDoc} */
- public void writeExternal( ObjectOutput out ) throws IOException {
- // VERSION
- out.writeByte( 0 );
-
- // SUPER
- super.writeExternal( out );
-
- // NO_ENTRY_KEY
- out.writeLong( no_entry_key );
-
- // NO_ENTRY_VALUE
- out.writeDouble( no_entry_value );
- }
-
-
- /** {@inheritDoc} */
- public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException {
- // VERSION
- in.readByte();
-
- // SUPER
- super.readExternal( in );
-
- // NO_ENTRY_KEY
- no_entry_key = in.readLong();
-
- // NO_ENTRY_VALUE
- no_entry_value = in.readDouble();
- }
-} // TLongDoubleHash
diff --git a/src/gnu/trove/impl/hash/TLongHash.java b/src/gnu/trove/impl/hash/TLongHash.java
deleted file mode 100644
index ce94453..0000000
--- a/src/gnu/trove/impl/hash/TLongHash.java
+++ /dev/null
@@ -1,293 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.procedure.TLongProcedure;
-import gnu.trove.impl.HashFunctions;
-import gnu.trove.impl.Constants;
-
-import java.util.Arrays;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * An open addressed hashing implementation for long primitives.
- *
- * Created: Sun Nov 4 08:56:06 2001
- *
- * @author Eric D. Friedman, Rob Eden, Jeff Randall
- * @version $Id: _E_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $
- */
-abstract public class TLongHash extends TPrimitiveHash {
-
- /** the set of longs */
- public transient long[] _set;
-
- /**
- * value that represents null
- *
- * NOTE: should not be modified after the Hash is created, but is
- * not final because of Externalization
- *
- */
- protected long no_entry_value;
-
-
- /**
- * Creates a new TLongHash instance with the default
- * capacity and load factor.
- */
- public TLongHash() {
- super();
- no_entry_value = Constants.DEFAULT_LONG_NO_ENTRY_VALUE;
- //noinspection RedundantCast
- if ( no_entry_value != ( long ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TLongHash instance whose capacity
- * is the next highest prime above initialCapacity + 1
- * unless that value is already prime.
- *
- * @param initialCapacity an int value
- */
- public TLongHash( int initialCapacity ) {
- super( initialCapacity );
- no_entry_value = Constants.DEFAULT_LONG_NO_ENTRY_VALUE;
- //noinspection RedundantCast
- if ( no_entry_value != ( long ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TLongHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- */
- public TLongHash( int initialCapacity, float loadFactor ) {
- super(initialCapacity, loadFactor);
- no_entry_value = Constants.DEFAULT_LONG_NO_ENTRY_VALUE;
- //noinspection RedundantCast
- if ( no_entry_value != ( long ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TLongHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- * @param no_entry_value value that represents null
- */
- public TLongHash( int initialCapacity, float loadFactor, long no_entry_value ) {
- super(initialCapacity, loadFactor);
- this.no_entry_value = no_entry_value;
- //noinspection RedundantCast
- if ( no_entry_value != ( long ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- public long getNoEntryValue() {
- return no_entry_value;
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _set = new long[capacity];
- return capacity;
- }
-
-
- /**
- * Searches the set for val
- *
- * @param val an long value
- * @return a boolean value
- */
- public boolean contains( long val ) {
- return index(val) >= 0;
- }
-
-
- /**
- * Executes procedure for each element in the set.
- *
- * @param procedure a TObjectProcedure value
- * @return false if the loop over the set terminated because
- * the procedure returned false for some value.
- */
- public boolean forEach( TLongProcedure procedure ) {
- byte[] states = _states;
- long[] set = _set;
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( set[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Releases the element currently stored at index.
- *
- * @param index an int value
- */
- protected void removeAt( int index ) {
- _set[index] = no_entry_value;
- super.removeAt( index );
- }
-
-
- /**
- * Locates the index of val.
- *
- * @param val an long value
- * @return the index of val or -1 if it isn't in the set.
- */
- protected int index( long val ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final long[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( val ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != val ) ) {
- // see Knuth, p. 529
- probe = 1 + ( hash % ( length - 2 ) );
-
- do {
- index -= probe;
- if ( index < 0 ) {
- index += length;
- }
- } while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != val ) );
- }
-
- return states[index] == FREE ? -1 : index;
- }
-
-
- /**
- * Locates the index at which val can be inserted. if
- * there is already a value equal()ing val in the set,
- * returns that value as a negative integer.
- *
- * @param val an long value
- * @return an int value
- */
- protected int insertionIndex( long val ) {
- int hash, probe, index, length;
-
- final byte[] states = _states;
- final long[] set = _set;
- length = states.length;
- hash = HashFunctions.hash( val ) & 0x7fffffff;
- index = hash % length;
-
- if ( states[index] == FREE ) {
- return index; // empty, all done
- } else if ( states[index] == FULL && set[index] == val ) {
- return -index -1; // already stored
- } else { // already FULL or REMOVED, must probe
- // compute the double hash
- probe = 1 + ( hash % ( length - 2 ) );
-
- // if the slot we landed on is FULL (but not removed), probe
- // until we find an empty slot, a REMOVED slot, or an element
- // equal to the one we are trying to insert.
- // finding an empty slot means that the value is not present
- // and that we should use that slot as the insertion point;
- // finding a REMOVED slot means that we need to keep searching,
- // however we want to remember the offset of that REMOVED slot
- // so we can reuse it in case a "new" insertion (i.e. not an update)
- // is possible.
- // finding a matching value means that we've found that our desired
- // key is already in the table
-
- if ( states[index] != REMOVED ) {
- // starting at the natural offset, probe until we find an
- // offset that isn't full.
- do {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- } while ( states[index] == FULL && set[index] != val );
- }
-
- // if the index we found was removed: continue probing until we
- // locate a free location or an element which equal()s the
- // one we have.
- if ( states[index] == REMOVED) {
- int firstRemoved = index;
- while ( states[index] != FREE &&
- ( states[index] == REMOVED || set[index] != val ) ) {
- index -= probe;
- if (index < 0) {
- index += length;
- }
- }
- return states[index] == FULL ? -index -1 : firstRemoved;
- }
- // if it's full, the key is already stored
- return states[index] == FULL ? -index -1 : index;
- }
- }
-} // TLongHash
diff --git a/src/gnu/trove/impl/hash/TObjectHash.java b/src/gnu/trove/impl/hash/TObjectHash.java
deleted file mode 100644
index 814a0e0..0000000
--- a/src/gnu/trove/impl/hash/TObjectHash.java
+++ /dev/null
@@ -1,312 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.impl.HashFunctions;
-import gnu.trove.procedure.TObjectProcedure;
-
-import java.util.Arrays;
-import java.io.ObjectOutput;
-import java.io.IOException;
-import java.io.ObjectInput;
-
-
-
-/**
- * An open addressed hashing implementation for Object types.
- *
- * Created: Sun Nov 4 08:56:06 2001
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: TObjectHash.java,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $
- */
-abstract public class TObjectHashTObjectHash instance with the
- * default capacity and load factor.
- */
- public TObjectHash() {
- super();
- }
-
-
- /**
- * Creates a new TObjectHash instance whose capacity
- * is the next highest prime above initialCapacity + 1
- * unless that value is already prime.
- *
- * @param initialCapacity an int value
- */
- public TObjectHash( int initialCapacity ) {
- super( initialCapacity );
- }
-
-
- /**
- * Creates a new TObjectHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param loadFactor used to calculate the threshold over which
- * rehashing takes place.
- */
- public TObjectHash( int initialCapacity, float loadFactor ) {
- super( initialCapacity, loadFactor );
- }
-
-
- public int capacity() {
- return _set.length;
- }
-
-
- protected void removeAt( int index ) {
- _set[index] = REMOVED;
- super.removeAt( index );
- }
-
-
- /**
- * initializes the Object set of this hash table.
- *
- * @param initialCapacity an int value
- * @return an int value
- */
- public int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _set = new Object[capacity];
- Arrays.fill( _set, FREE );
- return capacity;
- }
-
-
- /**
- * Executes procedure for each element in the set.
- *
- * @param procedure a TObjectProcedure value
- * @return false if the loop over the set terminated because
- * the procedure returned false for some value.
- */
- @SuppressWarnings({"unchecked"})
- public boolean forEach( TObjectProcedureObject value
- * @return a boolean value
- */
- @SuppressWarnings({"unchecked"})
- public boolean contains( Object obj ) {
- return index( obj ) >= 0;
- }
-
-
- /**
- * Locates the index of obj.
- *
- * @param obj an Object value
- * @return the index of obj or -1 if it isn't in the set.
- */
- protected int index( Object obj ) {
-
- final Object[] set = _set;
- final int length = set.length;
- final int hash = HashFunctions.hash( obj ) & 0x7fffffff;
- int index = hash % length;
- Object cur = set[index];
-
- if ( cur == obj ) {
- return index;
- }
-
- if ( cur == FREE ) {
- return -1;
- }
-
- // NOTE: here it has to be REMOVED or FULL (some user-given value)
- if ( cur == REMOVED || !cur.equals( obj ) ) {
- // see Knuth, p. 529
- final int probe = 1 + ( hash % ( length - 2 ) );
-
- do {
- index -= probe;
- if ( index < 0 ) {
- index += length;
- }
- cur = set[index];
- } while ( cur != FREE
- && ( cur == REMOVED || !cur.equals( obj ) ) );
- }
-
- return cur == FREE ? -1 : index;
- }
-
-
- /**
- * Locates the index at which obj can be inserted. if
- * there is already a value equal()ing obj in the set,
- * returns that value's index as -index - 1.
- *
- * @param obj an Object value
- * @return the index of a FREE slot at which obj can be inserted
- * or, if obj is already stored in the hash, the negative value of
- * that index, minus 1: -index -1.
- */
- protected int insertionIndex( T obj ) {
-
- final Object[] set = _set;
- final int length = set.length;
- final int hash = HashFunctions.hash( obj ) & 0x7fffffff;
- int index = hash % length;
- Object cur = set[index];
-
- if ( cur == FREE ) {
- return index; // empty, all done
- } else if ( cur == obj || ( cur != REMOVED && cur.equals( obj ) ) ) {
- return -index - 1; // already stored
- } else { // already FULL or REMOVED, must probe
- // compute the double hash
- final int probe = 1 + ( hash % ( length - 2 ) );
-
- // if the slot we landed on is FULL (but not removed), probe
- // until we find an empty slot, a REMOVED slot, or an element
- // equal to the one we are trying to insert.
- // finding an empty slot means that the value is not present
- // and that we should use that slot as the insertion point;
- // finding a REMOVED slot means that we need to keep searching,
- // however we want to remember the offset of that REMOVED slot
- // so we can reuse it in case a "new" insertion (i.e. not an update)
- // is possible.
- // finding a matching value means that we've found that our desired
- // key is already in the table
- if ( cur != REMOVED ) {
- // starting at the natural offset, probe until we find an
- // offset that isn't full.
- do {
- index -= probe;
- if ( index < 0 ) {
- index += length;
- }
- cur = set[index];
- } while ( cur != FREE
- && cur != REMOVED
- && cur != obj
- && !cur.equals( obj ) );
- }
-
- // if the index we found was removed: continue probing until we
- // locate a free location or an element which equal()s the
- // one we have.
- if ( cur == REMOVED ) {
- int firstRemoved = index;
- while ( cur != FREE
- && ( cur == REMOVED || cur != obj || !cur.equals( obj ) ) ) {
- index -= probe;
- if ( index < 0 ) {
- index += length;
- }
- cur = set[index];
- }
- // NOTE: cur cannot == REMOVED in this block
- return ( cur != FREE ) ? -index - 1 : firstRemoved;
- }
- // if it's full, the key is already stored
- // NOTE: cur cannot equal REMOVE here (would have retuned already (see above)
- return ( cur != FREE ) ? -index - 1 : index;
- }
- }
-
-
- /**
- * Convenience methods for subclasses to use in throwing exceptions about
- * badly behaved user objects employed as keys. We have to throw an
- * IllegalArgumentException with a rather verbose message telling the
- * user that they need to fix their object implementation to conform
- * to the general contract for java.lang.Object.
- *
- * @param o1 the first of the equal elements with unequal hash codes.
- * @param o2 the second of the equal elements with unequal hash codes.
- * @throws IllegalArgumentException the whole point of this method.
- */
- protected final void throwObjectContractViolation( Object o1, Object o2 )
- throws IllegalArgumentException {
- throw new IllegalArgumentException( "Equal objects must have equal hashcodes. "
- + "During rehashing, Trove discovered that "
- + "the following two objects claim to be "
- + "equal (as in java.lang.Object.equals()) "
- + "but their hashCodes (or those calculated by "
- + "your TObjectHashingStrategy) are not equal."
- + "This violates the general contract of "
- + "java.lang.Object.hashCode(). See bullet point two "
- + "in that method's documentation. "
- + "object #1 =" + o1
- + "; object #2 =" + o2 );
- }
-
-
- @Override
- public void writeExternal( ObjectOutput out ) throws IOException {
-
- // VERSION
- out.writeByte( 0 );
-
- // SUPER
- super.writeExternal( out );
- }
-
-
- @Override
- public void readExternal( ObjectInput in )
- throws IOException, ClassNotFoundException {
-
- // VERSION
- in.readByte();
-
- // SUPER
- super.readExternal( in );
- }
-} // TObjectHash
diff --git a/src/gnu/trove/impl/hash/TPrimitiveHash.java b/src/gnu/trove/impl/hash/TPrimitiveHash.java
deleted file mode 100644
index d76fb3e..0000000
--- a/src/gnu/trove/impl/hash/TPrimitiveHash.java
+++ /dev/null
@@ -1,135 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.impl.hash;
-
-import gnu.trove.impl.HashFunctions;
-
-
-
-/**
- * The base class for hashtables of primitive values. Since there is
- * no notion of object equality for primitives, it isn't possible to
- * use a `REMOVED' object to track deletions in an open-addressed table.
- * So, we have to resort to using a parallel `bookkeeping' array of bytes,
- * in which flags can be set to indicate that a particular slot in the
- * hash table is FREE, FULL, or REMOVED.
- *
- * @author Eric D. Friedman, Rob Eden, Jeff Randall
- * @version $Id: TPrimitiveHash.java,v 1.1.2.6 2010/03/01 23:39:07 robeden Exp $
- */
-abstract public class TPrimitiveHash extends THash {
-
- /**
- * flags indicating whether each position in the hash is
- * FREE, FULL, or REMOVED
- */
- public transient byte[] _states;
-
- /* constants used for state flags */
-
- /** flag indicating that a slot in the hashtable is available */
- public static final byte FREE = 0;
-
- /** flag indicating that a slot in the hashtable is occupied */
- public static final byte FULL = 1;
-
- /**
- * flag indicating that the value of a slot in the hashtable
- * was deleted
- */
- public static final byte REMOVED = 2;
-
-
- /**
- * Creates a new THash instance with the default
- * capacity and load factor.
- */
- public TPrimitiveHash() {
- super();
- }
-
-
- /**
- * Creates a new TPrimitiveHash instance with a prime
- * capacity at or near the specified capacity and with the default
- * load factor.
- *
- * @param initialCapacity an int value
- */
- public TPrimitiveHash( int initialCapacity ) {
- this( initialCapacity, DEFAULT_LOAD_FACTOR );
- }
-
-
- /**
- * Creates a new TPrimitiveHash instance with a prime
- * capacity at or near the minimum needed to hold
- * initialCapacity elements with load factor
- * loadFactor without triggering a rehash.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- */
- public TPrimitiveHash( int initialCapacity, float loadFactor ) {
- super();
- initialCapacity = Math.max( 1, initialCapacity );
- _loadFactor = loadFactor;
- setUp( HashFunctions.fastCeil( initialCapacity / loadFactor ) );
- }
-
-
- /**
- * Returns the capacity of the hash table. This is the true
- * physical capacity, without adjusting for the load factor.
- *
- * @return the physical capacity of the hash table.
- */
- public int capacity() {
- return _states.length;
- }
-
-
- /**
- * Delete the record at index.
- *
- * @param index an int value
- */
- protected void removeAt( int index ) {
- _states[index] = REMOVED;
- super.removeAt( index );
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _states = new byte[capacity];
- return capacity;
- }
-} // TPrimitiveHash
\ No newline at end of file
diff --git a/src/gnu/trove/impl/package.html b/src/gnu/trove/impl/package.html
deleted file mode 100644
index c803363..0000000
--- a/src/gnu/trove/impl/package.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-This package (and its sub-packages) contain internal implementations used in Trove. These
-classes should not be accessed directly (treat them like com.sun
-classes.
-
\ No newline at end of file
diff --git a/src/gnu/trove/iterator/TAdvancingIterator.java b/src/gnu/trove/iterator/TAdvancingIterator.java
deleted file mode 100644
index 86db71d..0000000
--- a/src/gnu/trove/iterator/TAdvancingIterator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-// ////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// ////////////////////////////////////////////////////////////////////////////
-package gnu.trove.iterator;
-
-/**
- * Common interface for iterators that operate via the "advance" method for moving the
- * cursor to the next element.
- */
-public interface TAdvancingIterator extends TIterator {
- /**
- * Moves the iterator forward to the next entry.
- *
- * @throws java.util.NoSuchElementException if the iterator is already exhausted
- */
- public void advance();
-}
diff --git a/src/gnu/trove/iterator/TDoubleIterator.java b/src/gnu/trove/iterator/TDoubleIterator.java
deleted file mode 100644
index 9c079f5..0000000
--- a/src/gnu/trove/iterator/TDoubleIterator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Iterator for double collections.
- */
-public interface TDoubleIterator extends TIterator {
- /**
- * Advances the iterator to the next element in the underlying collection
- * and returns it.
- *
- * @return the next double in the collection
- * @exception NoSuchElementException if the iterator is already exhausted
- */
- public double next();
-}
diff --git a/src/gnu/trove/iterator/TFloatIterator.java b/src/gnu/trove/iterator/TFloatIterator.java
deleted file mode 100644
index 79acefc..0000000
--- a/src/gnu/trove/iterator/TFloatIterator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Iterator for float collections.
- */
-public interface TFloatIterator extends TIterator {
- /**
- * Advances the iterator to the next element in the underlying collection
- * and returns it.
- *
- * @return the next float in the collection
- * @exception NoSuchElementException if the iterator is already exhausted
- */
- public float next();
-}
diff --git a/src/gnu/trove/iterator/TIntFloatIterator.java b/src/gnu/trove/iterator/TIntFloatIterator.java
deleted file mode 100644
index a28e498..0000000
--- a/src/gnu/trove/iterator/TIntFloatIterator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Iterator for maps of type int and float.
- *
- * The iterator semantics for Trove's primitive maps is slightly different - * from those defined in java.util.Iterator, but still well within - * the scope of the pattern, as defined by Gamma, et al.
- * - *This iterator does not implicitly advance to the next entry when - * the value at the current position is retrieved. Rather, you must explicitly - * ask the iterator to advance() and then retrieve either the key(), - * the value() or both. This is done so that you have the option, but not - * the obligation, to retrieve keys and/or values as your application requires, and - * without introducing wrapper objects that would carry both. As the iteration is - * stateful, access to the key/value parts of the current map entry happens in - * constant time.
- * - *In practice, the iterator is akin to a "search finger" that you move from - * position to position. Read or write operations affect the current entry only and - * do not assume responsibility for moving the finger.
- * - *Here are some sample scenarios for this class of iterator:
- * - *
- * // accessing keys/values through an iterator:
- * for ( TIntFloatIterator it = map.iterator(); it.hasNext(); ) {
- * it.advance();
- * if ( satisfiesCondition( it.key() ) {
- * doSomethingWithValue( it.value() );
- * }
- * }
- *
- *
- *
- * // modifying values in-place through iteration:
- * for ( TIntFloatIterator it = map.iterator(); it.hasNext(); ) {
- * it.advance();
- * if ( satisfiesCondition( it.key() ) {
- * it.setValue( newValueForKey( it.key() ) );
- * }
- * }
- *
- *
- *
- * // deleting entries during iteration:
- * for ( TIntFloatIterator it = map.iterator(); it.hasNext(); ) {
- * it.advance();
- * if ( satisfiesCondition( it.key() ) {
- * it.remove();
- * }
- * }
- *
- *
- *
- * // faster iteration by avoiding hasNext():
- * TIntFloatIterator iterator = map.iterator();
- * for ( int i = map.size(); i-- > 0; ) {
- * iterator.advance();
- * doSomethingWithKeyAndValue( iterator.key(), iterator.value() );
- * }
- *
- */
-public interface TIntFloatIterator extends TAdvancingIterator {
- /**
- * Provides access to the key of the mapping at the iterator's position.
- * Note that you must advance() the iterator at least once
- * before invoking this method.
- *
- * @return the key of the entry at the iterator's current position.
- */
- public int key();
-
- /**
- * Provides access to the value of the mapping at the iterator's position.
- * Note that you must advance() the iterator at least once
- * before invoking this method.
- *
- * @return the value of the entry at the iterator's current position.
- */
- public float value();
-
- /**
- * Replace the value of the mapping at the iterator's position with the
- * specified value. Note that you must advance() the iterator at
- * least once before invoking this method.
- *
- * @param val the value to set in the current entry
- * @return the old value of the entry.
- */
- public float setValue( float val );
-}
diff --git a/src/gnu/trove/iterator/TIntIterator.java b/src/gnu/trove/iterator/TIntIterator.java
deleted file mode 100644
index 3e1fdd2..0000000
--- a/src/gnu/trove/iterator/TIntIterator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Iterator for int collections.
- */
-public interface TIntIterator extends TIterator {
- /**
- * Advances the iterator to the next element in the underlying collection
- * and returns it.
- *
- * @return the next int in the collection
- * @exception NoSuchElementException if the iterator is already exhausted
- */
- public int next();
-}
diff --git a/src/gnu/trove/iterator/TIterator.java b/src/gnu/trove/iterator/TIterator.java
deleted file mode 100644
index efdf22e..0000000
--- a/src/gnu/trove/iterator/TIterator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-package gnu.trove.iterator;
-
-/**
- * Common interface for all iterators used in Trove.
- */
-public interface TIterator {
- /**
- * Returns true if the iterator can be advanced past its current location.
- *
- * @return a boolean value
- */
- public boolean hasNext();
-
- /**
- * Removes the last entry returned by the iterator. The result of invoking this method
- * more than once for a single entry is undefined and can leave the underlying data
- * structure in a confused state.
- */
- public void remove();
-}
diff --git a/src/gnu/trove/iterator/TLongDoubleIterator.java b/src/gnu/trove/iterator/TLongDoubleIterator.java
deleted file mode 100644
index 2d3487a..0000000
--- a/src/gnu/trove/iterator/TLongDoubleIterator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Iterator for maps of type long and double.
- *
- * The iterator semantics for Trove's primitive maps is slightly different - * from those defined in java.util.Iterator, but still well within - * the scope of the pattern, as defined by Gamma, et al.
- * - *This iterator does not implicitly advance to the next entry when - * the value at the current position is retrieved. Rather, you must explicitly - * ask the iterator to advance() and then retrieve either the key(), - * the value() or both. This is done so that you have the option, but not - * the obligation, to retrieve keys and/or values as your application requires, and - * without introducing wrapper objects that would carry both. As the iteration is - * stateful, access to the key/value parts of the current map entry happens in - * constant time.
- * - *In practice, the iterator is akin to a "search finger" that you move from - * position to position. Read or write operations affect the current entry only and - * do not assume responsibility for moving the finger.
- * - *Here are some sample scenarios for this class of iterator:
- * - *
- * // accessing keys/values through an iterator:
- * for ( TLongDoubleIterator it = map.iterator(); it.hasNext(); ) {
- * it.advance();
- * if ( satisfiesCondition( it.key() ) {
- * doSomethingWithValue( it.value() );
- * }
- * }
- *
- *
- *
- * // modifying values in-place through iteration:
- * for ( TLongDoubleIterator it = map.iterator(); it.hasNext(); ) {
- * it.advance();
- * if ( satisfiesCondition( it.key() ) {
- * it.setValue( newValueForKey( it.key() ) );
- * }
- * }
- *
- *
- *
- * // deleting entries during iteration:
- * for ( TLongDoubleIterator it = map.iterator(); it.hasNext(); ) {
- * it.advance();
- * if ( satisfiesCondition( it.key() ) {
- * it.remove();
- * }
- * }
- *
- *
- *
- * // faster iteration by avoiding hasNext():
- * TLongDoubleIterator iterator = map.iterator();
- * for ( int i = map.size(); i-- > 0; ) {
- * iterator.advance();
- * doSomethingWithKeyAndValue( iterator.key(), iterator.value() );
- * }
- *
- */
-public interface TLongDoubleIterator extends TAdvancingIterator {
- /**
- * Provides access to the key of the mapping at the iterator's position.
- * Note that you must advance() the iterator at least once
- * before invoking this method.
- *
- * @return the key of the entry at the iterator's current position.
- */
- public long key();
-
- /**
- * Provides access to the value of the mapping at the iterator's position.
- * Note that you must advance() the iterator at least once
- * before invoking this method.
- *
- * @return the value of the entry at the iterator's current position.
- */
- public double value();
-
- /**
- * Replace the value of the mapping at the iterator's position with the
- * specified value. Note that you must advance() the iterator at
- * least once before invoking this method.
- *
- * @param val the value to set in the current entry
- * @return the old value of the entry.
- */
- public double setValue( double val );
-}
diff --git a/src/gnu/trove/iterator/TLongIterator.java b/src/gnu/trove/iterator/TLongIterator.java
deleted file mode 100644
index 2798501..0000000
--- a/src/gnu/trove/iterator/TLongIterator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Iterator for long collections.
- */
-public interface TLongIterator extends TIterator {
- /**
- * Advances the iterator to the next element in the underlying collection
- * and returns it.
- *
- * @return the next long in the collection
- * @exception NoSuchElementException if the iterator is already exhausted
- */
- public long next();
-}
diff --git a/src/gnu/trove/iterator/TPrimitiveIterator.java b/src/gnu/trove/iterator/TPrimitiveIterator.java
deleted file mode 100644
index 5693c3a..0000000
--- a/src/gnu/trove/iterator/TPrimitiveIterator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-/**
- * Implements all iterator functions for the hashed object set.
- * Subclasses may override objectAtIndex to vary the object
- * returned by calls to next() (e.g. for values, and Map.Entry
- * objects).
- *
- * Note that iteration is fastest if you forego the calls to - * hasNext in favor of checking the size of the structure - * yourself and then call next() that many times: - *
- *
- * Iterator i = collection.iterator();
- * for (int size = collection.size(); size-- > 0;) {
- * Object o = i.next();
- * }
- *
- *
- * You may, of course, use the hasNext(), next() idiom too if - * you aren't in a performance critical spot.
- */ -public interface TPrimitiveIterator extends TIterator { - /** - * Returns true if the iterator can be advanced past its current - * location. - * - * @return aboolean value
- */
- public boolean hasNext();
-
-
- /**
- * Removes the last entry returned by the iterator.
- * Invoking this method more than once for a single entry
- * will leave the underlying data structure in a confused
- * state.
- */
- public void remove();
-
-} // TPrimitiveIterator
diff --git a/src/gnu/trove/iterator/TShortIterator.java b/src/gnu/trove/iterator/TShortIterator.java
deleted file mode 100644
index 63724c2..0000000
--- a/src/gnu/trove/iterator/TShortIterator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.iterator;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Iterator for short collections.
- */
-public interface TShortIterator extends TIterator {
- /**
- * Advances the iterator to the next element in the underlying collection
- * and returns it.
- *
- * @return the next short in the collection
- * @exception NoSuchElementException if the iterator is already exhausted
- */
- public short next();
-}
diff --git a/src/gnu/trove/iterator/hash/TObjectHashIterator.java b/src/gnu/trove/iterator/hash/TObjectHashIterator.java
deleted file mode 100644
index 3f47c55..0000000
--- a/src/gnu/trove/iterator/hash/TObjectHashIterator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-
-package gnu.trove.iterator.hash;
-
-import gnu.trove.impl.hash.TObjectHash;
-import gnu.trove.impl.hash.THashIterator;
-
-
-/**
- * Iterator for hashtables that use open addressing to resolve collisions.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: TObjectHashIterator.java,v 1.1.2.4 2009/10/09 01:44:34 robeden Exp $
- */
-
-public class TObjectHashIteratorint value
- * @param value an float value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public float put( int key, float value );
-
-
- /**
- * Inserts a key/value pair into the map if the specified key is not already
- * associated with a value.
- *
- * @param key an int value
- * @param value an float value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public float putIfAbsent( int key, float value );
-
-
- /**
- * Put all the entries from the given Map into this map.
- *
- * @param map The Map from which entries will be obtained to put into this map.
- */
- public void putAll( Map extends Integer, ? extends Float> map );
-
-
- /**
- * Put all the entries from the given map into this map.
- *
- * @param map The map from which entries will be obtained to put into this map.
- */
- public void putAll( TIntFloatMap map );
-
-
- /**
- * Retrieves the value for key
- *
- * @param key an int value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public float get( int key );
-
-
- /**
- * Empties the map.
- */
- public void clear();
-
-
- /**
- * Returns true if this map contains no key-value mappings.
- *
- * @return true if this map contains no key-value mappings
- */
- public boolean isEmpty();
-
-
- /**
- * Deletes a key/value pair from the map.
- *
- * @param key an int value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public float remove( int key );
-
-
- /**
- * Returns an int value that is the number of elements in the map.
- *
- * @return an int value that is the number of elements in the map.
- */
- public int size();
-
-
- /**
- * Returns the keys of the map as a TIntSet
- *
- * @return the keys of the map as a TIntSet
- */
- public TIntSet keySet();
-
-
- /**
- * Returns the keys of the map as an array of int values.
- *
- * @return the keys of the map as an array of int values.
- */
- public int[] keys();
-
-
- /**
- * Returns the keys of the map.
- *
- * @param array the array into which the elements of the list are to be stored,
- * if it is big enough; otherwise, a new array of the same type is
- * allocated for this purpose.
- * @return the keys of the map as an array.
- */
- public int[] keys( int[] array );
-
-
- /**
- * Returns the values of the map as a TFloatCollection
- *
- * @return the values of the map as a TFloatCollection
- */
- public TFloatCollection valueCollection();
-
-
- /**
- * Returns the values of the map as an array of #e# values.
- *
- * @return the values of the map as an array of #e# values.
- */
- public float[] values();
-
-
- /**
- * Returns the values of the map using an existing array.
- *
- * @param array the array into which the elements of the list are to be stored,
- * if it is big enough; otherwise, a new array of the same type is
- * allocated for this purpose.
- * @return the values of the map as an array of #e# values.
- */
- public float[] values( float[] array );
-
-
- /**
- * Checks for the presence of val in the values of the map.
- *
- * @param val an float value
- * @return a boolean value
- */
- public boolean containsValue( float val );
-
-
- /**
- * Checks for the present of key in the keys of the map.
- *
- * @param key an int value
- * @return a boolean value
- */
- public boolean containsKey( int key );
-
-
- /**
- * @return a TIntFloatIterator with access to this map's keys and values
- */
- public TIntFloatIterator iterator();
-
-
- /**
- * Executes procedure for each key in the map.
- *
- * @param procedure a TIntProcedure value
- * @return false if the loop over the keys terminated because
- * the procedure returned false for some key.
- */
- public boolean forEachKey( TIntProcedure procedure );
-
-
- /**
- * Executes procedure for each value in the map.
- *
- * @param procedure a T#F#Procedure value
- * @return false if the loop over the values terminated because
- * the procedure returned false for some value.
- */
- public boolean forEachValue( TFloatProcedure procedure );
-
-
- /**
- * Executes procedure for each key/value entry in the
- * map.
- *
- * @param procedure a TOIntFloatProcedure value
- * @return false if the loop over the entries terminated because
- * the procedure returned false for some entry.
- */
- public boolean forEachEntry( TIntFloatProcedure procedure );
-
-
- /**
- * Transform the values in this map using function.
- *
- * @param function a TFloatFunction value
- */
- public void transformValues( TFloatFunction function );
-
-
- /**
- * Retains only those entries in the map for which the procedure
- * returns a true value.
- *
- * @param procedure determines which entries to keep
- * @return true if the map was modified.
- */
- public boolean retainEntries( TIntFloatProcedure procedure );
-
-
- /**
- * Increments the primitive value mapped to key by 1
- *
- * @param key the key of the value to increment
- * @return true if a mapping was found and modified.
- */
- public boolean increment( int key );
-
-
- /**
- * Adjusts the primitive value mapped to key.
- *
- * @param key the key of the value to increment
- * @param amount the amount to adjust the value by.
- * @return true if a mapping was found and modified.
- */
- public boolean adjustValue( int key, float amount );
-
-
- /**
- * Adjusts the primitive value mapped to the key if the key is present in the map.
- * Otherwise, the initial_value is put in the map.
- *
- * @param key the key of the value to increment
- * @param adjust_amount the amount to adjust the value by
- * @param put_amount the value put into the map if the key is not initial present
- *
- * @return the value present in the map after the adjustment or put operation
- */
- public float adjustOrPutValue( int key, float adjust_amount, float put_amount );
-}
diff --git a/src/gnu/trove/map/TLongDoubleMap.java b/src/gnu/trove/map/TLongDoubleMap.java
deleted file mode 100644
index db4760a..0000000
--- a/src/gnu/trove/map/TLongDoubleMap.java
+++ /dev/null
@@ -1,303 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.map;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-import gnu.trove.function.*;
-import gnu.trove.iterator.*;
-import gnu.trove.procedure.*;
-import gnu.trove.set.*;
-import gnu.trove.TDoubleCollection;
-
-import java.util.Map;
-import java.io.Serializable;
-
-
-/**
- * Interface for a primitive map of long keys and double values.
- */
-public interface TLongDoubleMap extends Serializable {
-
- /**
- * Returns the value that will be returned from {@link #get} or {@link #put} if no
- * entry exists for a given key. The default value is generally zero, but can be
- * changed during construction of the collection.
- *
- * @return the value that represents a null key in this collection.
- */
- public long getNoEntryKey();
-
-
- /**
- * Returns the value that will be returned from {@link #get} or {@link #put} if no
- * entry exists for a given key. The default value is generally zero, but can be
- * changed during construction of the collection.
- *
- * @return the value that represents a null value in this collection.
- */
- public double getNoEntryValue();
-
-
- /**
- * Inserts a key/value pair into the map.
- *
- * @param key an long value
- * @param value an double value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public double put( long key, double value );
-
-
- /**
- * Inserts a key/value pair into the map if the specified key is not already
- * associated with a value.
- *
- * @param key an long value
- * @param value an double value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public double putIfAbsent( long key, double value );
-
-
- /**
- * Put all the entries from the given Map into this map.
- *
- * @param map The Map from which entries will be obtained to put into this map.
- */
- public void putAll( Map extends Long, ? extends Double> map );
-
-
- /**
- * Put all the entries from the given map into this map.
- *
- * @param map The map from which entries will be obtained to put into this map.
- */
- public void putAll( TLongDoubleMap map );
-
-
- /**
- * Retrieves the value for key
- *
- * @param key an long value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public double get( long key );
-
-
- /**
- * Empties the map.
- */
- public void clear();
-
-
- /**
- * Returns true if this map contains no key-value mappings.
- *
- * @return true if this map contains no key-value mappings
- */
- public boolean isEmpty();
-
-
- /**
- * Deletes a key/value pair from the map.
- *
- * @param key an long value
- *
- * @return the previous value associated with key, or the "no entry" value
- * if none was found (see {@link #getNoEntryValue}).
- */
- public double remove( long key );
-
-
- /**
- * Returns an int value that is the number of elements in the map.
- *
- * @return an int value that is the number of elements in the map.
- */
- public int size();
-
-
- /**
- * Returns the keys of the map as a TLongSet
- *
- * @return the keys of the map as a TLongSet
- */
- public TLongSet keySet();
-
-
- /**
- * Returns the keys of the map as an array of long values.
- *
- * @return the keys of the map as an array of long values.
- */
- public long[] keys();
-
-
- /**
- * Returns the keys of the map.
- *
- * @param array the array into which the elements of the list are to be stored,
- * if it is big enough; otherwise, a new array of the same type is
- * allocated for this purpose.
- * @return the keys of the map as an array.
- */
- public long[] keys( long[] array );
-
-
- /**
- * Returns the values of the map as a TDoubleCollection
- *
- * @return the values of the map as a TDoubleCollection
- */
- public TDoubleCollection valueCollection();
-
-
- /**
- * Returns the values of the map as an array of #e# values.
- *
- * @return the values of the map as an array of #e# values.
- */
- public double[] values();
-
-
- /**
- * Returns the values of the map using an existing array.
- *
- * @param array the array into which the elements of the list are to be stored,
- * if it is big enough; otherwise, a new array of the same type is
- * allocated for this purpose.
- * @return the values of the map as an array of #e# values.
- */
- public double[] values( double[] array );
-
-
- /**
- * Checks for the presence of val in the values of the map.
- *
- * @param val an double value
- * @return a boolean value
- */
- public boolean containsValue( double val );
-
-
- /**
- * Checks for the present of key in the keys of the map.
- *
- * @param key an long value
- * @return a boolean value
- */
- public boolean containsKey( long key );
-
-
- /**
- * @return a TLongDoubleIterator with access to this map's keys and values
- */
- public TLongDoubleIterator iterator();
-
-
- /**
- * Executes procedure for each key in the map.
- *
- * @param procedure a TLongProcedure value
- * @return false if the loop over the keys terminated because
- * the procedure returned false for some key.
- */
- public boolean forEachKey( TLongProcedure procedure );
-
-
- /**
- * Executes procedure for each value in the map.
- *
- * @param procedure a T#F#Procedure value
- * @return false if the loop over the values terminated because
- * the procedure returned false for some value.
- */
- public boolean forEachValue( TDoubleProcedure procedure );
-
-
- /**
- * Executes procedure for each key/value entry in the
- * map.
- *
- * @param procedure a TOLongDoubleProcedure value
- * @return false if the loop over the entries terminated because
- * the procedure returned false for some entry.
- */
- public boolean forEachEntry( TLongDoubleProcedure procedure );
-
-
- /**
- * Transform the values in this map using function.
- *
- * @param function a TDoubleFunction value
- */
- public void transformValues( TDoubleFunction function );
-
-
- /**
- * Retains only those entries in the map for which the procedure
- * returns a true value.
- *
- * @param procedure determines which entries to keep
- * @return true if the map was modified.
- */
- public boolean retainEntries( TLongDoubleProcedure procedure );
-
-
- /**
- * Increments the primitive value mapped to key by 1
- *
- * @param key the key of the value to increment
- * @return true if a mapping was found and modified.
- */
- public boolean increment( long key );
-
-
- /**
- * Adjusts the primitive value mapped to key.
- *
- * @param key the key of the value to increment
- * @param amount the amount to adjust the value by.
- * @return true if a mapping was found and modified.
- */
- public boolean adjustValue( long key, double amount );
-
-
- /**
- * Adjusts the primitive value mapped to the key if the key is present in the map.
- * Otherwise, the initial_value is put in the map.
- *
- * @param key the key of the value to increment
- * @param adjust_amount the amount to adjust the value by
- * @param put_amount the value put into the map if the key is not initial present
- *
- * @return the value present in the map after the adjustment or put operation
- */
- public double adjustOrPutValue( long key, double adjust_amount, double put_amount );
-}
diff --git a/src/gnu/trove/map/hash/THashMap.java b/src/gnu/trove/map/hash/THashMap.java
deleted file mode 100644
index 3400eff..0000000
--- a/src/gnu/trove/map/hash/THashMap.java
+++ /dev/null
@@ -1,898 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.map.hash;
-
-import gnu.trove.impl.hash.TObjectHash;
-import gnu.trove.impl.HashFunctions;
-import gnu.trove.procedure.TObjectProcedure;
-import gnu.trove.procedure.TObjectObjectProcedure;
-import gnu.trove.function.TObjectFunction;
-import gnu.trove.iterator.hash.TObjectHashIterator;
-
-import java.io.*;
-import java.util.*;
-
-
-
-/**
- * An implementation of the Map interface which uses an open addressed
- * hash table to store its contents.
- *
- * Created: Sun Nov 4 08:52:45 2001
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: THashMap.java,v 1.1.2.8 2010/03/02 04:09:50 robeden Exp $
- */
-
-public class THashMapTHashMap instance with the default
- * capacity and load factor.
- */
- public THashMap() {
- super();
- }
-
-
- /**
- * Creates a new THashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the default load factor.
- *
- * @param initialCapacity an int value
- */
- public THashMap( int initialCapacity ) {
- super( initialCapacity );
- }
-
-
- /**
- * Creates a new THashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the specified load factor.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- */
- public THashMap( int initialCapacity, float loadFactor ) {
- super( initialCapacity, loadFactor );
- }
-
-
- /**
- * Creates a new THashMap instance which contains the
- * key/value pairs in map.
- *
- * @param map a Map value
- */
- public THashMap( MapTHashMap instance which contains the
- * key/value pairs in map.
- *
- * @param map a Map value
- */
- public THashMap( THashMapint value
- * @return an int value
- */
- public int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- //noinspection unchecked
- _values = (V[]) new Object[capacity];
- return capacity;
- }
-
-
- /**
- * Inserts a key/value pair into the map.
- *
- * @param key an Object value
- * @param value an Object value
- * @return the previous value associated with key,
- * or {@code null} if none was found.
- */
- public V put( K key, V value ) {
- int index = insertionIndex( key );
- return doPut( key, value, index );
- }
-
-
- /**
- * Inserts a key/value pair into the map if the specified key is not already
- * associated with a value.
- *
- * @param key an Object value
- * @param value an Object value
- * @return the previous value associated with key,
- * or {@code null} if none was found.
- */
- public V putIfAbsent( K key, V value ) {
- int index = insertionIndex( key );
- if ( index < 0 ) {
- return _values[-index - 1];
- }
- return doPut( key, value, index );
- }
-
-
- private V doPut( K key, V value, int index ) {
- V previous = null;
- Object oldKey;
- boolean isNewMapping = true;
- if ( index < 0 ) {
- index = -index - 1;
- previous = _values[index];
- isNewMapping = false;
- }
- oldKey = _set[index];
- _set[index] = key;
- _values[index] = value;
- if ( isNewMapping ) {
- postInsertHook( oldKey == FREE );
- }
-
- return previous;
- }
-
-
- /**
- * Compares this map with another map for equality of their stored
- * entries.
- *
- * @param other an Object value
- * @return a boolean value
- */
- @SuppressWarnings({"unchecked", "SimplifiableIfStatement"})
- public boolean equals( Object other ) {
- if ( !( other instanceof Map ) ) {
- return false;
- }
- MapTObjectProcedure value
- * @return false if the loop over the keys terminated because
- * the procedure returned false for some key.
- */
- public boolean forEachKey( TObjectProcedureTObjectProcedure value
- * @return false if the loop over the values terminated because
- * the procedure returned false for some value.
- */
- public boolean forEachValue( TObjectProcedureTObjectObjectProcedure value
- * @return false if the loop over the entries terminated because
- * the procedure returned false for some entry.
- */
- @SuppressWarnings({"unchecked"})
- public boolean forEachEntry( TObjectObjectProcedureTObjectFunction value
- */
- public void transformValues( TObjectFunctionint value
- */
- @SuppressWarnings({"unchecked"})
- protected void rehash( int newCapacity ) {
- int oldCapacity = _set.length;
-
- Object oldKeys[] = _set;
- V oldVals[] = _values;
-
- _set = new Object[ newCapacity ];
- Arrays.fill( _set, FREE );
- _values = ( V[] ) new Object[ newCapacity ];
-
- // Process entries from the old array, skipping free and removed slots. Put the
- // values into the appropriate place in the new array.
- for ( int i = oldCapacity; i-- > 0; ) {
- if ( oldKeys[ i ] == FREE || oldKeys[ i ] == REMOVED ) continue;
-
- Object o = oldKeys[ i ];
- int index = insertionIndex( ( K ) o );
- if ( index < 0 ) {
- throwObjectContractViolation( _set[ ( -index - 1 ) ], o );
- }
- _set[ index ] = o;
- _values[ index ] = oldVals[ i ];
- }
- }
-
-
- /**
- * retrieves the value for key
- *
- * @param key an Object value
- * @return the value of key or null if no such mapping exists.
- */
- @SuppressWarnings({"unchecked"})
- public V get( Object key ) {
- int index = index( key );
- if ( index < 0 || ! _set[index].equals( key ) ) {
- return null;
- }
- return _values[index];
- }
-
-
- /** Empties the map. */
- public void clear() {
- if ( size() == 0 ) {
- return; // optimization
- }
-
- super.clear();
-
- Arrays.fill( _set, 0, _set.length, FREE );
- Arrays.fill( _values, 0, _values.length, null );
- }
-
-
- /**
- * Deletes a key/value pair from the map.
- *
- * @param key an Object value
- * @return an Object value
- */
- @SuppressWarnings({"unchecked"})
- public V remove( Object key ) {
- V prev = null;
- int index = index( key );
- if ( index >= 0 ) {
- prev = _values[index];
- removeAt( index ); // clear key,state; adjust size
- }
- return prev;
- }
-
-
- /**
- * removes the mapping at index from the map.
- *
- * @param index an int value
- */
- public void removeAt( int index ) {
- _values[index] = null;
- super.removeAt( index ); // clear key, state; adjust size
- }
-
-
- /**
- * Returns a view on the values of the map.
- *
- * @return a Collection value
- */
- public CollectionSet value
- */
- public SetSet value
- */
- public SetObject value
- * @return a boolean value
- */
- public boolean containsValue( Object val ) {
- Object[] set = _set;
- V[] vals = _values;
-
- // special case null values so that we don't have to
- // perform null checks before every call to equals()
- if ( null == val ) {
- for ( int i = vals.length; i-- > 0; ) {
- if ( ( set[i] != FREE && set[i] != REMOVED ) &&
- val == vals[i] ) {
- return true;
- }
- }
- } else {
- for ( int i = vals.length; i-- > 0; ) {
- if ( ( set[i] != FREE && set[i] != REMOVED ) &&
- ( val == vals[i] || val.equals( vals[i] ) ) ) {
- return true;
- }
- }
- } // end of else
- return false;
- }
-
-
- /**
- * checks for the present of key in the keys of the map.
- *
- * @param key an Object value
- * @return a boolean value
- */
- public boolean containsKey( Object key ) {
- return contains( key );
- }
-
-
- /**
- * copies the key/value mappings in map into this map.
- *
- * @param map a Map value
- */
- public void putAll( Map extends K, ? extends V> map ) {
- ensureCapacity( map.size() );
- // could optimize this for cases when map instanceof THashMap
- for ( Map.Entry extends K, ? extends V> e : map.entrySet() ) {
- put( e.getKey(), e.getValue() );
- }
- }
-
-
- /** a view onto the values of the map. */
- protected class ValueView extends MapBackedViewTIntFloatHashMap instance with the default
- * capacity and load factor.
- */
- public TIntFloatHashMap() {
- super();
- }
-
-
- /**
- * Creates a new TIntFloatHashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the default load factor.
- *
- * @param initialCapacity an int value
- */
- public TIntFloatHashMap( int initialCapacity ) {
- super( initialCapacity );
- }
-
-
- /**
- * Creates a new TIntFloatHashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the specified load factor.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- */
- public TIntFloatHashMap( int initialCapacity, float loadFactor ) {
- super( initialCapacity, loadFactor );
- }
-
-
- /**
- * Creates a new TIntFloatHashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the specified load factor.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- * @param noEntryKey a int value that represents
- * null for the Key set.
- * @param noEntryValue a float value that represents
- * null for the Value set.
- */
- public TIntFloatHashMap( int initialCapacity, float loadFactor,
- int noEntryKey, float noEntryValue ) {
- super( initialCapacity, loadFactor, noEntryKey, noEntryValue );
- }
-
-
- /**
- * Creates a new TIntFloatHashMap instance containing
- * all of the entries in the map passed in.
- *
- * @param keys a int array containing the keys for the matching values.
- * @param values a float array containing the values.
- */
- public TIntFloatHashMap( int[] keys, float[] values ) {
- super( Math.max( keys.length, values.length ) );
-
- int size = Math.min( keys.length, values.length );
- for ( int i = 0; i < size; i++ ) {
- this.put( keys[i], values[i] );
- }
- }
-
-
- /**
- * Creates a new TIntFloatHashMap instance containing
- * all of the entries in the map passed in.
- *
- * @param map a TIntFloatMap that will be duplicated.
- */
- public TIntFloatHashMap( TIntFloatMap map ) {
- super( map.size() );
- if ( map instanceof TIntFloatHashMap ) {
- TIntFloatHashMap hashmap = ( TIntFloatHashMap ) map;
- this._loadFactor = hashmap._loadFactor;
- this.no_entry_key = hashmap.no_entry_key;
- this.no_entry_value = hashmap.no_entry_value;
- //noinspection RedundantCast
- if ( this.no_entry_key != ( int ) 0 ) {
- Arrays.fill( _set, this.no_entry_key );
- }
- //noinspection RedundantCast
- if ( this.no_entry_value != ( float ) 0 ) {
- Arrays.fill( _values, this.no_entry_value );
- }
- setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
- }
- putAll( map );
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _values = new float[capacity];
- return capacity;
- }
-
-
- /**
- * rehashes the map to the new capacity.
- *
- * @param newCapacity an int value
- */
- /** {@inheritDoc} */
- protected void rehash( int newCapacity ) {
- int oldCapacity = _set.length;
-
- int oldKeys[] = _set;
- float oldVals[] = _values;
- byte oldStates[] = _states;
-
- _set = new int[newCapacity];
- _values = new float[newCapacity];
- _states = new byte[newCapacity];
-
- for ( int i = oldCapacity; i-- > 0; ) {
- if( oldStates[i] == FULL ) {
- int o = oldKeys[i];
- int index = insertionIndex( o );
- _set[index] = o;
- _values[index] = oldVals[i];
- _states[index] = FULL;
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public float put( int key, float value ) {
- int index = insertionIndex( key );
- return doPut( key, value, index );
- }
-
-
- /** {@inheritDoc} */
- public float putIfAbsent( int key, float value ) {
- int index = insertionIndex( key );
- if (index < 0)
- return _values[-index - 1];
- return doPut( key, value, index );
- }
-
-
- private float doPut( int key, float value, int index ) {
- byte previousState;
- float previous = no_entry_value;
- boolean isNewMapping = true;
- if ( index < 0 ) {
- index = -index -1;
- previous = _values[index];
- isNewMapping = false;
- }
- previousState = _states[index];
- _set[index] = key;
- _states[index] = FULL;
- _values[index] = value;
- if (isNewMapping) {
- postInsertHook( previousState == FREE );
- }
-
- return previous;
- }
-
-
- /** {@inheritDoc} */
- public void putAll( Map extends Integer, ? extends Float> map ) {
- ensureCapacity( map.size() );
- // could optimize this for cases when map instanceof THashMap
- for ( Map.Entry extends Integer, ? extends Float> entry : map.entrySet() ) {
- this.put( entry.getKey().intValue(), entry.getValue().floatValue() );
- }
- }
-
-
- /** {@inheritDoc} */
- public void putAll( TIntFloatMap map ) {
- ensureCapacity( map.size() );
- TIntFloatIterator iter = map.iterator();
- while ( iter.hasNext() ) {
- iter.advance();
- this.put( iter.key(), iter.value() );
- }
- }
-
-
- /** {@inheritDoc} */
- public float get( int key ) {
- int index = index( key );
- return index < 0 ? no_entry_value : _values[index];
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- super.clear();
- Arrays.fill( _set, 0, _set.length, no_entry_key );
- Arrays.fill( _values, 0, _values.length, no_entry_value );
- Arrays.fill( _states, 0, _states.length, FREE );
- }
-
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return 0 == _size;
- }
-
-
- /** {@inheritDoc} */
- public float remove( int key ) {
- float prev = no_entry_value;
- int index = index( key );
- if ( index >= 0 ) {
- prev = _values[index];
- removeAt( index ); // clear key,state; adjust size
- }
- return prev;
- }
-
-
- /** {@inheritDoc} */
- protected void removeAt( int index ) {
- _values[index] = no_entry_value;
- super.removeAt( index ); // clear key, state; adjust size
- }
-
-
- /** {@inheritDoc} */
- public TIntSet keySet() {
- return new TKeyView();
- }
-
-
- /** {@inheritDoc} */
- public int[] keys() {
- int[] keys = new int[size()];
- int[] k = _set;
- byte[] states = _states;
-
- for ( int i = k.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- keys[j++] = k[i];
- }
- }
- return keys;
- }
-
-
- /** {@inheritDoc} */
- public int[] keys( int[] array ) {
- int size = size();
- if ( array.length < size ) {
- array = new int[size];
- }
-
- int[] keys = _set;
- byte[] states = _states;
-
- for ( int i = keys.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- array[j++] = keys[i];
- }
- }
- return array;
- }
-
-
- /** {@inheritDoc} */
- public TFloatCollection valueCollection() {
- return new TValueView();
- }
-
-
- /** {@inheritDoc} */
- public float[] values() {
- float[] vals = new float[size()];
- float[] v = _values;
- byte[] states = _states;
-
- for ( int i = v.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- vals[j++] = v[i];
- }
- }
- return vals;
- }
-
-
- /** {@inheritDoc} */
- public float[] values( float[] array ) {
- int size = size();
- if ( array.length < size ) {
- array = new float[size];
- }
-
- float[] v = _values;
- byte[] states = _states;
-
- for ( int i = v.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- array[j++] = v[i];
- }
- }
- return array;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsValue( float val ) {
- byte[] states = _states;
- float[] vals = _values;
-
- for ( int i = vals.length; i-- > 0; ) {
- if ( states[i] == FULL && val == vals[i] ) {
- return true;
- }
- }
- return false;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsKey( int key ) {
- return contains( key );
- }
-
-
- /** {@inheritDoc} */
- public TIntFloatIterator iterator() {
- return new TIntFloatHashIterator( this );
- }
-
-
- /** {@inheritDoc} */
- public boolean forEachKey( TIntProcedure procedure ) {
- return forEach( procedure );
- }
-
-
- /** {@inheritDoc} */
- public boolean forEachValue( TFloatProcedure procedure ) {
- byte[] states = _states;
- float[] values = _values;
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( values[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean forEachEntry( TIntFloatProcedure procedure ) {
- byte[] states = _states;
- int[] keys = _set;
- float[] values = _values;
- for ( int i = keys.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public void transformValues( TFloatFunction function ) {
- byte[] states = _states;
- float[] values = _values;
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL ) {
- values[i] = function.execute( values[i] );
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public boolean retainEntries( TIntFloatProcedure procedure ) {
- boolean modified = false;
- byte[] states = _states;
- int[] keys = _set;
- float[] values = _values;
-
-
- // Temporarily disable compaction. This is a fix for bug #1738760
- tempDisableAutoCompaction();
- try {
- for ( int i = keys.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
- removeAt( i );
- modified = true;
- }
- }
- }
- finally {
- reenableAutoCompaction( true );
- }
-
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean increment( int key ) {
- return adjustValue( key, ( float ) 1 );
- }
-
-
- /** {@inheritDoc} */
- public boolean adjustValue( int key, float amount ) {
- int index = index( key );
- if (index < 0) {
- return false;
- } else {
- _values[index] += amount;
- return true;
- }
- }
-
-
- /** {@inheritDoc} */
- public float adjustOrPutValue( int key, float adjust_amount, float put_amount ) {
- int index = insertionIndex( key );
- final boolean isNewMapping;
- final float newValue;
- if ( index < 0 ) {
- index = -index -1;
- newValue = ( _values[index] += adjust_amount );
- isNewMapping = false;
- } else {
- newValue = ( _values[index] = put_amount );
- isNewMapping = true;
- }
-
- byte previousState = _states[index];
- _set[index] = key;
- _states[index] = FULL;
-
- if ( isNewMapping ) {
- postInsertHook(previousState == FREE);
- }
-
- return newValue;
- }
-
-
- /** a view onto the keys of the map. */
- protected class TKeyView implements TIntSet {
-
- /** {@inheritDoc} */
- public TIntIterator iterator() {
- return new TIntFloatKeyHashIterator( TIntFloatHashMap.this );
- }
-
-
- /** {@inheritDoc} */
- public int getNoEntryValue() {
- return no_entry_key;
- }
-
-
- /** {@inheritDoc} */
- public int size() {
- return _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return 0 == _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean contains( int entry ) {
- return TIntFloatHashMap.this.contains( entry );
- }
-
-
- /** {@inheritDoc} */
- public int[] toArray() {
- return TIntFloatHashMap.this.keys();
- }
-
-
- /** {@inheritDoc} */
- public int[] toArray( int[] dest ) {
- return TIntFloatHashMap.this.keys( dest );
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TIntFloatMap
- *
- * {@inheritDoc}
- */
- public boolean add( int entry ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean remove( int entry ) {
- return no_entry_value != TIntFloatHashMap.this.remove( entry );
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( Collection> collection ) {
- for ( Object element : collection ) {
- if ( element instanceof Integer ) {
- int ele = ( ( Integer ) element ).intValue();
- if ( ! TIntFloatHashMap.this.containsKey( ele ) ) {
- return false;
- }
- } else {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( TIntCollection collection ) {
- TIntIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- if ( ! TIntFloatHashMap.this.containsKey( iter.next() ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( int[] array ) {
- for ( int element : array ) {
- if ( ! TIntFloatHashMap.this.contains( element ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TIntFloatMap
- *
- * {@inheritDoc}
- */
- public boolean addAll( Collection extends Integer> collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TIntFloatMap
- *
- * {@inheritDoc}
- */
- public boolean addAll( TIntCollection collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TIntFloatMap
- *
- * {@inheritDoc}
- */
- public boolean addAll( int[] array ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- @SuppressWarnings({"SuspiciousMethodCalls"})
- public boolean retainAll( Collection> collection ) {
- boolean modified = false;
- TIntIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( Integer.valueOf ( iter.next() ) ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( TIntCollection collection ) {
- if ( this == collection ) {
- return false;
- }
- boolean modified = false;
- TIntIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( iter.next() ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( int[] array ) {
- boolean changed = false;
- Arrays.sort( array );
- int[] set = _set;
- byte[] states = _states;
-
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) {
- removeAt( i );
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( Collection> collection ) {
- boolean changed = false;
- for ( Object element : collection ) {
- if ( element instanceof Integer ) {
- int c = ( ( Integer ) element ).intValue();
- if ( remove( c ) ) {
- changed = true;
- }
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( TIntCollection collection ) {
- if ( this == collection ) {
- clear();
- return true;
- }
- boolean changed = false;
- TIntIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- int element = iter.next();
- if ( remove( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( int[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( remove( array[i] ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- TIntFloatHashMap.this.clear();
- }
-
-
- /** {@inheritDoc} */
- public boolean forEach( TIntProcedure procedure ) {
- return TIntFloatHashMap.this.forEachKey( procedure );
- }
-
-
- @Override
- public boolean equals( Object other ) {
- if (! (other instanceof TIntSet)) {
- return false;
- }
- final TIntSet that = ( TIntSet ) other;
- if ( that.size() != this.size() ) {
- return false;
- }
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- if ( ! that.contains( _set[i] ) ) {
- return false;
- }
- }
- }
- return true;
- }
-
-
- @Override
- public int hashCode() {
- int hashcode = 0;
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- hashcode += HashFunctions.hash( _set[i] );
- }
- }
- return hashcode;
- }
-
-
- @Override
- public String toString() {
- final StringBuilder buf = new StringBuilder( "{" );
- forEachKey( new TIntProcedure() {
- private boolean first = true;
-
-
- public boolean execute( int key ) {
- if ( first ) {
- first = false;
- } else {
- buf.append( ", " );
- }
-
- buf.append( key );
- return true;
- }
- } );
- buf.append( "}" );
- return buf.toString();
- }
- }
-
-
- /** a view onto the values of the map. */
- protected class TValueView implements TFloatCollection {
-
- /** {@inheritDoc} */
- public TFloatIterator iterator() {
- return new TIntFloatValueHashIterator( TIntFloatHashMap.this );
- }
-
-
- /** {@inheritDoc} */
- public float getNoEntryValue() {
- return no_entry_value;
- }
-
-
- /** {@inheritDoc} */
- public int size() {
- return _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return 0 == _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean contains( float entry ) {
- return TIntFloatHashMap.this.containsValue( entry );
- }
-
-
- /** {@inheritDoc} */
- public float[] toArray() {
- return TIntFloatHashMap.this.values();
- }
-
-
- /** {@inheritDoc} */
- public float[] toArray( float[] dest ) {
- return TIntFloatHashMap.this.values( dest );
- }
-
-
-
- public boolean add( float entry ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean remove( float entry ) {
- float[] values = _values;
- int[] set = _set;
-
- for ( int i = values.length; i-- > 0; ) {
- if ( ( set[i] != FREE && set[i] != REMOVED ) && entry == values[i] ) {
- removeAt( i );
- return true;
- }
- }
- return false;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( Collection> collection ) {
- for ( Object element : collection ) {
- if ( element instanceof Float ) {
- float ele = ( ( Float ) element ).floatValue();
- if ( ! TIntFloatHashMap.this.containsValue( ele ) ) {
- return false;
- }
- } else {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( TFloatCollection collection ) {
- TFloatIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- if ( ! TIntFloatHashMap.this.containsValue( iter.next() ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( float[] array ) {
- for ( float element : array ) {
- if ( ! TIntFloatHashMap.this.containsValue( element ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( Collection extends Float> collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( TFloatCollection collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( float[] array ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- @SuppressWarnings({"SuspiciousMethodCalls"})
- public boolean retainAll( Collection> collection ) {
- boolean modified = false;
- TFloatIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( Float.valueOf ( iter.next() ) ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( TFloatCollection collection ) {
- if ( this == collection ) {
- return false;
- }
- boolean modified = false;
- TFloatIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( iter.next() ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( float[] array ) {
- boolean changed = false;
- Arrays.sort( array );
- float[] values = _values;
- byte[] states = _states;
-
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL && ( Arrays.binarySearch( array, values[i] ) < 0) ) {
- removeAt( i );
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( Collection> collection ) {
- boolean changed = false;
- for ( Object element : collection ) {
- if ( element instanceof Float ) {
- float c = ( ( Float ) element ).floatValue();
- if ( remove( c ) ) {
- changed = true;
- }
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( TFloatCollection collection ) {
- if ( this == collection ) {
- clear();
- return true;
- }
- boolean changed = false;
- TFloatIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- float element = iter.next();
- if ( remove( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( float[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( remove( array[i] ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- TIntFloatHashMap.this.clear();
- }
-
-
- /** {@inheritDoc} */
- public boolean forEach( TFloatProcedure procedure ) {
- return TIntFloatHashMap.this.forEachValue( procedure );
- }
-
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- final StringBuilder buf = new StringBuilder( "{" );
- forEachValue( new TFloatProcedure() {
- private boolean first = true;
-
- public boolean execute( float value ) {
- if ( first ) {
- first = false;
- } else {
- buf.append( ", " );
- }
-
- buf.append( value );
- return true;
- }
- } );
- buf.append( "}" );
- return buf.toString();
- }
- }
-
-
- class TIntFloatKeyHashIterator extends THashPrimitiveIterator implements TIntIterator {
-
- /**
- * Creates an iterator over the specified map
- *
- * @param hash the TPrimitiveHash we will be iterating over.
- */
- TIntFloatKeyHashIterator( TPrimitiveHash hash ) {
- super( hash );
- }
-
- /** {@inheritDoc} */
- public int next() {
- moveToNextIndex();
- return _set[_index];
- }
-
- /** @{inheritDoc} */
- public void remove() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
-
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- TIntFloatHashMap.this.removeAt( _index );
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
-
- _expectedSize--;
- }
- }
-
-
-
- class TIntFloatValueHashIterator extends THashPrimitiveIterator implements TFloatIterator {
-
- /**
- * Creates an iterator over the specified map
- *
- * @param hash the TPrimitiveHash we will be iterating over.
- */
- TIntFloatValueHashIterator( TPrimitiveHash hash ) {
- super( hash );
- }
-
- /** {@inheritDoc} */
- public float next() {
- moveToNextIndex();
- return _values[_index];
- }
-
- /** @{inheritDoc} */
- public void remove() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
-
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- TIntFloatHashMap.this.removeAt( _index );
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
-
- _expectedSize--;
- }
- }
-
-
- class TIntFloatHashIterator extends THashPrimitiveIterator implements TIntFloatIterator {
-
- /**
- * Creates an iterator over the specified map
- *
- * @param map the TIntFloatHashMap we will be iterating over.
- */
- TIntFloatHashIterator( TIntFloatHashMap map ) {
- super( map );
- }
-
- /** {@inheritDoc} */
- public void advance() {
- moveToNextIndex();
- }
-
- /** {@inheritDoc} */
- public int key() {
- return _set[_index];
- }
-
- /** {@inheritDoc} */
- public float value() {
- return _values[_index];
- }
-
- /** {@inheritDoc} */
- public float setValue( float val ) {
- float old = value();
- _values[_index] = val;
- return old;
- }
-
- /** @{inheritDoc} */
- public void remove() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- TIntFloatHashMap.this.removeAt( _index );
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
- _expectedSize--;
- }
- }
-
-
- /** {@inheritDoc} */
- @Override
- public boolean equals( Object other ) {
- if ( ! ( other instanceof TIntFloatMap ) ) {
- return false;
- }
- TIntFloatMap that = ( TIntFloatMap ) other;
- if ( that.size() != this.size() ) {
- return false;
- }
- float[] values = _values;
- byte[] states = _states;
- float this_no_entry_value = getNoEntryValue();
- float that_no_entry_value = that.getNoEntryValue();
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL ) {
- int key = _set[i];
- float that_value = that.get( key );
- float this_value = values[i];
- if ( ( this_value != that_value ) &&
- ( this_value != this_no_entry_value ) &&
- ( that_value != that_no_entry_value ) ) {
- return false;
- }
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- int hashcode = 0;
- byte[] states = _states;
- for ( int i = _values.length; i-- > 0; ) {
- if ( states[i] == FULL ) {
- hashcode += HashFunctions.hash( _set[i] ) ^
- HashFunctions.hash( _values[i] );
- }
- }
- return hashcode;
- }
-
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- final StringBuilder buf = new StringBuilder( "{" );
- forEachEntry( new TIntFloatProcedure() {
- private boolean first = true;
- public boolean execute( int key, float value ) {
- if ( first ) first = false;
- else buf.append( ", " );
-
- buf.append(key);
- buf.append("=");
- buf.append(value);
- return true;
- }
- });
- buf.append( "}" );
- return buf.toString();
- }
-
-
- /** {@inheritDoc} */
- public void writeExternal(ObjectOutput out) throws IOException {
- // VERSION
- out.writeByte( 0 );
-
- // SUPER
- super.writeExternal( out );
-
- // NUMBER OF ENTRIES
- out.writeInt( _size );
-
- // ENTRIES
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- out.writeInt( _set[i] );
- out.writeFloat( _values[i] );
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- // VERSION
- in.readByte();
-
- // SUPER
- super.readExternal( in );
-
- // NUMBER OF ENTRIES
- int size = in.readInt();
- setUp( size );
-
- // ENTRIES
- while (size-- > 0) {
- int key = in.readInt();
- float val = in.readFloat();
- put(key, val);
- }
- }
-} // TIntFloatHashMap
diff --git a/src/gnu/trove/map/hash/TLongDoubleHashMap.java b/src/gnu/trove/map/hash/TLongDoubleHashMap.java
deleted file mode 100644
index edc7a9d..0000000
--- a/src/gnu/trove/map/hash/TLongDoubleHashMap.java
+++ /dev/null
@@ -1,1294 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.map.hash;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-import gnu.trove.map.TLongDoubleMap;
-import gnu.trove.function.TDoubleFunction;
-import gnu.trove.procedure.*;
-import gnu.trove.set.*;
-import gnu.trove.iterator.*;
-import gnu.trove.iterator.hash.*;
-import gnu.trove.impl.hash.*;
-import gnu.trove.impl.HashFunctions;
-import gnu.trove.*;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * An open addressed Map implementation for long keys and double values.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: _K__V_HashMap.template,v 1.1.2.16 2010/03/02 04:09:50 robeden Exp $
- */
-public class TLongDoubleHashMap extends TLongDoubleHash implements TLongDoubleMap, Externalizable {
- static final long serialVersionUID = 1L;
-
- /** the values of the map */
- protected transient double[] _values;
-
-
- /**
- * Creates a new TLongDoubleHashMap instance with the default
- * capacity and load factor.
- */
- public TLongDoubleHashMap() {
- super();
- }
-
-
- /**
- * Creates a new TLongDoubleHashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the default load factor.
- *
- * @param initialCapacity an int value
- */
- public TLongDoubleHashMap( int initialCapacity ) {
- super( initialCapacity );
- }
-
-
- /**
- * Creates a new TLongDoubleHashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the specified load factor.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- */
- public TLongDoubleHashMap( int initialCapacity, float loadFactor ) {
- super( initialCapacity, loadFactor );
- }
-
-
- /**
- * Creates a new TLongDoubleHashMap instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the specified load factor.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- * @param noEntryKey a long value that represents
- * null for the Key set.
- * @param noEntryValue a double value that represents
- * null for the Value set.
- */
- public TLongDoubleHashMap( int initialCapacity, float loadFactor,
- long noEntryKey, double noEntryValue ) {
- super( initialCapacity, loadFactor, noEntryKey, noEntryValue );
- }
-
-
- /**
- * Creates a new TLongDoubleHashMap instance containing
- * all of the entries in the map passed in.
- *
- * @param keys a long array containing the keys for the matching values.
- * @param values a double array containing the values.
- */
- public TLongDoubleHashMap( long[] keys, double[] values ) {
- super( Math.max( keys.length, values.length ) );
-
- int size = Math.min( keys.length, values.length );
- for ( int i = 0; i < size; i++ ) {
- this.put( keys[i], values[i] );
- }
- }
-
-
- /**
- * Creates a new TLongDoubleHashMap instance containing
- * all of the entries in the map passed in.
- *
- * @param map a TLongDoubleMap that will be duplicated.
- */
- public TLongDoubleHashMap( TLongDoubleMap map ) {
- super( map.size() );
- if ( map instanceof TLongDoubleHashMap ) {
- TLongDoubleHashMap hashmap = ( TLongDoubleHashMap ) map;
- this._loadFactor = hashmap._loadFactor;
- this.no_entry_key = hashmap.no_entry_key;
- this.no_entry_value = hashmap.no_entry_value;
- //noinspection RedundantCast
- if ( this.no_entry_key != ( long ) 0 ) {
- Arrays.fill( _set, this.no_entry_key );
- }
- //noinspection RedundantCast
- if ( this.no_entry_value != ( double ) 0 ) {
- Arrays.fill( _values, this.no_entry_value );
- }
- setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
- }
- putAll( map );
- }
-
-
- /**
- * initializes the hashtable to a prime capacity which is at least
- * initialCapacity + 1.
- *
- * @param initialCapacity an int value
- * @return the actual capacity chosen
- */
- protected int setUp( int initialCapacity ) {
- int capacity;
-
- capacity = super.setUp( initialCapacity );
- _values = new double[capacity];
- return capacity;
- }
-
-
- /**
- * rehashes the map to the new capacity.
- *
- * @param newCapacity an int value
- */
- /** {@inheritDoc} */
- protected void rehash( int newCapacity ) {
- int oldCapacity = _set.length;
-
- long oldKeys[] = _set;
- double oldVals[] = _values;
- byte oldStates[] = _states;
-
- _set = new long[newCapacity];
- _values = new double[newCapacity];
- _states = new byte[newCapacity];
-
- for ( int i = oldCapacity; i-- > 0; ) {
- if( oldStates[i] == FULL ) {
- long o = oldKeys[i];
- int index = insertionIndex( o );
- _set[index] = o;
- _values[index] = oldVals[i];
- _states[index] = FULL;
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public double put( long key, double value ) {
- int index = insertionIndex( key );
- return doPut( key, value, index );
- }
-
-
- /** {@inheritDoc} */
- public double putIfAbsent( long key, double value ) {
- int index = insertionIndex( key );
- if (index < 0)
- return _values[-index - 1];
- return doPut( key, value, index );
- }
-
-
- private double doPut( long key, double value, int index ) {
- byte previousState;
- double previous = no_entry_value;
- boolean isNewMapping = true;
- if ( index < 0 ) {
- index = -index -1;
- previous = _values[index];
- isNewMapping = false;
- }
- previousState = _states[index];
- _set[index] = key;
- _states[index] = FULL;
- _values[index] = value;
- if (isNewMapping) {
- postInsertHook( previousState == FREE );
- }
-
- return previous;
- }
-
-
- /** {@inheritDoc} */
- public void putAll( Map extends Long, ? extends Double> map ) {
- ensureCapacity( map.size() );
- // could optimize this for cases when map instanceof THashMap
- for ( Map.Entry extends Long, ? extends Double> entry : map.entrySet() ) {
- this.put( entry.getKey().longValue(), entry.getValue().doubleValue() );
- }
- }
-
-
- /** {@inheritDoc} */
- public void putAll( TLongDoubleMap map ) {
- ensureCapacity( map.size() );
- TLongDoubleIterator iter = map.iterator();
- while ( iter.hasNext() ) {
- iter.advance();
- this.put( iter.key(), iter.value() );
- }
- }
-
-
- /** {@inheritDoc} */
- public double get( long key ) {
- int index = index( key );
- return index < 0 ? no_entry_value : _values[index];
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- super.clear();
- Arrays.fill( _set, 0, _set.length, no_entry_key );
- Arrays.fill( _values, 0, _values.length, no_entry_value );
- Arrays.fill( _states, 0, _states.length, FREE );
- }
-
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return 0 == _size;
- }
-
-
- /** {@inheritDoc} */
- public double remove( long key ) {
- double prev = no_entry_value;
- int index = index( key );
- if ( index >= 0 ) {
- prev = _values[index];
- removeAt( index ); // clear key,state; adjust size
- }
- return prev;
- }
-
-
- /** {@inheritDoc} */
- protected void removeAt( int index ) {
- _values[index] = no_entry_value;
- super.removeAt( index ); // clear key, state; adjust size
- }
-
-
- /** {@inheritDoc} */
- public TLongSet keySet() {
- return new TKeyView();
- }
-
-
- /** {@inheritDoc} */
- public long[] keys() {
- long[] keys = new long[size()];
- long[] k = _set;
- byte[] states = _states;
-
- for ( int i = k.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- keys[j++] = k[i];
- }
- }
- return keys;
- }
-
-
- /** {@inheritDoc} */
- public long[] keys( long[] array ) {
- int size = size();
- if ( array.length < size ) {
- array = new long[size];
- }
-
- long[] keys = _set;
- byte[] states = _states;
-
- for ( int i = keys.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- array[j++] = keys[i];
- }
- }
- return array;
- }
-
-
- /** {@inheritDoc} */
- public TDoubleCollection valueCollection() {
- return new TValueView();
- }
-
-
- /** {@inheritDoc} */
- public double[] values() {
- double[] vals = new double[size()];
- double[] v = _values;
- byte[] states = _states;
-
- for ( int i = v.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- vals[j++] = v[i];
- }
- }
- return vals;
- }
-
-
- /** {@inheritDoc} */
- public double[] values( double[] array ) {
- int size = size();
- if ( array.length < size ) {
- array = new double[size];
- }
-
- double[] v = _values;
- byte[] states = _states;
-
- for ( int i = v.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- array[j++] = v[i];
- }
- }
- return array;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsValue( double val ) {
- byte[] states = _states;
- double[] vals = _values;
-
- for ( int i = vals.length; i-- > 0; ) {
- if ( states[i] == FULL && val == vals[i] ) {
- return true;
- }
- }
- return false;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsKey( long key ) {
- return contains( key );
- }
-
-
- /** {@inheritDoc} */
- public TLongDoubleIterator iterator() {
- return new TLongDoubleHashIterator( this );
- }
-
-
- /** {@inheritDoc} */
- public boolean forEachKey( TLongProcedure procedure ) {
- return forEach( procedure );
- }
-
-
- /** {@inheritDoc} */
- public boolean forEachValue( TDoubleProcedure procedure ) {
- byte[] states = _states;
- double[] values = _values;
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( values[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean forEachEntry( TLongDoubleProcedure procedure ) {
- byte[] states = _states;
- long[] keys = _set;
- double[] values = _values;
- for ( int i = keys.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public void transformValues( TDoubleFunction function ) {
- byte[] states = _states;
- double[] values = _values;
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL ) {
- values[i] = function.execute( values[i] );
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public boolean retainEntries( TLongDoubleProcedure procedure ) {
- boolean modified = false;
- byte[] states = _states;
- long[] keys = _set;
- double[] values = _values;
-
-
- // Temporarily disable compaction. This is a fix for bug #1738760
- tempDisableAutoCompaction();
- try {
- for ( int i = keys.length; i-- > 0; ) {
- if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) {
- removeAt( i );
- modified = true;
- }
- }
- }
- finally {
- reenableAutoCompaction( true );
- }
-
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean increment( long key ) {
- return adjustValue( key, ( double ) 1 );
- }
-
-
- /** {@inheritDoc} */
- public boolean adjustValue( long key, double amount ) {
- int index = index( key );
- if (index < 0) {
- return false;
- } else {
- _values[index] += amount;
- return true;
- }
- }
-
-
- /** {@inheritDoc} */
- public double adjustOrPutValue( long key, double adjust_amount, double put_amount ) {
- int index = insertionIndex( key );
- final boolean isNewMapping;
- final double newValue;
- if ( index < 0 ) {
- index = -index -1;
- newValue = ( _values[index] += adjust_amount );
- isNewMapping = false;
- } else {
- newValue = ( _values[index] = put_amount );
- isNewMapping = true;
- }
-
- byte previousState = _states[index];
- _set[index] = key;
- _states[index] = FULL;
-
- if ( isNewMapping ) {
- postInsertHook(previousState == FREE);
- }
-
- return newValue;
- }
-
-
- /** a view onto the keys of the map. */
- protected class TKeyView implements TLongSet {
-
- /** {@inheritDoc} */
- public TLongIterator iterator() {
- return new TLongDoubleKeyHashIterator( TLongDoubleHashMap.this );
- }
-
-
- /** {@inheritDoc} */
- public long getNoEntryValue() {
- return no_entry_key;
- }
-
-
- /** {@inheritDoc} */
- public int size() {
- return _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return 0 == _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean contains( long entry ) {
- return TLongDoubleHashMap.this.contains( entry );
- }
-
-
- /** {@inheritDoc} */
- public long[] toArray() {
- return TLongDoubleHashMap.this.keys();
- }
-
-
- /** {@inheritDoc} */
- public long[] toArray( long[] dest ) {
- return TLongDoubleHashMap.this.keys( dest );
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TLongDoubleMap
- *
- * {@inheritDoc}
- */
- public boolean add( long entry ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean remove( long entry ) {
- return no_entry_value != TLongDoubleHashMap.this.remove( entry );
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( Collection> collection ) {
- for ( Object element : collection ) {
- if ( element instanceof Long ) {
- long ele = ( ( Long ) element ).longValue();
- if ( ! TLongDoubleHashMap.this.containsKey( ele ) ) {
- return false;
- }
- } else {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( TLongCollection collection ) {
- TLongIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- if ( ! TLongDoubleHashMap.this.containsKey( iter.next() ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( long[] array ) {
- for ( long element : array ) {
- if ( ! TLongDoubleHashMap.this.contains( element ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TLongDoubleMap
- *
- * {@inheritDoc}
- */
- public boolean addAll( Collection extends Long> collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TLongDoubleMap
- *
- * {@inheritDoc}
- */
- public boolean addAll( TLongCollection collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Unsupported when operating upon a Key Set view of a TLongDoubleMap
- *
- * {@inheritDoc}
- */
- public boolean addAll( long[] array ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- @SuppressWarnings({"SuspiciousMethodCalls"})
- public boolean retainAll( Collection> collection ) {
- boolean modified = false;
- TLongIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( Long.valueOf ( iter.next() ) ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( TLongCollection collection ) {
- if ( this == collection ) {
- return false;
- }
- boolean modified = false;
- TLongIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( iter.next() ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( long[] array ) {
- boolean changed = false;
- Arrays.sort( array );
- long[] set = _set;
- byte[] states = _states;
-
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) {
- removeAt( i );
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( Collection> collection ) {
- boolean changed = false;
- for ( Object element : collection ) {
- if ( element instanceof Long ) {
- long c = ( ( Long ) element ).longValue();
- if ( remove( c ) ) {
- changed = true;
- }
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( TLongCollection collection ) {
- if ( this == collection ) {
- clear();
- return true;
- }
- boolean changed = false;
- TLongIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- long element = iter.next();
- if ( remove( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( long[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( remove( array[i] ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- TLongDoubleHashMap.this.clear();
- }
-
-
- /** {@inheritDoc} */
- public boolean forEach( TLongProcedure procedure ) {
- return TLongDoubleHashMap.this.forEachKey( procedure );
- }
-
-
- @Override
- public boolean equals( Object other ) {
- if (! (other instanceof TLongSet)) {
- return false;
- }
- final TLongSet that = ( TLongSet ) other;
- if ( that.size() != this.size() ) {
- return false;
- }
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- if ( ! that.contains( _set[i] ) ) {
- return false;
- }
- }
- }
- return true;
- }
-
-
- @Override
- public int hashCode() {
- int hashcode = 0;
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- hashcode += HashFunctions.hash( _set[i] );
- }
- }
- return hashcode;
- }
-
-
- @Override
- public String toString() {
- final StringBuilder buf = new StringBuilder( "{" );
- forEachKey( new TLongProcedure() {
- private boolean first = true;
-
-
- public boolean execute( long key ) {
- if ( first ) {
- first = false;
- } else {
- buf.append( ", " );
- }
-
- buf.append( key );
- return true;
- }
- } );
- buf.append( "}" );
- return buf.toString();
- }
- }
-
-
- /** a view onto the values of the map. */
- protected class TValueView implements TDoubleCollection {
-
- /** {@inheritDoc} */
- public TDoubleIterator iterator() {
- return new TLongDoubleValueHashIterator( TLongDoubleHashMap.this );
- }
-
-
- /** {@inheritDoc} */
- public double getNoEntryValue() {
- return no_entry_value;
- }
-
-
- /** {@inheritDoc} */
- public int size() {
- return _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return 0 == _size;
- }
-
-
- /** {@inheritDoc} */
- public boolean contains( double entry ) {
- return TLongDoubleHashMap.this.containsValue( entry );
- }
-
-
- /** {@inheritDoc} */
- public double[] toArray() {
- return TLongDoubleHashMap.this.values();
- }
-
-
- /** {@inheritDoc} */
- public double[] toArray( double[] dest ) {
- return TLongDoubleHashMap.this.values( dest );
- }
-
-
-
- public boolean add( double entry ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean remove( double entry ) {
- double[] values = _values;
- long[] set = _set;
-
- for ( int i = values.length; i-- > 0; ) {
- if ( ( set[i] != FREE && set[i] != REMOVED ) && entry == values[i] ) {
- removeAt( i );
- return true;
- }
- }
- return false;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( Collection> collection ) {
- for ( Object element : collection ) {
- if ( element instanceof Double ) {
- double ele = ( ( Double ) element ).doubleValue();
- if ( ! TLongDoubleHashMap.this.containsValue( ele ) ) {
- return false;
- }
- } else {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( TDoubleCollection collection ) {
- TDoubleIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- if ( ! TLongDoubleHashMap.this.containsValue( iter.next() ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( double[] array ) {
- for ( double element : array ) {
- if ( ! TLongDoubleHashMap.this.containsValue( element ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( Collection extends Double> collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( TDoubleCollection collection ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( double[] array ) {
- throw new UnsupportedOperationException();
- }
-
-
- /** {@inheritDoc} */
- @SuppressWarnings({"SuspiciousMethodCalls"})
- public boolean retainAll( Collection> collection ) {
- boolean modified = false;
- TDoubleIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( Double.valueOf ( iter.next() ) ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( TDoubleCollection collection ) {
- if ( this == collection ) {
- return false;
- }
- boolean modified = false;
- TDoubleIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( iter.next() ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( double[] array ) {
- boolean changed = false;
- Arrays.sort( array );
- double[] values = _values;
- byte[] states = _states;
-
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL && ( Arrays.binarySearch( array, values[i] ) < 0) ) {
- removeAt( i );
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( Collection> collection ) {
- boolean changed = false;
- for ( Object element : collection ) {
- if ( element instanceof Double ) {
- double c = ( ( Double ) element ).doubleValue();
- if ( remove( c ) ) {
- changed = true;
- }
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( TDoubleCollection collection ) {
- if ( this == collection ) {
- clear();
- return true;
- }
- boolean changed = false;
- TDoubleIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- double element = iter.next();
- if ( remove( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( double[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( remove( array[i] ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- TLongDoubleHashMap.this.clear();
- }
-
-
- /** {@inheritDoc} */
- public boolean forEach( TDoubleProcedure procedure ) {
- return TLongDoubleHashMap.this.forEachValue( procedure );
- }
-
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- final StringBuilder buf = new StringBuilder( "{" );
- forEachValue( new TDoubleProcedure() {
- private boolean first = true;
-
- public boolean execute( double value ) {
- if ( first ) {
- first = false;
- } else {
- buf.append( ", " );
- }
-
- buf.append( value );
- return true;
- }
- } );
- buf.append( "}" );
- return buf.toString();
- }
- }
-
-
- class TLongDoubleKeyHashIterator extends THashPrimitiveIterator implements TLongIterator {
-
- /**
- * Creates an iterator over the specified map
- *
- * @param hash the TPrimitiveHash we will be iterating over.
- */
- TLongDoubleKeyHashIterator( TPrimitiveHash hash ) {
- super( hash );
- }
-
- /** {@inheritDoc} */
- public long next() {
- moveToNextIndex();
- return _set[_index];
- }
-
- /** @{inheritDoc} */
- public void remove() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
-
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- TLongDoubleHashMap.this.removeAt( _index );
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
-
- _expectedSize--;
- }
- }
-
-
-
- class TLongDoubleValueHashIterator extends THashPrimitiveIterator implements TDoubleIterator {
-
- /**
- * Creates an iterator over the specified map
- *
- * @param hash the TPrimitiveHash we will be iterating over.
- */
- TLongDoubleValueHashIterator( TPrimitiveHash hash ) {
- super( hash );
- }
-
- /** {@inheritDoc} */
- public double next() {
- moveToNextIndex();
- return _values[_index];
- }
-
- /** @{inheritDoc} */
- public void remove() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
-
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- TLongDoubleHashMap.this.removeAt( _index );
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
-
- _expectedSize--;
- }
- }
-
-
- class TLongDoubleHashIterator extends THashPrimitiveIterator implements TLongDoubleIterator {
-
- /**
- * Creates an iterator over the specified map
- *
- * @param map the TLongDoubleHashMap we will be iterating over.
- */
- TLongDoubleHashIterator( TLongDoubleHashMap map ) {
- super( map );
- }
-
- /** {@inheritDoc} */
- public void advance() {
- moveToNextIndex();
- }
-
- /** {@inheritDoc} */
- public long key() {
- return _set[_index];
- }
-
- /** {@inheritDoc} */
- public double value() {
- return _values[_index];
- }
-
- /** {@inheritDoc} */
- public double setValue( double val ) {
- double old = value();
- _values[_index] = val;
- return old;
- }
-
- /** @{inheritDoc} */
- public void remove() {
- if ( _expectedSize != _hash.size() ) {
- throw new ConcurrentModificationException();
- }
- // Disable auto compaction during the remove. This is a workaround for bug 1642768.
- try {
- _hash.tempDisableAutoCompaction();
- TLongDoubleHashMap.this.removeAt( _index );
- }
- finally {
- _hash.reenableAutoCompaction( false );
- }
- _expectedSize--;
- }
- }
-
-
- /** {@inheritDoc} */
- @Override
- public boolean equals( Object other ) {
- if ( ! ( other instanceof TLongDoubleMap ) ) {
- return false;
- }
- TLongDoubleMap that = ( TLongDoubleMap ) other;
- if ( that.size() != this.size() ) {
- return false;
- }
- double[] values = _values;
- byte[] states = _states;
- double this_no_entry_value = getNoEntryValue();
- double that_no_entry_value = that.getNoEntryValue();
- for ( int i = values.length; i-- > 0; ) {
- if ( states[i] == FULL ) {
- long key = _set[i];
- double that_value = that.get( key );
- double this_value = values[i];
- if ( ( this_value != that_value ) &&
- ( this_value != this_no_entry_value ) &&
- ( that_value != that_no_entry_value ) ) {
- return false;
- }
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- @Override
- public int hashCode() {
- int hashcode = 0;
- byte[] states = _states;
- for ( int i = _values.length; i-- > 0; ) {
- if ( states[i] == FULL ) {
- hashcode += HashFunctions.hash( _set[i] ) ^
- HashFunctions.hash( _values[i] );
- }
- }
- return hashcode;
- }
-
-
- /** {@inheritDoc} */
- @Override
- public String toString() {
- final StringBuilder buf = new StringBuilder( "{" );
- forEachEntry( new TLongDoubleProcedure() {
- private boolean first = true;
- public boolean execute( long key, double value ) {
- if ( first ) first = false;
- else buf.append( ", " );
-
- buf.append(key);
- buf.append("=");
- buf.append(value);
- return true;
- }
- });
- buf.append( "}" );
- return buf.toString();
- }
-
-
- /** {@inheritDoc} */
- public void writeExternal(ObjectOutput out) throws IOException {
- // VERSION
- out.writeByte( 0 );
-
- // SUPER
- super.writeExternal( out );
-
- // NUMBER OF ENTRIES
- out.writeInt( _size );
-
- // ENTRIES
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- out.writeLong( _set[i] );
- out.writeDouble( _values[i] );
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- // VERSION
- in.readByte();
-
- // SUPER
- super.readExternal( in );
-
- // NUMBER OF ENTRIES
- int size = in.readInt();
- setUp( size );
-
- // ENTRIES
- while (size-- > 0) {
- long key = in.readLong();
- double val = in.readDouble();
- put(key, val);
- }
- }
-} // TLongDoubleHashMap
diff --git a/src/gnu/trove/procedure/TByteProcedure.java b/src/gnu/trove/procedure/TByteProcedure.java
deleted file mode 100644
index 6684ea1..0000000
--- a/src/gnu/trove/procedure/TByteProcedure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures with one byte parameter.
- */
-public interface TByteProcedure {
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param value a value of type byte
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( byte value );
-}
diff --git a/src/gnu/trove/procedure/TCharProcedure.java b/src/gnu/trove/procedure/TCharProcedure.java
deleted file mode 100644
index 21f4fe4..0000000
--- a/src/gnu/trove/procedure/TCharProcedure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures with one char parameter.
- */
-public interface TCharProcedure {
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param value a value of type char
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( char value );
-}
diff --git a/src/gnu/trove/procedure/TDoubleProcedure.java b/src/gnu/trove/procedure/TDoubleProcedure.java
deleted file mode 100644
index 28f0b5a..0000000
--- a/src/gnu/trove/procedure/TDoubleProcedure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures with one double parameter.
- */
-public interface TDoubleProcedure {
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param value a value of type double
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( double value );
-}
diff --git a/src/gnu/trove/procedure/TFloatProcedure.java b/src/gnu/trove/procedure/TFloatProcedure.java
deleted file mode 100644
index 8bcdd82..0000000
--- a/src/gnu/trove/procedure/TFloatProcedure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures with one float parameter.
- */
-public interface TFloatProcedure {
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param value a value of type float
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( float value );
-}
diff --git a/src/gnu/trove/procedure/TIntFloatProcedure.java b/src/gnu/trove/procedure/TIntFloatProcedure.java
deleted file mode 100644
index cb3235c..0000000
--- a/src/gnu/trove/procedure/TIntFloatProcedure.java
+++ /dev/null
@@ -1,42 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures that take two parameters of type int and float.
- */
-public interface TIntFloatProcedure {
-
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param a a int value
- * @param b a float value
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( int a, float b );
-}
diff --git a/src/gnu/trove/procedure/TIntProcedure.java b/src/gnu/trove/procedure/TIntProcedure.java
deleted file mode 100644
index 5b1a644..0000000
--- a/src/gnu/trove/procedure/TIntProcedure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures with one int parameter.
- */
-public interface TIntProcedure {
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param value a value of type int
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( int value );
-}
diff --git a/src/gnu/trove/procedure/TLongDoubleProcedure.java b/src/gnu/trove/procedure/TLongDoubleProcedure.java
deleted file mode 100644
index c2ba2a7..0000000
--- a/src/gnu/trove/procedure/TLongDoubleProcedure.java
+++ /dev/null
@@ -1,42 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures that take two parameters of type long and double.
- */
-public interface TLongDoubleProcedure {
-
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param a a long value
- * @param b a double value
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( long a, double b );
-}
diff --git a/src/gnu/trove/procedure/TLongProcedure.java b/src/gnu/trove/procedure/TLongProcedure.java
deleted file mode 100644
index 6b169f0..0000000
--- a/src/gnu/trove/procedure/TLongProcedure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures with one long parameter.
- */
-public interface TLongProcedure {
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param value a value of type long
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( long value );
-}
diff --git a/src/gnu/trove/procedure/TObjectObjectProcedure.java b/src/gnu/trove/procedure/TObjectObjectProcedure.java
deleted file mode 100644
index 946a623..0000000
--- a/src/gnu/trove/procedure/TObjectObjectProcedure.java
+++ /dev/null
@@ -1,43 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-/**
- * Interface for procedures that take two Object parameters.
- *
- * Created: Mon Nov 5 22:03:30 2001
- *
- * @author Eric D. Friedman
- * @version $Id: TObjectObjectProcedure.java,v 1.1.2.1 2009/09/06 17:02:20 upholderoftruth Exp $
- */
-
-public interface TObjectObjectProcedureObject value
- * @param b an Object value
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( K a, V b );
-}// TObjectObjectProcedure
diff --git a/src/gnu/trove/procedure/TObjectProcedure.java b/src/gnu/trove/procedure/TObjectProcedure.java
deleted file mode 100644
index 71cf0e2..0000000
--- a/src/gnu/trove/procedure/TObjectProcedure.java
+++ /dev/null
@@ -1,42 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-
-package gnu.trove.procedure;
-
-/**
- * Interface for procedures with one Object parameter.
- *
- * Created: Mon Nov 5 21:45:49 2001
- *
- * @author Eric D. Friedman
- * @version $Id: TObjectProcedure.java,v 1.1.2.1 2009/09/02 21:52:33 upholderoftruth Exp $
- */
-
-public interface TObjectProcedureObject value
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute(T object);
-}// TObjectProcedure
diff --git a/src/gnu/trove/procedure/TShortProcedure.java b/src/gnu/trove/procedure/TShortProcedure.java
deleted file mode 100644
index ebac66c..0000000
--- a/src/gnu/trove/procedure/TShortProcedure.java
+++ /dev/null
@@ -1,41 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * Interface for procedures with one short parameter.
- */
-public interface TShortProcedure {
- /**
- * Executes this procedure. A false return value indicates that
- * the application executing this procedure should not invoke this
- * procedure again.
- *
- * @param value a value of type short
- * @return true if additional invocations of the procedure are
- * allowed.
- */
- public boolean execute( short value );
-}
diff --git a/src/gnu/trove/procedure/array/ToObjectArrayProceedure.java b/src/gnu/trove/procedure/array/ToObjectArrayProceedure.java
deleted file mode 100644
index 122d23d..0000000
--- a/src/gnu/trove/procedure/array/ToObjectArrayProceedure.java
+++ /dev/null
@@ -1,49 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.procedure.array;
-
-import gnu.trove.procedure.TObjectProcedure;
-
-
-
-/**
- * A procedure which stores each value it receives into a target array.
- *
- * Created: Sat Jan 12 10:13:42 2002
- *
- * @author Eric D. Friedman
- * @version $Id: ToObjectArrayProceedure.java,v 1.1.2.1 2009/09/02 21:52:33 upholderoftruth Exp $
- */
-
-public final class ToObjectArrayProceedureint value
- * @return true if the set contains the specified element.
- */
- boolean contains( int entry );
-
-
- /**
- * Creates an iterator over the values of the set. The iterator
- * supports element deletion.
- *
- * @return an TIntIterator value
- */
- TIntIterator iterator();
-
-
- /**
- * Returns an array containing all of the elements in this set.
- * If this set makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the
- * elements in the same order.
- *
- * The returned array will be "safe" in that no references to it - * are maintained by this set. (In other words, this method must - * allocate a new array even if this set is backed by an array). - * The caller is thus free to modify the returned array. - * - *
This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this set - */ - int[] toArray(); - - - /** - * Returns an array containing elements in this set. - * - *
If this set fits in the specified array with room to spare - * (i.e., the array has more elements than this set), the element in - * the array immediately following the end of the set is set to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this set only if the caller knows that this - * set does not contain any elements representing null.) - * - *
If the native array is smaller than the set size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *
If this set makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the elements
- * in the same order.
- *
- * @param dest the array into which the elements of this set are to be
- * stored.
- * @return an int[] containing all the elements in this set
- * @throws NullPointerException if the specified array is null
- */
- int[] toArray( int[] dest );
-
-
- /**
- * Inserts a value into the set.
- *
- * @param entry a int value
- * @return true if the set was modified by the add operation
- */
- boolean add( int entry );
-
-
- /**
- * Removes entry from the set.
- *
- * @param entry an int value
- * @return true if the set was modified by the remove operation.
- */
- boolean remove( int entry );
-
-
- /**
- * Tests the set to determine if all of the elements in
- * collection are present.
- *
- * @param collection a Collection value
- * @return true if all elements were present in the set.
- */
- boolean containsAll( Collection> collection );
-
-
- /**
- * Tests the set to determine if all of the elements in
- * TIntCollection are present.
- *
- * @param collection a TIntCollection value
- * @return true if all elements were present in the set.
- */
- boolean containsAll( TIntCollection collection );
-
-
- /**
- * Tests the set to determine if all of the elements in
- * array are present.
- *
- * @param array as array of int primitives.
- * @return true if all elements were present in the set.
- */
- boolean containsAll( int[] array );
-
-
- /**
- * Adds all of the elements in collection to the set.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the add all operation.
- */
- boolean addAll( Collection extends Integer> collection );
-
-
- /**
- * Adds all of the elements in the TIntCollection to the set.
- *
- * @param collection a TIntCollection value
- * @return true if the set was modified by the add all operation.
- */
- boolean addAll( TIntCollection collection );
-
-
- /**
- * Adds all of the elements in the array to the set.
- *
- * @param array a array of int primitives.
- * @return true if the set was modified by the add all operation.
- */
- boolean addAll( int[] array );
-
-
- /**
- * Removes any values in the set which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the retain all operation
- */
- boolean retainAll( Collection> collection );
-
-
- /**
- * Removes any values in the set which are not contained in
- * TIntCollection.
- *
- * @param collection a TIntCollection value
- * @return true if the set was modified by the retain all operation
- */
- boolean retainAll( TIntCollection collection );
-
-
- /**
- * Removes any values in the set which are not contained in
- * array.
- *
- * @param array an array of int primitives.
- * @return true if the set was modified by the retain all operation
- */
- boolean retainAll( int[] array );
-
-
- /**
- * Removes all of the elements in collection from the set.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the remove all operation.
- */
- boolean removeAll( Collection> collection );
-
-
- /**
- * Removes all of the elements in TIntCollection from the set.
- *
- * @param collection a TIntCollection value
- * @return true if the set was modified by the remove all operation.
- */
- boolean removeAll( TIntCollection collection );
-
-
- /**
- * Removes all of the elements in array from the set.
- *
- * @param array an array of int primitives.
- * @return true if the set was modified by the remove all operation.
- */
- public boolean removeAll( int[] array );
-
-
- /**
- * Empties the set.
- */
- void clear();
-
-
- /**
- * Executes procedure for each element in the set.
- *
- * @param procedure a TIntProcedure value
- * @return false if the loop over the set terminated because
- * the procedure returned false for some value.
- */
- boolean forEach( TIntProcedure procedure );
-
-
- // Comparison and hashing
-
- /**
- * Compares the specified object with this set for equality. Returns
- * true if the specified object is also a set, the two sets
- * have the same size, and every member of the specified set is
- * contained in this set (or equivalently, every member of this set is
- * contained in the specified set). This definition ensures that the
- * equals method works properly across different implementations of the
- * set interface.
- *
- * @param o object to be compared for equality with this set
- * @return true if the specified object is equal to this set
- */
- boolean equals( Object o );
-
-
- /**
- * Returns the hash code value for this set. The hash code of a set is
- * defined to be the sum of the hash codes of the elements in the set.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two sets s1
- * and s2, as required by the general contract of
- * {@link Object#hashCode}.
- *
- * @return the hash code value for this set
- * @see Object#equals(Object)
- * @see Set#equals(Object)
- */
- int hashCode();
-
-
-} // THashSet
diff --git a/src/gnu/trove/set/TLongSet.java b/src/gnu/trove/set/TLongSet.java
deleted file mode 100644
index fa62253..0000000
--- a/src/gnu/trove/set/TLongSet.java
+++ /dev/null
@@ -1,320 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.set;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-import gnu.trove.iterator.TLongIterator;
-import gnu.trove.procedure.TLongProcedure;
-import gnu.trove.TLongCollection;
-
-import java.util.Collection;
-import java.util.Set;
-import java.io.Serializable;
-
-/**
- * An implementation of the Set interface that uses an
- * open-addressed hash table to store its contents.
- *
- * Created: Sat Nov 3 10:38:17 2001
- *
- * @author Eric D. Friedman, Rob Eden, Jeff Randall
- * @version $Id: _E_Set.template,v 1.1.2.5 2009/09/15 02:38:31 upholderoftruth Exp $
- */
-
-public interface TLongSet extends TLongCollection, Serializable {
-
-
- /**
- * Returns the value that is used to represent null. The default
- * value is generally zero, but can be changed during construction
- * of the collection.
- *
- * @return the value that represents null
- */
- long getNoEntryValue();
-
-
- /**
- * Returns the number of elements in this set (its cardinality). If this
- * set contains more than Integer.MAX_VALUE elements, returns
- * Integer.MAX_VALUE.
- *
- * @return the number of elements in this set (its cardinality)
- */
- int size();
-
-
- /**
- * Returns true if this set contains no elements.
- *
- * @return true if this set contains no elements
- */
- boolean isEmpty();
-
-
- /**
- * Returns true if this set contains the specified element.
- *
- * @param entry an long value
- * @return true if the set contains the specified element.
- */
- boolean contains( long entry );
-
-
- /**
- * Creates an iterator over the values of the set. The iterator
- * supports element deletion.
- *
- * @return an TLongIterator value
- */
- TLongIterator iterator();
-
-
- /**
- * Returns an array containing all of the elements in this set.
- * If this set makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the
- * elements in the same order.
- *
- *
The returned array will be "safe" in that no references to it - * are maintained by this set. (In other words, this method must - * allocate a new array even if this set is backed by an array). - * The caller is thus free to modify the returned array. - * - *
This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this set - */ - long[] toArray(); - - - /** - * Returns an array containing elements in this set. - * - *
If this set fits in the specified array with room to spare - * (i.e., the array has more elements than this set), the element in - * the array immediately following the end of the set is set to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this set only if the caller knows that this - * set does not contain any elements representing null.) - * - *
If the native array is smaller than the set size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *
If this set makes any guarantees as to what order its elements
- * are returned by its iterator, this method must return the elements
- * in the same order.
- *
- * @param dest the array into which the elements of this set are to be
- * stored.
- * @return an long[] containing all the elements in this set
- * @throws NullPointerException if the specified array is null
- */
- long[] toArray( long[] dest );
-
-
- /**
- * Inserts a value into the set.
- *
- * @param entry a long value
- * @return true if the set was modified by the add operation
- */
- boolean add( long entry );
-
-
- /**
- * Removes entry from the set.
- *
- * @param entry an long value
- * @return true if the set was modified by the remove operation.
- */
- boolean remove( long entry );
-
-
- /**
- * Tests the set to determine if all of the elements in
- * collection are present.
- *
- * @param collection a Collection value
- * @return true if all elements were present in the set.
- */
- boolean containsAll( Collection> collection );
-
-
- /**
- * Tests the set to determine if all of the elements in
- * TLongCollection are present.
- *
- * @param collection a TLongCollection value
- * @return true if all elements were present in the set.
- */
- boolean containsAll( TLongCollection collection );
-
-
- /**
- * Tests the set to determine if all of the elements in
- * array are present.
- *
- * @param array as array of long primitives.
- * @return true if all elements were present in the set.
- */
- boolean containsAll( long[] array );
-
-
- /**
- * Adds all of the elements in collection to the set.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the add all operation.
- */
- boolean addAll( Collection extends Long> collection );
-
-
- /**
- * Adds all of the elements in the TLongCollection to the set.
- *
- * @param collection a TLongCollection value
- * @return true if the set was modified by the add all operation.
- */
- boolean addAll( TLongCollection collection );
-
-
- /**
- * Adds all of the elements in the array to the set.
- *
- * @param array a array of long primitives.
- * @return true if the set was modified by the add all operation.
- */
- boolean addAll( long[] array );
-
-
- /**
- * Removes any values in the set which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the retain all operation
- */
- boolean retainAll( Collection> collection );
-
-
- /**
- * Removes any values in the set which are not contained in
- * TLongCollection.
- *
- * @param collection a TLongCollection value
- * @return true if the set was modified by the retain all operation
- */
- boolean retainAll( TLongCollection collection );
-
-
- /**
- * Removes any values in the set which are not contained in
- * array.
- *
- * @param array an array of long primitives.
- * @return true if the set was modified by the retain all operation
- */
- boolean retainAll( long[] array );
-
-
- /**
- * Removes all of the elements in collection from the set.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the remove all operation.
- */
- boolean removeAll( Collection> collection );
-
-
- /**
- * Removes all of the elements in TLongCollection from the set.
- *
- * @param collection a TLongCollection value
- * @return true if the set was modified by the remove all operation.
- */
- boolean removeAll( TLongCollection collection );
-
-
- /**
- * Removes all of the elements in array from the set.
- *
- * @param array an array of long primitives.
- * @return true if the set was modified by the remove all operation.
- */
- public boolean removeAll( long[] array );
-
-
- /**
- * Empties the set.
- */
- void clear();
-
-
- /**
- * Executes procedure for each element in the set.
- *
- * @param procedure a TLongProcedure value
- * @return false if the loop over the set terminated because
- * the procedure returned false for some value.
- */
- boolean forEach( TLongProcedure procedure );
-
-
- // Comparison and hashing
-
- /**
- * Compares the specified object with this set for equality. Returns
- * true if the specified object is also a set, the two sets
- * have the same size, and every member of the specified set is
- * contained in this set (or equivalently, every member of this set is
- * contained in the specified set). This definition ensures that the
- * equals method works properly across different implementations of the
- * set interface.
- *
- * @param o object to be compared for equality with this set
- * @return true if the specified object is equal to this set
- */
- boolean equals( Object o );
-
-
- /**
- * Returns the hash code value for this set. The hash code of a set is
- * defined to be the sum of the hash codes of the elements in the set.
- * This ensures that s1.equals(s2) implies that
- * s1.hashCode()==s2.hashCode() for any two sets s1
- * and s2, as required by the general contract of
- * {@link Object#hashCode}.
- *
- * @return the hash code value for this set
- * @see Object#equals(Object)
- * @see Set#equals(Object)
- */
- int hashCode();
-
-
-} // THashSet
diff --git a/src/gnu/trove/set/hash/THashSet.java b/src/gnu/trove/set/hash/THashSet.java
deleted file mode 100644
index 51b2eb5..0000000
--- a/src/gnu/trove/set/hash/THashSet.java
+++ /dev/null
@@ -1,411 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.set.hash;
-
-import gnu.trove.impl.hash.TObjectHash;
-import gnu.trove.impl.HashFunctions;
-import gnu.trove.procedure.TObjectProcedure;
-import gnu.trove.procedure.array.ToObjectArrayProceedure;
-import gnu.trove.iterator.hash.TObjectHashIterator;
-
-import java.io.*;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Arrays;
-import java.lang.reflect.Array;
-
-
-
-/**
- * An implementation of the Set interface that uses an
- * open-addressed hash table to store its contents.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- * @version $Id: THashSet.java,v 1.1.2.8 2010/03/02 04:09:50 robeden Exp $
- */
-
-public class THashSetTHashSet instance with the default
- * capacity and load factor.
- */
- public THashSet() {
- super();
- }
-
-
- /**
- * Creates a new THashSet instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the default load factor.
- *
- * @param initialCapacity an int value
- */
- public THashSet( int initialCapacity ) {
- super( initialCapacity );
- }
-
-
- /**
- * Creates a new THashSet instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the specified load factor.
- *
- * @param initialCapacity an int value
- * @param loadFactor a float value
- */
- public THashSet( int initialCapacity, float loadFactor ) {
- super( initialCapacity, loadFactor );
- }
-
-
- /**
- * Creates a new THashSet instance containing the
- * elements of collection.
- *
- * @param collection a Collection value
- */
- public THashSet( Collection extends E> collection ) {
- this( collection.size() );
- addAll( collection );
- }
-
-
- /**
- * Inserts a value into the set.
- *
- * @param obj an Object value
- * @return true if the set was modified by the add operation
- */
- public boolean add( E obj ) {
- int index = insertionIndex( obj );
-
- if ( index < 0 ) {
- return false; // already present in set, nothing to add
- }
-
- Object old = _set[index];
- _set[index] = obj;
-
- postInsertHook( old == FREE );
- return true; // yes, we added something
- }
-
-
- @SuppressWarnings({"SimplifiableIfStatement"})
- public boolean equals( Object other ) {
- if ( !( other instanceof Set ) ) {
- return false;
- }
- Set that = (Set) other;
- if ( that.size() != this.size() ) {
- return false;
- }
- return containsAll( that );
- }
-
-
- public int hashCode() {
- HashProcedure p = new HashProcedure();
- forEach( p );
- return p.getHashCode();
- }
-
-
- private final class HashProcedure implements TObjectProcedureint value
- */
- @SuppressWarnings({"unchecked"})
- protected void rehash( int newCapacity ) {
- int oldCapacity = _set.length;
-
- Object oldSet[] = _set;
-
- _set = new Object[newCapacity];
- Arrays.fill( _set, FREE );
-
- for ( int i = oldCapacity; i-- > 0; ) {
- if ( oldSet[i] != FREE && oldSet[i] != REMOVED ) {
- E o = (E) oldSet[i];
- int index = insertionIndex( o );
- if ( index < 0 ) { // everyone pays for this because some people can't RTFM
- throwObjectContractViolation( _set[( -index - 1 )], o );
- }
- _set[index] = o;
- }
- }
- }
-
-
- /**
- * Returns a new array containing the objects in the set.
- *
- * @return an Object[] value
- */
- @SuppressWarnings({"unchecked"})
- public Object[] toArray() {
- Object[] result = new Object[size()];
- forEach( new ToObjectArrayProceedure( result ) );
- return result;
- }
-
-
- /**
- * Returns a typed array of the objects in the set.
- *
- * @param a an Object[] value
- * @return an Object[] value
- */
- @SuppressWarnings({"unchecked"})
- public Object value
- * @return true if the set was modified by the remove operation.
- */
- @SuppressWarnings({"unchecked"})
- public boolean remove( Object obj ) {
- int index = index( obj );
- if ( index >= 0 ) {
- removeAt( index );
- return true;
- }
- return false;
- }
-
-
- /**
- * Creates an iterator over the values of the set. The iterator
- * supports element deletion.
- *
- * @return an Iterator value
- */
- @SuppressWarnings({"unchecked"})
- public TObjectHashIteratorCollection value
- * @return true if all elements were present in the set.
- */
- @SuppressWarnings("ForLoopReplaceableByForEach")
- public boolean containsAll( Collection> collection ) {
- for ( Iterator i = collection.iterator(); i.hasNext(); ) {
- if ( !contains( i.next() ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Adds all of the elements in collection to the set.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the add all operation.
- */
- public boolean addAll( Collection extends E> collection ) {
- boolean changed = false;
- int size = collection.size();
-
- ensureCapacity( size );
- Iterator extends E> it = collection.iterator();
- while ( size-- > 0 ) {
- if ( add( it.next() ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /**
- * Removes all of the elements in collection from the set.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the remove all operation.
- */
- public boolean removeAll( Collection> collection ) {
- boolean changed = false;
- int size = collection.size();
- Iterator it;
-
- it = collection.iterator();
- while ( size-- > 0 ) {
- if ( remove( it.next() ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /**
- * Removes any values in the set which are not contained in
- * collection.
- *
- * @param collection a Collection value
- * @return true if the set was modified by the retain all operation
- */
- @SuppressWarnings({"SuspiciousMethodCalls"})
- public boolean retainAll( Collection> collection ) {
- boolean changed = false;
- int size = size();
- IteratorTIntHashSet instance with the default
- * capacity and load factor.
- */
- public TIntHashSet() {
- super();
- }
-
-
- /**
- * Creates a new TIntHashSet instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the default load factor.
- *
- * @param initialCapacity an int value
- */
- public TIntHashSet( int initialCapacity ) {
- super( initialCapacity );
- }
-
-
- /**
- * Creates a new TIntHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param load_factor used to calculate the threshold over which
- * rehashing takes place.
- */
- public TIntHashSet( int initialCapacity, float load_factor ) {
- super( initialCapacity, load_factor );
- }
-
-
- /**
- * Creates a new TIntHashSet instance with a prime
- * capacity equal to or greater than initial_capacity and
- * with the specified load factor.
- *
- * @param initial_capacity an int value
- * @param load_factor a float value
- * @param no_entry_value a int value that represents null.
- */
- public TIntHashSet( int initial_capacity, float load_factor,
- int no_entry_value ) {
- super( initial_capacity, load_factor, no_entry_value );
- //noinspection RedundantCast
- if ( no_entry_value != ( int ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TIntHashSet instance that is a copy
- * of the existing Collection.
- *
- * @param collection a Collection that will be duplicated.
- */
- public TIntHashSet( Collection extends Integer> collection ) {
- this( Math.max( collection.size(), DEFAULT_CAPACITY ) );
- addAll( collection );
- }
-
-
- /**
- * Creates a new TIntHashSet instance that is a copy
- * of the existing set.
- *
- * @param collection a TIntSet that will be duplicated.
- */
- public TIntHashSet( TIntCollection collection ) {
- this( Math.max( collection.size(), DEFAULT_CAPACITY ) );
- if ( collection instanceof TIntHashSet ) {
- TIntHashSet hashset = ( TIntHashSet ) collection;
- this._loadFactor = hashset._loadFactor;
- this.no_entry_value = hashset.no_entry_value;
- //noinspection RedundantCast
- if ( this.no_entry_value != ( int ) 0 ) {
- Arrays.fill( _set, this.no_entry_value );
- }
- setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
- }
- addAll( collection );
- }
-
-
- /**
- * Creates a new TIntHashSet instance containing the
- * elements of array.
- *
- * @param array an array of int primitives
- */
- public TIntHashSet( int[] array ) {
- this( Math.max( array.length, DEFAULT_CAPACITY ) );
- addAll( array );
- }
-
-
- /** {@inheritDoc} */
- public TIntIterator iterator() {
- return new TIntHashIterator( this );
- }
-
-
- /** {@inheritDoc} */
- public int[] toArray() {
- int[] result = new int[ size() ];
- int[] set = _set;
- byte[] states = _states;
-
- for ( int i = states.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- result[j++] = set[i];
- }
- }
- return result;
- }
-
-
- /** {@inheritDoc} */
- public int[] toArray( int[] dest ) {
- int[] set = _set;
- byte[] states = _states;
-
- for ( int i = states.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- dest[j++] = set[i];
- }
- }
-
- if ( dest.length > _size ) {
- dest[_size] = no_entry_value;
- }
- return dest;
- }
-
-
- /** {@inheritDoc} */
- public boolean add( int val ) {
- int index = insertionIndex(val);
-
- if ( index < 0 ) {
- return false; // already present in set, nothing to add
- }
-
- byte previousState = _states[index];
- _set[index] = val;
- _states[index] = FULL;
- postInsertHook( previousState == FREE );
-
- return true; // yes, we added something
- }
-
-
- /** {@inheritDoc} */
- public boolean remove( int val ) {
- int index = index(val);
- if ( index >= 0 ) {
- removeAt( index );
- return true;
- }
- return false;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( Collection> collection ) {
- for ( Object element : collection ) {
- if ( element instanceof Integer ) {
- int c = ( ( Integer ) element ).intValue();
- if ( ! contains( c ) ) {
- return false;
- }
- } else {
- return false;
- }
-
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( TIntCollection collection ) {
- TIntIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- int element = iter.next();
- if ( ! contains( element ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( int[] array ) {
- for ( int i = array.length; i-- > 0; ) {
- if ( ! contains( array[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( Collection extends Integer> collection ) {
- boolean changed = false;
- for ( Integer element : collection ) {
- int e = element.intValue();
- if ( add( e ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( TIntCollection collection ) {
- boolean changed = false;
- TIntIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- int element = iter.next();
- if ( add( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( int[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( add( array[i] ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- @SuppressWarnings({"SuspiciousMethodCalls"})
- public boolean retainAll( Collection> collection ) {
- boolean modified = false;
- TIntIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( Integer.valueOf ( iter.next() ) ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( TIntCollection collection ) {
- if ( this == collection ) {
- return false;
- }
- boolean modified = false;
- TIntIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( iter.next() ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( int[] array ) {
- boolean changed = false;
- Arrays.sort( array );
- int[] set = _set;
- byte[] states = _states;
-
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) {
- removeAt( i );
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( Collection> collection ) {
- boolean changed = false;
- for ( Object element : collection ) {
- if ( element instanceof Integer ) {
- int c = ( ( Integer ) element ).intValue();
- if ( remove( c ) ) {
- changed = true;
- }
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( TIntCollection collection ) {
- boolean changed = false;
- TIntIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- int element = iter.next();
- if ( remove( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( int[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( remove(array[i]) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- super.clear();
- int[] set = _set;
- byte[] states = _states;
-
- for ( int i = set.length; i-- > 0; ) {
- set[i] = no_entry_value;
- states[i] = FREE;
- }
- }
-
-
- /** {@inheritDoc} */
- protected void rehash( int newCapacity ) {
- int oldCapacity = _set.length;
-
- int oldSet[] = _set;
- byte oldStates[] = _states;
-
- _set = new int[newCapacity];
- _states = new byte[newCapacity];
-
- for ( int i = oldCapacity; i-- > 0; ) {
- if( oldStates[i] == FULL ) {
- int o = oldSet[i];
- int index = insertionIndex(o);
- _set[index] = o;
- _states[index] = FULL;
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public boolean equals( Object other ) {
- if ( ! ( other instanceof TIntSet ) ) {
- return false;
- }
- TIntSet that = ( TIntSet ) other;
- if ( that.size() != this.size() ) {
- return false;
- }
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- if ( ! that.contains( _set[i] ) ) {
- return false;
- }
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public int hashCode() {
- int hashcode = 0;
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- hashcode += HashFunctions.hash( _set[i] );
- }
- }
- return hashcode;
- }
-
-
- /** {@inheritDoc} */
- public String toString() {
- StringBuilder buffy = new StringBuilder( _size * 2 + 2 );
- buffy.append("{");
- for ( int i = _states.length, j = 1; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- buffy.append( _set[i] );
- if ( j++ < _size ) {
- buffy.append( "," );
- }
- }
- }
- buffy.append("}");
- return buffy.toString();
- }
-
-
- class TIntHashIterator extends THashPrimitiveIterator implements TIntIterator {
-
- /** the collection on which the iterator operates */
- private final TIntHash _hash;
-
- /** {@inheritDoc} */
- public TIntHashIterator( TIntHash hash ) {
- super( hash );
- this._hash = hash;
- }
-
- /** {@inheritDoc} */
- public int next() {
- moveToNextIndex();
- return _hash._set[_index];
- }
- }
-
-
- /** {@inheritDoc} */
- public void writeExternal( ObjectOutput out ) throws IOException {
-
- // VERSION
- out.writeByte( 1 );
-
- // SUPER
- super.writeExternal( out );
-
- // NUMBER OF ENTRIES
- out.writeInt( _size );
-
- // LOAD FACTOR -- Added version 1
- out.writeFloat( _loadFactor );
-
- // NO ENTRY VALUE -- Added version 1
- out.writeInt( no_entry_value );
-
- // ENTRIES
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- out.writeInt( _set[i] );
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public void readExternal( ObjectInput in )
- throws IOException, ClassNotFoundException {
-
- // VERSION
- int version = in.readByte();
-
- // SUPER
- super.readExternal( in );
-
- // NUMBER OF ENTRIES
- int size = in.readInt();
-
- if ( version >= 1 ) {
- // LOAD FACTOR
- _loadFactor = in.readFloat();
-
- // NO ENTRY VALUE
- no_entry_value = in.readInt();
- //noinspection RedundantCast
- if ( no_entry_value != ( int ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
- // ENTRIES
- setUp( size );
- while ( size-- > 0 ) {
- int val = in.readInt();
- add( val );
- }
- }
-} // TIntHashSet
diff --git a/src/gnu/trove/set/hash/TLongHashSet.java b/src/gnu/trove/set/hash/TLongHashSet.java
deleted file mode 100644
index ea5d953..0000000
--- a/src/gnu/trove/set/hash/TLongHashSet.java
+++ /dev/null
@@ -1,551 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
-// Copyright (c) 2009, Rob Eden All Rights Reserved.
-// Copyright (c) 2009, Jeff Randall All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.set.hash;
-
-import gnu.trove.set.TLongSet;
-import gnu.trove.iterator.TLongIterator;
-import gnu.trove.impl.*;
-import gnu.trove.impl.hash.*;
-import gnu.trove.TLongCollection;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.Externalizable;
-import java.util.Arrays;
-import java.util.Collection;
-
-
-//////////////////////////////////////////////////
-// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
-//////////////////////////////////////////////////
-
-
-/**
- * An open addressed set implementation for long primitives.
- *
- * @author Eric D. Friedman
- * @author Rob Eden
- * @author Jeff Randall
- */
-
-public class TLongHashSet extends TLongHash implements TLongSet, Externalizable {
- static final long serialVersionUID = 1L;
-
-
- /**
- * Creates a new TLongHashSet instance with the default
- * capacity and load factor.
- */
- public TLongHashSet() {
- super();
- }
-
-
- /**
- * Creates a new TLongHashSet instance with a prime
- * capacity equal to or greater than initialCapacity and
- * with the default load factor.
- *
- * @param initialCapacity an int value
- */
- public TLongHashSet( int initialCapacity ) {
- super( initialCapacity );
- }
-
-
- /**
- * Creates a new TIntHash instance with a prime
- * value at or near the specified capacity and load factor.
- *
- * @param initialCapacity used to find a prime capacity for the table.
- * @param load_factor used to calculate the threshold over which
- * rehashing takes place.
- */
- public TLongHashSet( int initialCapacity, float load_factor ) {
- super( initialCapacity, load_factor );
- }
-
-
- /**
- * Creates a new TLongHashSet instance with a prime
- * capacity equal to or greater than initial_capacity and
- * with the specified load factor.
- *
- * @param initial_capacity an int value
- * @param load_factor a float value
- * @param no_entry_value a long value that represents null.
- */
- public TLongHashSet( int initial_capacity, float load_factor,
- long no_entry_value ) {
- super( initial_capacity, load_factor, no_entry_value );
- //noinspection RedundantCast
- if ( no_entry_value != ( long ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
-
- /**
- * Creates a new TLongHashSet instance that is a copy
- * of the existing Collection.
- *
- * @param collection a Collection that will be duplicated.
- */
- public TLongHashSet( Collection extends Long> collection ) {
- this( Math.max( collection.size(), DEFAULT_CAPACITY ) );
- addAll( collection );
- }
-
-
- /**
- * Creates a new TLongHashSet instance that is a copy
- * of the existing set.
- *
- * @param collection a TLongSet that will be duplicated.
- */
- public TLongHashSet( TLongCollection collection ) {
- this( Math.max( collection.size(), DEFAULT_CAPACITY ) );
- if ( collection instanceof TLongHashSet ) {
- TLongHashSet hashset = ( TLongHashSet ) collection;
- this._loadFactor = hashset._loadFactor;
- this.no_entry_value = hashset.no_entry_value;
- //noinspection RedundantCast
- if ( this.no_entry_value != ( long ) 0 ) {
- Arrays.fill( _set, this.no_entry_value );
- }
- setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) );
- }
- addAll( collection );
- }
-
-
- /**
- * Creates a new TLongHashSet instance containing the
- * elements of array.
- *
- * @param array an array of long primitives
- */
- public TLongHashSet( long[] array ) {
- this( Math.max( array.length, DEFAULT_CAPACITY ) );
- addAll( array );
- }
-
-
- /** {@inheritDoc} */
- public TLongIterator iterator() {
- return new TLongHashIterator( this );
- }
-
-
- /** {@inheritDoc} */
- public long[] toArray() {
- long[] result = new long[ size() ];
- long[] set = _set;
- byte[] states = _states;
-
- for ( int i = states.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- result[j++] = set[i];
- }
- }
- return result;
- }
-
-
- /** {@inheritDoc} */
- public long[] toArray( long[] dest ) {
- long[] set = _set;
- byte[] states = _states;
-
- for ( int i = states.length, j = 0; i-- > 0; ) {
- if ( states[i] == FULL ) {
- dest[j++] = set[i];
- }
- }
-
- if ( dest.length > _size ) {
- dest[_size] = no_entry_value;
- }
- return dest;
- }
-
-
- /** {@inheritDoc} */
- public boolean add( long val ) {
- int index = insertionIndex(val);
-
- if ( index < 0 ) {
- return false; // already present in set, nothing to add
- }
-
- byte previousState = _states[index];
- _set[index] = val;
- _states[index] = FULL;
- postInsertHook( previousState == FREE );
-
- return true; // yes, we added something
- }
-
-
- /** {@inheritDoc} */
- public boolean remove( long val ) {
- int index = index(val);
- if ( index >= 0 ) {
- removeAt( index );
- return true;
- }
- return false;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( Collection> collection ) {
- for ( Object element : collection ) {
- if ( element instanceof Long ) {
- long c = ( ( Long ) element ).longValue();
- if ( ! contains( c ) ) {
- return false;
- }
- } else {
- return false;
- }
-
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( TLongCollection collection ) {
- TLongIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- long element = iter.next();
- if ( ! contains( element ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean containsAll( long[] array ) {
- for ( int i = array.length; i-- > 0; ) {
- if ( ! contains( array[i] ) ) {
- return false;
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( Collection extends Long> collection ) {
- boolean changed = false;
- for ( Long element : collection ) {
- long e = element.longValue();
- if ( add( e ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( TLongCollection collection ) {
- boolean changed = false;
- TLongIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- long element = iter.next();
- if ( add( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean addAll( long[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( add( array[i] ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- @SuppressWarnings({"SuspiciousMethodCalls"})
- public boolean retainAll( Collection> collection ) {
- boolean modified = false;
- TLongIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( Long.valueOf ( iter.next() ) ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( TLongCollection collection ) {
- if ( this == collection ) {
- return false;
- }
- boolean modified = false;
- TLongIterator iter = iterator();
- while ( iter.hasNext() ) {
- if ( ! collection.contains( iter.next() ) ) {
- iter.remove();
- modified = true;
- }
- }
- return modified;
- }
-
-
- /** {@inheritDoc} */
- public boolean retainAll( long[] array ) {
- boolean changed = false;
- Arrays.sort( array );
- long[] set = _set;
- byte[] states = _states;
-
- for ( int i = set.length; i-- > 0; ) {
- if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) {
- removeAt( i );
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( Collection> collection ) {
- boolean changed = false;
- for ( Object element : collection ) {
- if ( element instanceof Long ) {
- long c = ( ( Long ) element ).longValue();
- if ( remove( c ) ) {
- changed = true;
- }
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( TLongCollection collection ) {
- boolean changed = false;
- TLongIterator iter = collection.iterator();
- while ( iter.hasNext() ) {
- long element = iter.next();
- if ( remove( element ) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public boolean removeAll( long[] array ) {
- boolean changed = false;
- for ( int i = array.length; i-- > 0; ) {
- if ( remove(array[i]) ) {
- changed = true;
- }
- }
- return changed;
- }
-
-
- /** {@inheritDoc} */
- public void clear() {
- super.clear();
- long[] set = _set;
- byte[] states = _states;
-
- for ( int i = set.length; i-- > 0; ) {
- set[i] = no_entry_value;
- states[i] = FREE;
- }
- }
-
-
- /** {@inheritDoc} */
- protected void rehash( int newCapacity ) {
- int oldCapacity = _set.length;
-
- long oldSet[] = _set;
- byte oldStates[] = _states;
-
- _set = new long[newCapacity];
- _states = new byte[newCapacity];
-
- for ( int i = oldCapacity; i-- > 0; ) {
- if( oldStates[i] == FULL ) {
- long o = oldSet[i];
- int index = insertionIndex(o);
- _set[index] = o;
- _states[index] = FULL;
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public boolean equals( Object other ) {
- if ( ! ( other instanceof TLongSet ) ) {
- return false;
- }
- TLongSet that = ( TLongSet ) other;
- if ( that.size() != this.size() ) {
- return false;
- }
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- if ( ! that.contains( _set[i] ) ) {
- return false;
- }
- }
- }
- return true;
- }
-
-
- /** {@inheritDoc} */
- public int hashCode() {
- int hashcode = 0;
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- hashcode += HashFunctions.hash( _set[i] );
- }
- }
- return hashcode;
- }
-
-
- /** {@inheritDoc} */
- public String toString() {
- StringBuilder buffy = new StringBuilder( _size * 2 + 2 );
- buffy.append("{");
- for ( int i = _states.length, j = 1; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- buffy.append( _set[i] );
- if ( j++ < _size ) {
- buffy.append( "," );
- }
- }
- }
- buffy.append("}");
- return buffy.toString();
- }
-
-
- class TLongHashIterator extends THashPrimitiveIterator implements TLongIterator {
-
- /** the collection on which the iterator operates */
- private final TLongHash _hash;
-
- /** {@inheritDoc} */
- public TLongHashIterator( TLongHash hash ) {
- super( hash );
- this._hash = hash;
- }
-
- /** {@inheritDoc} */
- public long next() {
- moveToNextIndex();
- return _hash._set[_index];
- }
- }
-
-
- /** {@inheritDoc} */
- public void writeExternal( ObjectOutput out ) throws IOException {
-
- // VERSION
- out.writeByte( 1 );
-
- // SUPER
- super.writeExternal( out );
-
- // NUMBER OF ENTRIES
- out.writeInt( _size );
-
- // LOAD FACTOR -- Added version 1
- out.writeFloat( _loadFactor );
-
- // NO ENTRY VALUE -- Added version 1
- out.writeLong( no_entry_value );
-
- // ENTRIES
- for ( int i = _states.length; i-- > 0; ) {
- if ( _states[i] == FULL ) {
- out.writeLong( _set[i] );
- }
- }
- }
-
-
- /** {@inheritDoc} */
- public void readExternal( ObjectInput in )
- throws IOException, ClassNotFoundException {
-
- // VERSION
- int version = in.readByte();
-
- // SUPER
- super.readExternal( in );
-
- // NUMBER OF ENTRIES
- int size = in.readInt();
-
- if ( version >= 1 ) {
- // LOAD FACTOR
- _loadFactor = in.readFloat();
-
- // NO ENTRY VALUE
- no_entry_value = in.readLong();
- //noinspection RedundantCast
- if ( no_entry_value != ( long ) 0 ) {
- Arrays.fill( _set, no_entry_value );
- }
- }
-
- // ENTRIES
- setUp( size );
- while ( size-- > 0 ) {
- long val = in.readLong();
- add( val );
- }
- }
-} // TIntHashSet
diff --git a/src/gnu/trove/strategy/HashingStrategy.java b/src/gnu/trove/strategy/HashingStrategy.java
deleted file mode 100644
index aa0f2f7..0000000
--- a/src/gnu/trove/strategy/HashingStrategy.java
+++ /dev/null
@@ -1,55 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2002, Eric D. Friedman All Rights Reserved.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-///////////////////////////////////////////////////////////////////////////////
-
-package gnu.trove.strategy;
-
-import java.io.Serializable;
-
-
-/**
- * Interface to support pluggable hashing strategies in maps and sets.
- * Implementers can use this interface to make the trove hashing
- * algorithms use object values, values provided by the java runtime,
- * or a custom strategy when computing hashcodes.
- *
- * @author Eric Friedman
- * @author Rob Eden
- */
-
-public interface HashingStrategyObject value
- * @param o2 an Object value
- * @return true if the objects are equal according to this strategy.
- */
- boolean equals( T o1, T o2 );
-}
diff --git a/src/gnu/trove/strategy/IdentityHashingStrategy.java b/src/gnu/trove/strategy/IdentityHashingStrategy.java
deleted file mode 100644
index b61118d..0000000
--- a/src/gnu/trove/strategy/IdentityHashingStrategy.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package gnu.trove.strategy;
-
-/**
- * A {@link gnu.trove.strategy.HashingStrategy} that does identity comparisons
- * (==) and uses {@link System#identityHashCode(Object)} for hashCode generation.
- */
-public class IdentityHashingStrategy
- * AAAATTTT
- *
- *
- * The corresponding alignment to some other sequence of this reference is
- *
- *
- * AAAA----TTTT
- *
- *
- * Then this method allows you the query which position in the original
- * reference sequence corresponds to which position in the reference
- * alignment.
- *
- * For example 5 in the reference sequence maps to 9 in the reference
- * alignment. And 4 maps to 4.
- *
- * Both coordinates are 1 based!
- *
- */
- public int ref2aln(int position) {
- if(position>mapping.length){
- return mapping[mapping.length-1];
-// throw new IllegalArgumentException((position-1)+"\t"+mapping.length);
- }
- if (mapping[position - 1] == 0)
- System.err.println("ref2aln: " + (position - 1) + "\t" + mapping[position - 1]);
- return mapping[position - 1];
- }
-
- public int getRefGapCount() {
- return refGapCount;
-
- }
-
-}
\ No newline at end of file
diff --git a/src/net/sf/jannot/alignment/maf/AbstractAlignmentBlock.java b/src/net/sf/jannot/alignment/maf/AbstractAlignmentBlock.java
deleted file mode 100644
index 4c44ef9..0000000
--- a/src/net/sf/jannot/alignment/maf/AbstractAlignmentBlock.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * %HEADER%
- */
-package net.sf.jannot.alignment.maf;
-
-import net.sf.jannot.Located;
-import net.sf.jannot.Location;
-import net.sf.jannot.Strand;
-import net.sf.jannot.refseq.Sequence;
-
-/**
- * @author Thomas Abeel
- *
- */
-public abstract class AbstractAlignmentBlock implements Comparable