You can subscribe to this list here.
2002 |
Jan
(14) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(3) |
Aug
(6) |
Sep
(14) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1) |
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(2) |
Sep
(3) |
Oct
|
Nov
(7) |
Dec
(3) |
2004 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
(11) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(29) |
Dec
(16) |
2007 |
Jan
(11) |
Feb
(6) |
Mar
(12) |
Apr
(2) |
May
|
Jun
(16) |
Jul
(9) |
Aug
(5) |
Sep
|
Oct
(4) |
Nov
(8) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(23) |
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(11) |
Nov
(2) |
Dec
(3) |
2009 |
Jan
|
Feb
(2) |
Mar
(15) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(65) |
Sep
(180) |
Oct
(52) |
Nov
(33) |
Dec
|
2010 |
Jan
(5) |
Feb
(3) |
Mar
(24) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(49) |
Oct
|
Nov
|
Dec
|
From: Rob E. <ro...@us...> - 2007-01-10 21:47:03
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7591/trove/src/gnu/trove Modified Files: THashSet.java THashMap.java Log Message: Implement Iterable on THashSet and THashMap. Index: THashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashSet.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** THashSet.java 10 Nov 2006 23:27:55 -0000 1.15 --- THashSet.java 10 Jan 2007 21:47:00 -0000 1.16 *************** *** 36,40 **** */ ! public class THashSet<E> extends TObjectHash<E> implements Set<E>, Externalizable { static final long serialVersionUID = 1L; --- 36,42 ---- */ ! public class THashSet<E> extends TObjectHash<E> ! implements Set<E>, Iterable<E>, Externalizable { ! static final long serialVersionUID = 1L; Index: THashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashMap.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** THashMap.java 11 Dec 2006 21:17:10 -0000 1.24 --- THashMap.java 10 Jan 2007 21:47:00 -0000 1.25 *************** *** 594,598 **** private abstract class MapBackedView<E> extends AbstractSet<E> ! implements Set<E> { public abstract Iterator<E> iterator(); --- 594,598 ---- private abstract class MapBackedView<E> extends AbstractSet<E> ! implements Set<E>, Iterable<E> { public abstract Iterator<E> iterator(); |
From: Rob E. <ro...@us...> - 2007-01-10 21:47:03
|
Update of /cvsroot/trove4j/trove/test/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7591/trove/test/gnu/trove Modified Files: THashSetTest.java THashMapTest.java Log Message: Implement Iterable on THashSet and THashMap. Index: THashSetTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/THashSetTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** THashSetTest.java 14 Nov 2006 23:56:35 -0000 1.2 --- THashSetTest.java 10 Jan 2007 21:47:00 -0000 1.3 *************** *** 30,33 **** --- 30,34 ---- import java.util.Set; + /** * *************** *** 219,222 **** --- 220,235 ---- } + + public void testIterable() { + + Set<String> set = new THashSet<String>(); + set.add( "One" ); + set.add( "Two" ); + + for( String s : set ) { + assertTrue(s.equals("One") || s.equals("Two" )); + } + } + // in this junk class, all instances hash to the same // address, but some objects claim to be equal where Index: THashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/THashMapTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** THashMapTest.java 4 Dec 2006 19:23:56 -0000 1.7 --- THashMapTest.java 10 Jan 2007 21:47:00 -0000 1.8 *************** *** 674,676 **** --- 674,690 ---- } } + + public void testIterable() { + Map<String,Integer> m = new THashMap<String,Integer>(); + m.put( "One", Integer.valueOf( 1 ) ); + m.put( "Two", Integer.valueOf( 2 ) ); + + for( String s : m.keySet() ) { + assertTrue(s.equals("One") || s.equals("Two" )); + } + + for( Integer i : m.values() ) { + assertTrue(i == 1 || i == 2); + } + } } // THashMapTests |
From: Rob E. <ro...@us...> - 2007-01-10 21:47:02
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7591/trove Modified Files: ChangeLog Log Message: Implement Iterable on THashSet and THashMap. Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** ChangeLog 21 Dec 2006 20:52:41 -0000 1.45 --- ChangeLog 10 Jan 2007 21:47:00 -0000 1.46 *************** *** 4,7 **** --- 4,8 ---- [ 1606090 ] adjustOrPutValue [ 1604073 ] Generate primitive stacks + [ 1632250 ] Do maps implement Iterable |
From: Rob E. <ro...@us...> - 2007-01-09 01:26:16
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26541/trove/src/gnu/trove Modified Files: TObjectHash.java Log Message: Removed redundant check in inner search loop. Index: TObjectHash.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectHash.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TObjectHash.java 9 Jan 2007 01:18:29 -0000 1.20 --- TObjectHash.java 9 Jan 2007 01:26:14 -0000 1.21 *************** *** 193,198 **** Object cur = set[index]; ! if (cur != FREE ! && (cur == REMOVED || ! hashing_strategy.equals((T) cur, obj))) { // see Knuth, p. 529 final int probe = 1 + (hash % (length - 2)); --- 193,200 ---- Object cur = set[index]; ! if ( cur == FREE ) return -1; ! ! // NOTE: here it has to be REMOVED or FULL (some user-given value) ! if (! hashing_strategy.equals((T) cur, obj)) { // see Knuth, p. 529 final int probe = 1 + (hash % (length - 2)); *************** *** 205,209 **** cur = set[index]; } while (cur != FREE ! && (cur == REMOVED || ! hashing_strategy.equals((T) cur, obj))); } --- 207,211 ---- cur = set[index]; } while (cur != FREE ! && (! hashing_strategy.equals((T) cur, obj))); } |
From: Rob E. <ro...@us...> - 2007-01-09 01:18:31
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23136/trove/src/gnu/trove Modified Files: TObjectHash.java Log Message: Grab local copies and make fields final to allow better HotSpot optimization. Index: TObjectHash.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectHash.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TObjectHash.java 15 Nov 2006 21:31:42 -0000 1.19 --- TObjectHash.java 9 Jan 2007 01:18:29 -0000 1.20 *************** *** 33,48 **** static final long serialVersionUID = -3461112548087185871L; - private static final boolean USE_EXPERIMENTAL_PROBE; - static { - boolean use_new_probe; - try { - use_new_probe = System.getProperty( "gnu.trove.use_experimatal_probe" ) != null; - } - catch( Exception ex ) { // for security exceptions - use_new_probe = false; - } - USE_EXPERIMENTAL_PROBE = use_new_probe; - } - /** the set of Objects */ --- 33,36 ---- *************** *** 197,215 **** */ protected int index(T obj) { ! int hash, probe, index, length; ! Object[] set; ! Object cur; ! set = _set; ! length = set.length; ! hash = _hashingStrategy.computeHashCode(obj) & 0x7fffffff; ! index = hash % length; ! cur = set[index]; if (cur != FREE ! && (cur == REMOVED || ! _hashingStrategy.equals((T) cur, obj))) { // see Knuth, p. 529 ! if ( USE_EXPERIMENTAL_PROBE ) probe = 1 + ((hash*9 & 0x7FFFFFFF) % (length - 2)); ! else probe = 1 + (hash % (length - 2)); do { --- 185,200 ---- */ protected int index(T obj) { ! final TObjectHashingStrategy<T> hashing_strategy = _hashingStrategy; ! final Object[] set = _set; ! final int length = set.length; ! final int hash = hashing_strategy.computeHashCode(obj) & 0x7fffffff; ! int index = hash % length; ! Object cur = set[index]; if (cur != FREE ! && (cur == REMOVED || ! hashing_strategy.equals((T) cur, obj))) { // see Knuth, p. 529 ! final int probe = 1 + (hash % (length - 2)); do { *************** *** 220,224 **** cur = set[index]; } while (cur != FREE ! && (cur == REMOVED || ! _hashingStrategy.equals((T) cur, obj))); } --- 205,209 ---- cur = set[index]; } while (cur != FREE ! && (cur == REMOVED || ! hashing_strategy.equals((T) cur, obj))); } *************** *** 237,258 **** */ protected int insertionIndex(T obj) { ! int hash, probe, index, length; ! Object[] set; ! Object cur; ! set = _set; ! length = set.length; ! hash = _hashingStrategy.computeHashCode(obj) & 0x7fffffff; ! index = hash % length; ! cur = set[index]; if (cur == FREE) { return index; // empty, all done ! } else if (_hashingStrategy.equals((T) cur, obj)) { return -index -1; // already stored } else { // already FULL or REMOVED, must probe // compute the double hash ! if ( USE_EXPERIMENTAL_PROBE ) probe = 1 + ((hash*9 & 0x7FFFFFFF) % (length - 2)); ! else probe = 1 + (hash % (length - 2)); // if the slot we landed on is FULL (but not removed), probe --- 222,240 ---- */ protected int insertionIndex(T obj) { ! final TObjectHashingStrategy<T> hashing_strategy = _hashingStrategy; ! final Object[] set = _set; ! final int length = set.length; ! final int hash = hashing_strategy.computeHashCode(obj) & 0x7fffffff; ! int index = hash % length; ! Object cur = set[index]; if (cur == FREE) { return index; // empty, all done ! } else if (hashing_strategy.equals((T) cur, 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 *************** *** 278,282 **** } while (cur != FREE && cur != REMOVED ! && ! _hashingStrategy.equals((T) cur, obj)); } --- 260,264 ---- } while (cur != FREE && cur != REMOVED ! && ! hashing_strategy.equals((T) cur, obj)); } *************** *** 287,291 **** int firstRemoved = index; while (cur != FREE ! && (cur == REMOVED || ! _hashingStrategy.equals((T) cur, obj))) { index -= probe; if (index < 0) { --- 269,273 ---- int firstRemoved = index; while (cur != FREE ! && (cur == REMOVED || ! hashing_strategy.equals((T) cur, obj))) { index -= probe; if (index < 0) { |
From: Rob E. <ro...@us...> - 2007-01-09 00:26:32
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1611/trove/src/gnu/trove Modified Files: THashIterator.java Log Message: Rename field so the name doesn't conflict with parent field. Wasn't causing any problems, but might be confusing and cause unexpected behavior down the road. Index: THashIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashIterator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** THashIterator.java 10 Nov 2006 23:27:55 -0000 1.6 --- THashIterator.java 9 Jan 2007 00:26:31 -0000 1.7 *************** *** 45,49 **** */ abstract class THashIterator<V> extends TIterator implements Iterator<V> { ! protected final TObjectHash _hash; /** --- 45,49 ---- */ abstract class THashIterator<V> extends TIterator implements Iterator<V> { ! private final TObjectHash _object_hash; /** *************** *** 52,56 **** public THashIterator(TObjectHash hash) { super(hash); ! _hash = hash; } --- 52,56 ---- public THashIterator(TObjectHash hash) { super(hash); ! _object_hash = hash; } *************** *** 83,87 **** } ! Object[] set = _hash._set; int i = _index; while (i-- > 0 && (set[i] == TObjectHash.FREE || set[i] == TObjectHash.REMOVED)) ; --- 83,87 ---- } ! Object[] set = _object_hash._set; int i = _index; while (i-- > 0 && (set[i] == TObjectHash.FREE || set[i] == TObjectHash.REMOVED)) ; |
From: Rob E. <ro...@us...> - 2006-12-21 20:52:44
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7053/trove/src/gnu/trove Modified Files: HashFunctions.java Removed Files: TIntStack.java Log Message: RFE #1604073 - Generate primitive stacks. Stacks are now generated using templates and so stacks are generated for all primitive types. Index: HashFunctions.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/HashFunctions.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HashFunctions.java 10 Nov 2006 23:27:54 -0000 1.4 --- HashFunctions.java 21 Dec 2006 20:52:41 -0000 1.5 *************** *** 36,40 **** * @return a hash code value for the specified value. */ ! public static final int hash(float value) { return Float.floatToIntBits(value*663608941.737f); // this avoids excessive hashCollisions in the case values are --- 36,40 ---- * @return a hash code value for the specified value. */ ! public static int hash(float value) { return Float.floatToIntBits(value*663608941.737f); // this avoids excessive hashCollisions in the case values are *************** *** 43,71 **** /** ! * Returns a hashcode for the specified value. The hashcode is computed as ! * <blockquote><pre> ! * 31^5*(d[0]*31^(n-1) + d[1]*31^(n-2) + ... + d[n-1]) ! * </pre></blockquote> ! * using <code>int</code> arithmetic, where <code>d[i]</code> is ! * the <i>i</i>th digit of the value, counting from the right, ! * <code>n</code> is the number of decimal digits of the specified ! * value, and <code>^</code> indicates exponentiation. (The hash ! * value of the value zero is zero.) * ! * @return a hash code value for the specified value. */ ! public static final int hash(int value) { ! //return value * 0x278DDE6D; // see cern.jet.random.engine.DRand ! return value; - - /* - value &= 0x7FFFFFFF; // make it >=0 - int hashCode = 0; - do hashCode = 31*hashCode + value%10; - while ((value /= 10) > 0); - - return 28629151*hashCode; // spread even further; h*31^5 - */ } --- 43,52 ---- /** ! * Returns a hashcode for the specified value. * ! * @return a hash code value for the specified value. */ ! public static int hash(int value) { return value; } *************** *** 75,98 **** * @return a hash code value for the specified value. */ ! public static final int hash(long value) { return (int)(value ^ (value >> 32)); - - /* - * The hashcode is computed as - * <blockquote><pre> - * 31^5*(d[0]*31^(n-1) + d[1]*31^(n-2) + ... + d[n-1]) - * </pre></blockquote> - * using <code>int</code> arithmetic, where <code>d[i]</code> is the - * <i>i</i>th digit of the value, counting from the right, <code>n</code> is the number of decimal digits of the specified value, - * and <code>^</code> indicates exponentiation. - * (The hash value of the value zero is zero.) - - value &= 0x7FFFFFFFFFFFFFFFL; // make it >=0 (0x7FFFFFFFFFFFFFFFL==Long.MAX_VALUE) - int hashCode = 0; - do hashCode = 31*hashCode + (int) (value%10); - while ((value /= 10) > 0); - - return 28629151*hashCode; // spread even further; h*31^5 - */ } --- 56,61 ---- * @return a hash code value for the specified value. */ ! public static int hash(long value) { return (int)(value ^ (value >> 32)); } *************** *** 102,106 **** * @return a hash code value for the specified object. */ ! public static final int hash(Object object) { return object==null ? 0 : object.hashCode(); } --- 65,69 ---- * @return a hash code value for the specified object. */ ! public static int hash(Object object) { return object==null ? 0 : object.hashCode(); } --- TIntStack.java DELETED --- |
From: Rob E. <ro...@us...> - 2006-12-21 20:52:44
|
Update of /cvsroot/trove4j/trove/src/gnu/trove/generate In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7053/trove/src/gnu/trove/generate Modified Files: Generate.java Added Files: PStack.template Log Message: RFE #1604073 - Generate primitive stacks. Stacks are now generated using templates and so stacks are generated for all primitive types. --- NEW FILE: PStack.template --- /////////////////////////////////////////////////////////////////////////////// // 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; /** * A stack of #e# primitives, backed by a T#E#ArrayList. * * @author Eric D. Friedman, Rob Eden * @version $Id: PStack.template,v 1.1 2006/12/21 20:52:41 robeden Exp $ */ public class T#E#Stack { /** the list used to hold the stack values. */ protected T#E#ArrayList _list; public static final int DEFAULT_CAPACITY = T#E#ArrayList.DEFAULT_CAPACITY; /** * Creates a new <code>T#E#Stack</code> instance with the default * capacity. */ public T#E#Stack() { this(DEFAULT_CAPACITY); } /** * Creates a new <code>T#E#Stack</code> instance with the * specified capacity. * * @param capacity the initial depth of the stack */ public T#E#Stack(int capacity) { _list = new T#E#ArrayList(capacity); } /** * Pushes the value onto the top of the stack. * * @param val an <code>#e#</code> value */ public void push(#e# val) { _list.add(val); } /** * Removes and returns the value at the top of the stack. * * @return an <code>#e#</code> value */ public #e# pop() { return _list.remove(_list.size() - 1); } /** * Returns the value at the top of the stack. * * @return an <code>#e#</code> value */ public #e# peek() { return _list.get(_list.size() - 1); } /** * Returns the current depth of the stack. */ public int size() { return _list.size(); } /** * Clears the stack, reseting its capacity to the default. */ public void clear() { _list.clear(DEFAULT_CAPACITY); } /** * Clears the stack without releasing its internal capacity allocation. */ public void reset() { _list.reset(); } } // T#E#Stack Index: Generate.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/Generate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Generate.java 13 Nov 2006 20:19:04 -0000 1.2 --- Generate.java 21 Dec 2006 20:52:41 -0000 1.3 *************** *** 91,94 **** --- 91,97 ---- generate( "PHashSet.template", "T", "HashSet.java", output_path); + // Stacks + generate( "PStack.template", "T", "Stack.java", output_path); + System.out.println( "Generation complete." ); } |
From: Rob E. <ro...@us...> - 2006-12-21 20:52:44
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7053/trove Modified Files: ChangeLog Log Message: RFE #1604073 - Generate primitive stacks. Stacks are now generated using templates and so stacks are generated for all primitive types. Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ChangeLog 11 Dec 2006 21:03:48 -0000 1.44 --- ChangeLog 21 Dec 2006 20:52:41 -0000 1.45 *************** *** 1,6 **** ! v 2.0b1 New Features: [ 1606090 ] adjustOrPutValue --- 1,7 ---- ! v 2.0rc1 New Features: [ 1606090 ] adjustOrPutValue + [ 1604073 ] Generate primitive stacks |
From: Rob E. <ro...@us...> - 2006-12-11 21:17:19
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26461/trove/src/gnu/trove Modified Files: THashMap.java Log Message: Kill a couple of unnecessary casts Index: THashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashMap.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** THashMap.java 21 Nov 2006 18:19:35 -0000 1.23 --- THashMap.java 11 Dec 2006 21:17:10 -0000 1.24 *************** *** 130,134 **** public THashMap<K,V> clone() { THashMap<K,V> m = (THashMap<K,V>)super.clone(); ! m._values = (V[])this._values.clone(); return m; } --- 130,134 ---- public THashMap<K,V> clone() { THashMap<K,V> m = (THashMap<K,V>)super.clone(); ! m._values = this._values.clone(); return m; } *************** *** 480,484 **** */ public boolean containsKey(Object key) { ! return contains((K) key); } --- 480,484 ---- */ public boolean containsKey(Object key) { ! return contains(key); } *************** *** 691,695 **** public boolean containsElement(K key) { ! return THashMap.this.contains((K) key); } } --- 691,695 ---- public boolean containsElement(K key) { ! return THashMap.this.contains(key); } } |
From: Rob E. <ro...@us...> - 2006-12-11 21:03:51
|
Update of /cvsroot/trove4j/trove/src/gnu/trove/generate In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19914/trove/src/gnu/trove/generate Modified Files: O2PHashMap.template P2PHashMap.template Log Message: Code for feature #1606090 (adjustOrPutValue). Includes unit tests and internal benchmark. Index: O2PHashMap.template =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/O2PHashMap.template,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** O2PHashMap.template 15 Nov 2006 22:40:32 -0000 1.2 --- O2PHashMap.template 11 Dec 2006 21:03:48 -0000 1.3 *************** *** 497,500 **** --- 497,535 ---- } + /** + * Adjusts the primitive value mapped to the key if the key is present in the map. + * Otherwise, the <tt>initial_value</tt> 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 + * + * @since 2.0b1 + */ + public #e# adjustOrPutValue(final K key, final #e# adjust_amount, final #e# put_amount ) { + int index = insertionIndex(key); + final boolean isNewMapping; + final #e# newValue; + if (index < 0) { + index = -index -1; + newValue = ( _values[index] += adjust_amount ); + isNewMapping = false; + } else { + newValue = ( _values[index] = put_amount ); + isNewMapping = true; + } + + K oldKey = (K) _set[index]; + _set[index] = key; + + if ( isNewMapping ) { + postInsertHook(oldKey == FREE); + } + + return newValue; + } + public void writeExternal( ObjectOutput out ) throws IOException { Index: P2PHashMap.template =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/P2PHashMap.template,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** P2PHashMap.template 10 Nov 2006 23:28:00 -0000 1.1 --- P2PHashMap.template 11 Dec 2006 21:03:48 -0000 1.2 *************** *** 346,349 **** --- 346,374 ---- /** + * returns the keys of the map. + * + * @param a 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 a <code>Set</code> value + */ + public #e#[] keys(#e#[] a) { + int size = size(); + if (a.length < size) { + a = (#e#[]) java.lang.reflect.Array.newInstance( + a.getClass().getComponentType(), size); + } + + #e#[] k = (#e#[]) _set; + + for (int i = k.length, j = 0; i-- > 0;) { + if (k[i] != FREE && k[i] != REMOVED) { + a[j++] = k[i]; + } + } + return a; + } + + /** * checks for the presence of <tt>val</tt> in the values of the map. * *************** *** 486,489 **** --- 511,550 ---- } + /** + * Adjusts the primitive value mapped to the key if the key is present in the map. + * Otherwise, the <tt>initial_value</tt> 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 + * + * @since 2.0b1 + */ + public #f# adjustOrPutValue(final #e# key, final #f# adjust_amount, final #f# put_amount ) { + int index = insertionIndex(key); + final boolean isNewMapping; + final #f# 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; + } + public void writeExternal( ObjectOutput out ) throws IOException { |
From: Rob E. <ro...@us...> - 2006-12-11 21:03:51
|
Update of /cvsroot/trove4j/trove/src/gnu/trove/benchmark In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19914/trove/src/gnu/trove/benchmark Modified Files: Main.java Log Message: Code for feature #1606090 (adjustOrPutValue). Includes unit tests and internal benchmark. Index: Main.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/benchmark/Main.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Main.java 15 Nov 2006 21:14:47 -0000 1.4 --- Main.java 11 Dec 2006 21:03:48 -0000 1.5 *************** *** 34,38 **** static final int SET_SIZE = 100000; ! static final List dataset = new ArrayList(SET_SIZE); static { for (int i = 0; i < SET_SIZE; i++) { --- 34,38 ---- static final int SET_SIZE = 100000; ! static final List<Integer> dataset = new ArrayList<Integer>(SET_SIZE); static { for (int i = 0; i < SET_SIZE; i++) { *************** *** 263,266 **** --- 263,267 ---- } + static Operation getIterationWithHasNextOp() { final Map theirMap = new HashMap(dataset.size()); *************** *** 355,358 **** --- 356,402 ---- } + // This is an internal test comparing the old method using adjustValue() & put() to the + // new adjustOrPutValue() method. + static Operation getAdjustCompareOp() { + final TObjectIntHashMap<Integer> theirs = new TObjectIntHashMap<Integer>(); + final TObjectIntHashMap<Integer> ours = new TObjectIntHashMap<Integer>(); + + for( int i = 0; i < SET_SIZE; i++ ) { + if ( ( i % 1000 ) == 0 ) { + Integer int_obj = dataset.get( i ); + + theirs.put( int_obj, int_obj.intValue() ); + ours.put( int_obj, int_obj.intValue() ); + } + } + + return new Operation() { + public void theirs() { + int size = dataset.size(); + for( int i = 0; i < size; i++ ) { + Integer key = dataset.get(i); + if ( !theirs.adjustValue(key, 1) ) { + theirs.put(key,1); + } + } + } + + public void ours() { + int size = dataset.size(); + for( int i = 0; i < size; i++ ) { + theirs.adjustOrPutValue(dataset.get(i), 1, 1); + } + } + + public String toString() { + return "compares adjustValue & put vs. adjustOrPutValue"; + } + + public int getIterationCount() { + return ITERATIONS; + } + }; + } + public static void main (String[] args) { *************** *** 364,367 **** --- 408,416 ---- reporter.start(); + // NOTE: this is internal only + // op = getAdjustCompareOp(); // 10 times + // t = new Repeater(op); + // reporter.report(t.run()); + op = getRandomSetContainsOp(); // 10 times t = new Repeater(op); |
From: Rob E. <ro...@us...> - 2006-12-11 21:03:51
|
Update of /cvsroot/trove4j/trove/test/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19914/trove/test/gnu/trove Modified Files: O2PHashMapTest.java Added Files: P2PHashMapTest.java Log Message: Code for feature #1606090 (adjustOrPutValue). Includes unit tests and internal benchmark. --- NEW FILE: P2PHashMapTest.java --- /* * Copyright(c) 2006, NEXVU Technologies * All rights reserved. */ package gnu.trove; import gnu.trove.decorator.TByteIntHashMapDecorator; import junit.framework.TestCase; import java.util.Iterator; import java.util.Map; import java.util.Set; /** * */ public class P2PHashMapTest extends TestCase { final byte KEY_ONE = ( byte ) 100; final byte KEY_TWO = ( byte ) 101; public P2PHashMapTest( String name ) { super( name ); } public void testKeys() { TByteIntHashMap map = new TByteIntHashMap(); map.put( KEY_ONE, 1 ); map.put( KEY_TWO, 2 ); assertEquals( 2, map.size() ); byte[] keys = map.keys( new byte[ map.size() ] ); assertEquals( 2, keys.length ); TByteArrayList keys_list = new TByteArrayList( keys ); assertTrue( keys_list.contains( KEY_ONE ) ); assertTrue( keys_list.contains( KEY_TWO ) ); byte[] keys2 = map.keys(); assertEquals( 2, keys2.length ); TByteArrayList keys_list2 = new TByteArrayList( keys2 ); assertTrue( keys_list2.contains( KEY_ONE ) ); assertTrue( keys_list2.contains( KEY_TWO ) ); } public void testDecorator() { TByteIntHashMap map = new TByteIntHashMap(); map.put( KEY_ONE, 1 ); map.put( KEY_TWO, 2 ); Map<Byte,Integer> decorator = new TByteIntHashMapDecorator( map ); assertEquals( 2, decorator.size() ); assertEquals( Integer.valueOf( 1 ), decorator.get( Byte.valueOf( KEY_ONE ) ) ); assertEquals( Integer.valueOf( 2 ), decorator.get( Byte.valueOf( KEY_TWO ) ) ); Set<Byte> decorator_keys = decorator.keySet(); assertEquals( 2, decorator_keys.size() ); Iterator<Byte> it = decorator_keys.iterator(); int count = 0; while( it.hasNext() ) { count++; System.out.println(it.next()); } assertEquals( 2, count ); assertSame(map, ( ( TByteIntHashMapDecorator ) decorator ).getMap() ); } public void testIterator() { TByteIntHashMap map = new TByteIntHashMap(); TByteIntIterator iterator = map.iterator(); assertFalse( iterator.hasNext() ); map.put( KEY_ONE, 1 ); map.put( KEY_TWO, 2 ); iterator = map.iterator(); assertTrue( iterator.hasNext() ); iterator.advance(); assertTrue( iterator.hasNext() ); iterator.advance(); assertFalse( iterator.hasNext() ); } public void testAdjustValue() { TByteIntHashMap map = new TByteIntHashMap(); map.put( KEY_ONE, 1 ); boolean changed = map.adjustValue( KEY_ONE, 1 ); assertTrue(changed); assertEquals( 2, map.get( KEY_ONE ) ); changed = map.adjustValue( KEY_ONE, 5 ); assertTrue(changed); assertEquals( 7, map.get( KEY_ONE ) ); changed = map.adjustValue( KEY_ONE, -3 ); assertTrue(changed); assertEquals( 4, map.get( KEY_ONE ) ); changed = map.adjustValue( KEY_TWO, 1 ); assertFalse(changed); assertFalse(map.containsKey( KEY_TWO )); } public void testAdjustOrPutValue() { TByteIntHashMap map = new TByteIntHashMap(); map.put( KEY_ONE, 1 ); long new_value = map.adjustOrPutValue( KEY_ONE, 1, 100 ); assertEquals(2, new_value); assertEquals( 2, map.get( KEY_ONE ) ); new_value = map.adjustOrPutValue( KEY_ONE, 5, 100 ); assertEquals(7, new_value); assertEquals( 7, map.get( KEY_ONE ) ); new_value = map.adjustOrPutValue( KEY_ONE, -3, 100 ); assertEquals(4, new_value); assertEquals( 4, map.get( KEY_ONE ) ); new_value = map.adjustOrPutValue( KEY_TWO, 1, 100 ); assertEquals(100, new_value); assertTrue(map.containsKey( KEY_TWO )); assertEquals( 100, map.get( KEY_TWO ) ); new_value = map.adjustOrPutValue( KEY_TWO, 1, 100 ); assertEquals(101, new_value); assertEquals( 101, map.get( KEY_TWO ) ); } } Index: O2PHashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/O2PHashMapTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** O2PHashMapTest.java 5 Dec 2006 20:32:27 -0000 1.3 --- O2PHashMapTest.java 11 Dec 2006 21:03:48 -0000 1.4 *************** *** 100,102 **** --- 100,153 ---- assertFalse( iterator.hasNext() ); } + + + public void testAdjustValue() { + TObjectIntHashMap<String> map = new TObjectIntHashMap<String>(); + + map.put( "one", 1 ); + + boolean changed = map.adjustValue( "one", 1 ); + assertTrue(changed); + assertEquals( 2, map.get( "one" ) ); + + changed = map.adjustValue( "one", 5 ); + assertTrue(changed); + assertEquals( 7, map.get( "one" ) ); + + changed = map.adjustValue( "one", -3 ); + assertTrue(changed); + assertEquals( 4, map.get( "one" ) ); + + changed = map.adjustValue( "two", 1 ); + assertFalse(changed); + assertFalse(map.containsKey( "two" )); + } + + + public void testAdjustOrPutValue() { + TObjectIntHashMap<String> map = new TObjectIntHashMap<String>(); + + map.put( "one", 1 ); + + long new_value = map.adjustOrPutValue( "one", 1, 100 ); + assertEquals(2, new_value); + assertEquals( 2, map.get( "one" ) ); + + new_value = map.adjustOrPutValue( "one", 5, 100 ); + assertEquals(7, new_value); + assertEquals( 7, map.get( "one" ) ); + + new_value = map.adjustOrPutValue( "one", -3, 100 ); + assertEquals(4, new_value); + assertEquals( 4, map.get( "one" ) ); + + new_value = map.adjustOrPutValue( "two", 1, 100 ); + assertEquals(100, new_value); + assertTrue(map.containsKey( "two" )); + assertEquals( 100, map.get( "two" ) ); + + new_value = map.adjustOrPutValue( "two", 1, 100 ); + assertEquals(101, new_value); + assertEquals( 101, map.get( "two" ) ); + } } |
From: Rob E. <ro...@us...> - 2006-12-11 21:03:51
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19914/trove Modified Files: ChangeLog Log Message: Code for feature #1606090 (adjustOrPutValue). Includes unit tests and internal benchmark. Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ChangeLog 11 Dec 2006 19:26:25 -0000 1.43 --- ChangeLog 11 Dec 2006 21:03:48 -0000 1.44 *************** *** 1,2 **** --- 1,8 ---- + v 2.0b1 + + New Features: + [ 1606090 ] adjustOrPutValue + + v 2.0a2 |
From: Rob E. <ro...@us...> - 2006-12-11 19:26:31
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10622/trove Modified Files: ChangeLog Log Message: Version on previous release should have been 2.0a2, not 2.0b1 Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** ChangeLog 5 Dec 2006 20:32:27 -0000 1.42 --- ChangeLog 11 Dec 2006 19:26:25 -0000 1.43 *************** *** 1,3 **** ! v 2.0b1 New Features: --- 1,3 ---- ! v 2.0a2 New Features: |
From: Rob E. <ro...@us...> - 2006-12-07 19:32:34
|
Update of /cvsroot/trove4j/trove_web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7793/trove_web Added Files: news.cache projhtml.cache bench.txt mem.txt Log Message: Add files required by the web site that weren't in CVS. --- NEW FILE: news.cache --- <A HREF="http://sourceforge.net/forum/forum.php?forum_id=213645"><B>trove 0.1.8 released</B></A> <I>ericdf - 2002-09-24 22:25</I><div align="center"> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=213645">[Read More/Comment]</a></div><HR width="100%" size="1" noshade> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=213332"><B>trove 0.1.7 released</B></A> <I>ericdf - 2002-09-23 19:44</I><div align="center"> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=213332">[Read More/Comment]</a></div><HR width="100%" size="1" noshade> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=193947"><B>trove 0.1.6 released</B></A> <I>ericdf - 2002-07-14 20:05</I><div align="center"> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=193947">[Read More/Comment]</a></div><HR width="100%" size="1" noshade> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=170792"><B>trove 0.1.5 released</B></A> <I>ericdf - 2002-04-18 20:39</I><div align="center"> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=170792">[Read More/Comment]</a></div><HR width="100%" size="1" noshade> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=167851"><B>trove 0.1.4 released</B></A> <I>ericdf - 2002-04-08 21:05</I><div align="center"> <A HREF="http://sourceforge.net/forum/forum.php?forum_id=167851">[Read More/Comment]</a></div><HR width="100%" size="1" noshade><div align="center"><a href="http://sourceforge.net/news/?group_id=39235">[News archive]</a></div> --- NEW FILE: projhtml.cache --- <A href="http://sourceforge.net/tracker/?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/taskman16b.png" alt="Tracker" border="0" width="20" height="20"> Tracker</A><P> - <A HREF="http://sourceforge.net/tracker/?atid=424682&group_id=39235&func=browse">Bugs</A> ( <B>6 open / 39 total</B> )<BR>Bug Tracking System<P> - <A HREF="http://sourceforge.net/tracker/?atid=424683&group_id=39235&func=browse">Support Requests</A> ( <B>0 open / 0 total</B> )<BR>Tech Support Tracking System<P> - <A HREF="http://sourceforge.net/tracker/?atid=424684&group_id=39235&func=browse">Patches</A> ( <B>1 open / 2 total</B> )<BR>Patch Tracking System<P> - <A HREF="http://sourceforge.net/tracker/?atid=424685&group_id=39235&func=browse">Feature Requests</A> ( <B>9 open / 19 total</B> )<BR>Feature Request Tracking System <HR SIZE="1" NoShade><A href="http://sourceforge.net/forum/?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/notes16.png" alt="Forums" border="0" width="20" height="20"> Forums</A> ( <B>144</B> messages in <B>3</B> forums ) <HR SIZE="1" NoShade><A href="http://sourceforge.net/docman/?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/docman16b.png" alt="Docs" border="0" width="20" height="20"> Doc Manager</A> <HR SIZE="1" NoShade><A href="http://sourceforge.net/mail/?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/mail16b.png" alt="Mail Lists" border="0" width="20" height="20"> Mailing Lists</A> ( <B>1</B> mailing lists ) <HR SIZE="1" NoShade><A href="http://sourceforge.net/project/screenshots.php?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/notes16.png" alt="Screenshots" border="0" width="20" height="20"> Screenshots</A> <HR SIZE="1" NoShade><A href="http://sourceforge.net/pm/?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/taskman16b.png" alt="Tasks" border="0" width="20" height="20"> Task Manager</A><BR><I>There are no public subprojects available</I> <HR SIZE="1" NoShade><A href="http://sourceforge.net/cvs/?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/cvs16b.png" alt="CVS" border="0" width="20" height="20"> CVS Tree</A> ( <B>757</B> commits, <B>96</B> adds ) <a href="/project/stats/?group_id=39235#stats_notice"><IMG src="http://images.sourceforge.net/images/bug.png" border="0" alt="known bug" width="25" height="25"></a> <HR SIZE="1" NoShade><A href="http://sourceforge.net/project/showfiles.php?group_id=39235"><IMG src="http://images.sourceforge.net/images/ic/ftp16b.png" alt="FTP" border="0" width="20" height="20"> Released Files</A> --- NEW FILE: bench.txt --- -------------------------------- GNU Trove Benchmark suite -------------------------------- java.vm.name=Java HotSpot(TM) Client VM java.runtime.version=1.5.0_06-103 os.name=Mac OS X os.arch=ppc os.version=10.4.8 -------------------------------- compares 100000 Set.contains() operations. 3 are actually present in set Iterations: 25 Their total (msec): 794 Our total (msec): 1552 Their average (msec): 31 Our average (msec): 62 -------------------------------- sums a 100000 element Set of Integer objects. Their approach uses Iterator.hasNext()/next(); ours uses THashSet.forEach(TObjectProcedure) Iterations: 25 Their total (msec): 759 Our total (msec): 120 Their average (msec): 30 Our average (msec): 4 -------------------------------- compares Iterator.hasNext()/ Iterator.next() over 100000 keys Iterations: 25 Their total (msec): 219 Our total (msec): 250 Their average (msec): 8 Our average (msec): 10 -------------------------------- compares Iterator.next() over 100000 map keys Iterations: 25 Their total (msec): 229 Our total (msec): 126 Their average (msec): 9 Our average (msec): 5 -------------------------------- compares 100000 LinkedList.add() operations Iterations: 25 Their total (msec): 1049 Our total (msec): 296 Their average (msec): 41 Our average (msec): 11 -------------------------------- 100000 entry primitive int map.put timing run; no basis for comparison Iterations: 25 Their total (msec): 0 Our total (msec): 310 Their average (msec): 0 Our average (msec): 12 -------------------------------- compares 100000 Map.put() operations Iterations: 25 Their total (msec): 3545 Our total (msec): 823 Their average (msec): 141 Our average (msec): 32 -------------------------------- compares 20000 Set.contains() operations Iterations: 25 Their total (msec): 252 Our total (msec): 69 Their average (msec): 10 Our average (msec): 2 -------------------------------- compares 100000 Set.add() operations Iterations: 25 Their total (msec): 3556 Our total (msec): 530 Their average (msec): 142 Our average (msec): 21 -------------------------------- done --- NEW FILE: mem.txt --- -------------------------- Compare size of Set implementation: 1,000 Integer objects measured in bytes javasoft: 48249 trove: 28864 trove's collection requires 59% of the memory needed by javasoft's collection -------------------------- Compare size of LinkedList implementation: 1,000 TLinkableAdaptor objects measured in bytes javasoft: 40048 trove: 16024 trove's collection requires 40% of the memory needed by javasoft's collection -------------------------- Compare size of int/IntegerArrayList implementation: 1,000 ints measured in bytes javasoft: 20040 trove: 4032 trove's collection requires 20% of the memory needed by javasoft's collection -------------------------- Compare size of Map implementation: 1,000 Integer->Integer mappings measured in bytes javasoft: 48248 trove: 41696 trove's collection requires 86% of the memory needed by javasoft's collection |
From: Rob E. <ro...@us...> - 2006-12-07 19:31:06
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7238/trove Modified Files: build.xml Log Message: Release version 2.0a2 Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** build.xml 16 Nov 2006 17:44:05 -0000 1.37 --- build.xml 7 Dec 2006 19:31:01 -0000 1.38 *************** *** 6,10 **** <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="2.0a1"/> <property name="year" value="2001-2006"/> --- 6,10 ---- <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="2.0a2"/> <property name="year" value="2001-2006"/> |
From: Rob E. <ro...@us...> - 2006-12-07 19:31:04
|
Update of /cvsroot/trove4j/trove_web In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv7238/trove_web Modified Files: index.shtml Log Message: Release version 2.0a2 Index: index.shtml =================================================================== RCS file: /cvsroot/trove4j/trove_web/index.shtml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** index.shtml 17 Nov 2006 19:41:57 -0000 1.8 --- index.shtml 7 Dec 2006 19:31:01 -0000 1.9 *************** *** 11,15 **** <p> ! <big><a href="http://sourceforge.net/project/showfiles.php?group_id=39235">Trove 2.0a1 released: 11/16/2006</a></big> </p> --- 11,15 ---- <p> ! <big><a href="http://sourceforge.net/project/showfiles.php?group_id=39235">Trove 2.0a2 released: 12/07/2006</a></big> </p> |
From: Rob E. <ro...@us...> - 2006-12-05 20:32:33
|
Update of /cvsroot/trove4j/trove/test/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29054/trove/test/gnu/trove Modified Files: O2PHashMapTest.java Log Message: Changes for request #779039 (expose decorator's set/map) Index: O2PHashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/O2PHashMapTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** O2PHashMapTest.java 4 Dec 2006 19:23:56 -0000 1.2 --- O2PHashMapTest.java 5 Dec 2006 20:32:27 -0000 1.3 *************** *** 79,82 **** --- 79,84 ---- } assertEquals( 2, count ); + + assertSame(map, ( ( TObjectIntHashMapDecorator ) decorator ).getMap() ); } |
From: Rob E. <ro...@us...> - 2006-12-05 20:32:33
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29054/trove Modified Files: ChangeLog Log Message: Changes for request #779039 (expose decorator's set/map) Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ChangeLog 30 Nov 2006 22:06:22 -0000 1.41 --- ChangeLog 5 Dec 2006 20:32:27 -0000 1.42 *************** *** 1,4 **** --- 1,7 ---- v 2.0b1 + New Features: + [ 779039 ] expose decorator's set/map + Bugs Fixed: [ 1428614 ] THashMap.values().remove() can remove multiple mappings |
From: Rob E. <ro...@us...> - 2006-12-05 20:32:33
|
Update of /cvsroot/trove4j/trove/src/gnu/trove/generate In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29054/trove/src/gnu/trove/generate Modified Files: P2PMapDecorator.template O2PMapDecorator.template P2OMapDecorator.template PHashSetDecorator.template Log Message: Changes for request #779039 (expose decorator's set/map) Index: P2PMapDecorator.template =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/P2PMapDecorator.template,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** P2PMapDecorator.template 10 Nov 2006 23:28:00 -0000 1.1 --- P2PMapDecorator.template 5 Dec 2006 20:32:27 -0000 1.2 *************** *** 66,69 **** --- 66,78 ---- } + + /** + * Returns a reference to the map wrapped by this decorator. + */ + public T#K##V#HashMap getMap() { + return _map; + } + + /** * Clones the underlying trove collection and returns the clone wrapped in a new Index: O2PMapDecorator.template =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/O2PMapDecorator.template,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** O2PMapDecorator.template 10 Nov 2006 23:28:00 -0000 1.1 --- O2PMapDecorator.template 5 Dec 2006 20:32:27 -0000 1.2 *************** *** 65,68 **** --- 65,77 ---- } + + /** + * Returns a reference to the map wrapped by this decorator. + */ + public TObject#E#HashMap<V> getMap() { + return _map; + } + + /** * Clones the underlying trove collection and returns the clone wrapped in a new Index: P2OMapDecorator.template =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/P2OMapDecorator.template,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** P2OMapDecorator.template 10 Nov 2006 23:28:00 -0000 1.1 --- P2OMapDecorator.template 5 Dec 2006 20:32:27 -0000 1.2 *************** *** 51,55 **** * @author Eric D. Friedman */ ! public class T#E#ObjectHashMapDecorator <V> extends AbstractMap<#ET#, V> implements Map<#ET#, V>, Cloneable { --- 51,55 ---- * @author Eric D. Friedman */ ! public class T#E#ObjectHashMapDecorator<V> extends AbstractMap<#ET#, V> implements Map<#ET#, V>, Cloneable { *************** *** 67,70 **** --- 67,78 ---- } + + /** + * Returns a reference to the map wrapped by this decorator. + */ + public T#E#ObjectHashMap<V> getMap() { + return _map; + } + /** * Clones the underlying trove collection and returns the clone wrapped in a new Index: PHashSetDecorator.template =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/PHashSetDecorator.template,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PHashSetDecorator.template 10 Nov 2006 23:28:00 -0000 1.1 --- PHashSetDecorator.template 5 Dec 2006 20:32:27 -0000 1.2 *************** *** 59,62 **** --- 59,70 ---- } + + /** + * Returns a reference to the set wrapped by this decorator. + */ + public T#E#HashSet getSet() { + return _set; + } + /** * Clones the underlying trove collection and returns the clone wrapped in a new |
From: Rob E. <ro...@us...> - 2006-12-04 19:23:58
|
Update of /cvsroot/trove4j/trove/test/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17006/trove/test/gnu/trove Modified Files: O2PHashMapTest.java THashMapTest.java Log Message: Additional iterator tests Index: O2PHashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/O2PHashMapTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** O2PHashMapTest.java 30 Nov 2006 22:06:22 -0000 1.1 --- O2PHashMapTest.java 4 Dec 2006 19:23:56 -0000 1.2 *************** *** 18,25 **** package gnu.trove; import junit.framework.TestCase; ! import java.util.Arrays; ! import java.util.List; --- 18,25 ---- package gnu.trove; + import gnu.trove.decorator.TObjectIntHashMapDecorator; import junit.framework.TestCase; ! import java.util.*; *************** *** 58,61 **** --- 58,85 ---- + public void testDecorator() { + TObjectIntHashMap<String> map = new TObjectIntHashMap<String>(); + + map.put( "one", 1 ); + map.put( "two", 2 ); + + Map<String,Integer> decorator = new TObjectIntHashMapDecorator<String>( map ); + + assertEquals( 2, decorator.size() ); + assertEquals( Integer.valueOf( 1 ), decorator.get( "one" ) ); + assertEquals( Integer.valueOf( 2 ), decorator.get( "two" ) ); + + Set<String> decorator_keys = decorator.keySet(); + assertEquals( 2, decorator_keys.size() ); + Iterator<String> it = decorator_keys.iterator(); + int count = 0; + while( it.hasNext() ) { + count++; + System.out.println(it.next()); + } + assertEquals( 2, count ); + } + + public void testIterator() { TObjectIntHashMap<String> map = new TObjectIntHashMap<String>(); Index: THashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/THashMapTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** THashMapTest.java 21 Nov 2006 18:19:35 -0000 1.6 --- THashMapTest.java 4 Dec 2006 19:23:56 -0000 1.7 *************** *** 119,122 **** --- 119,131 ---- assertTrue("keyset did not match expected set", keys.containsAll(Arrays.asList(new Object[] { key1, key2, key3 }))); + assertEquals(3, map.size()); + + int count = 0; + Iterator it = keys.iterator(); + while( it.hasNext() ) { + count++; + it.next(); + } + assertEquals(map.size(),count); for (Iterator i = keys.iterator(); i.hasNext();) { |
From: Rob E. <ro...@us...> - 2006-11-30 22:06:25
|
Update of /cvsroot/trove4j/trove/src/gnu/trove/generate In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27703/trove/src/gnu/trove/generate Modified Files: O2PIterator.template Log Message: Fix for bug #1606095 (Critical Iterator Error). Additional test case checked in to test this and keys() behavior on TObjectIntHashMaps. Index: O2PIterator.template =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/generate/O2PIterator.template,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** O2PIterator.template 10 Nov 2006 23:28:00 -0000 1.1 --- O2PIterator.template 30 Nov 2006 22:06:22 -0000 1.2 *************** *** 115,119 **** Object[] set = _map._set; int i = _index; ! while (i-- > 0 && (set[i] == null || set[i] == TObjectHash.REMOVED)) ; return i; } --- 115,120 ---- Object[] set = _map._set; int i = _index; ! while (i-- > 0 && (set[i] == null || set[i] == TObjectHash.REMOVED || ! set[i] == TObjectHash.FREE)) ; return i; } |
From: Rob E. <ro...@us...> - 2006-11-30 22:06:25
|
Update of /cvsroot/trove4j/trove/test/gnu/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27703/trove/test/gnu/trove Added Files: O2PHashMapTest.java Log Message: Fix for bug #1606095 (Critical Iterator Error). Additional test case checked in to test this and keys() behavior on TObjectIntHashMaps. --- NEW FILE: O2PHashMapTest.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2001-2006, 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; import junit.framework.TestCase; import java.util.Arrays; import java.util.List; /** * */ public class O2PHashMapTest extends TestCase { public O2PHashMapTest( String name ) { super( name ); } public void testKeys() { TObjectIntHashMap<String> map = new TObjectIntHashMap<String>(); map.put( "one", 1 ); map.put( "two", 2 ); assertEquals( 2, map.size() ); String[] keys = map.keys( new String[ map.size() ] ); assertEquals( 2, keys.length ); List<String> keys_list = Arrays.asList( keys ); assertTrue( keys_list.contains( "one" ) ); assertTrue( keys_list.contains( "two" ) ); Object[] keys2 = map.keys(); assertEquals( 2, keys2.length ); List keys_list2 = Arrays.asList( keys2 ); assertTrue( keys_list2.contains( "one" ) ); assertTrue( keys_list2.contains( "two" ) ); } public void testIterator() { TObjectIntHashMap<String> map = new TObjectIntHashMap<String>(); TObjectIntIterator<String> iterator = map.iterator(); assertFalse( iterator.hasNext() ); map.put( "one", 1 ); map.put( "two", 2 ); iterator = map.iterator(); assertTrue( iterator.hasNext() ); iterator.advance(); assertTrue( iterator.hasNext() ); iterator.advance(); assertFalse( iterator.hasNext() ); } } |
From: Rob E. <ro...@us...> - 2006-11-30 22:06:24
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27703/trove Modified Files: ChangeLog Log Message: Fix for bug #1606095 (Critical Iterator Error). Additional test case checked in to test this and keys() behavior on TObjectIntHashMaps. Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ChangeLog 21 Nov 2006 22:50:39 -0000 1.40 --- ChangeLog 30 Nov 2006 22:06:22 -0000 1.41 *************** *** 4,7 **** --- 4,8 ---- [ 1428614 ] THashMap.values().remove() can remove multiple mappings [ 1506751 ] TxxxArrayList.toNativeArray(offset, len) is broken + [ 1606095 ] Critical Iterator Error |