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...> - 2009-10-12 03:56:11
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/benchmark In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27273/trove/test/gnu/trove/benchmark Modified Files: Tag: TROVE_3_WORKING JavaHashMapIteration.java TroveHashMapPut.java JavaHashMapPut.java TroveHashMapGet.java TroveHashMapIteration.java TroveHashMapForEach.java BenchmarkRunner.java JavaHashMapGet.java Log Message: Add Trove2 benchmarks. More method cleanup. Index: JavaHashMapIteration.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/JavaHashMapIteration.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** JavaHashMapIteration.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- JavaHashMapIteration.java 12 Oct 2009 03:56:01 -0000 1.1.2.3 *************** *** 27,34 **** class JavaHashMapIteration implements Benchmark { private Map<Integer,Integer> map = new HashMap<Integer,Integer>(); - - public boolean isAvailable() { - return true; - } public void setUp() { --- 27,30 ---- Index: TroveHashMapPut.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/TroveHashMapPut.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TroveHashMapPut.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- TroveHashMapPut.java 12 Oct 2009 03:56:01 -0000 1.1.2.3 *************** *** 27,34 **** class TroveHashMapPut implements Benchmark { private TIntObjectMap<Integer> map; - - public boolean isAvailable() { - return true; - } public void setUp() { --- 27,30 ---- Index: JavaHashMapPut.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/JavaHashMapPut.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** JavaHashMapPut.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- JavaHashMapPut.java 12 Oct 2009 03:56:01 -0000 1.1.2.3 *************** *** 27,34 **** class JavaHashMapPut implements Benchmark { private Map<Integer,Integer> map = new HashMap<Integer,Integer>(); - - public boolean isAvailable() { - return true; - } public void setUp() {} --- 27,30 ---- Index: TroveHashMapGet.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/TroveHashMapGet.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TroveHashMapGet.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- TroveHashMapGet.java 12 Oct 2009 03:56:01 -0000 1.1.2.3 *************** *** 28,35 **** private TIntObjectMap<Integer> map = new TIntObjectHashMap<Integer>(); - public boolean isAvailable() { - return true; - } - public void setUp() { if ( !map.isEmpty() ) return; --- 28,31 ---- Index: TroveHashMapIteration.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/TroveHashMapIteration.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TroveHashMapIteration.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- TroveHashMapIteration.java 12 Oct 2009 03:56:01 -0000 1.1.2.3 *************** *** 30,37 **** private TIntObjectMap<Integer> map = new TIntObjectHashMap<Integer>(); - public boolean isAvailable() { - return true; - } - public void setUp() { if ( !map.isEmpty() ) return; --- 30,33 ---- Index: TroveHashMapForEach.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/TroveHashMapForEach.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TroveHashMapForEach.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- TroveHashMapForEach.java 12 Oct 2009 03:56:01 -0000 1.1.2.3 *************** *** 31,38 **** private Totaler totaler = new Totaler(); - public boolean isAvailable() { - return true; - } - public void setUp() { if ( !map.isEmpty() ) return; --- 31,34 ---- Index: BenchmarkRunner.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/BenchmarkRunner.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** BenchmarkRunner.java 12 Oct 2009 03:40:12 -0000 1.1.2.7 --- BenchmarkRunner.java 12 Oct 2009 03:56:01 -0000 1.1.2.8 *************** *** 32,40 **** private static final BenchmarkSet MAP_GET_SET = new BenchmarkSet( "Map Gets", new JavaHashMapGet(), new TroveHashMapGet() ); ! private static final Benchmark[] CASES = { MAP_PUT_SET, MAP_GET_SET, ! // new ColtHashMapGet() ), new BenchmarkSet( "Map Iteration", new JavaHashMapIteration(), ! new TroveHashMapIteration(), new TroveHashMapForEach() ) ! }; private static final Runtime RUNTIME = Runtime.getRuntime(); --- 32,40 ---- private static final BenchmarkSet MAP_GET_SET = new BenchmarkSet( "Map Gets", new JavaHashMapGet(), new TroveHashMapGet() ); ! private static final BenchmarkSet MAP_ITERATION = new BenchmarkSet( "Map Iteration", new JavaHashMapIteration(), ! new TroveHashMapIteration(), new TroveHashMapForEach() ); ! ! private static final Benchmark[] CASES = { MAP_PUT_SET, MAP_GET_SET, MAP_ITERATION }; private static final Runtime RUNTIME = Runtime.getRuntime(); *************** *** 65,70 **** // Setup if ( classIsAvailable( "cern.colt.map.OpenIntObjectHashMap" ) ) { ! System.out.println( "Colt IS available for testing" ); MAP_PUT_SET.addDynamic( createBenchmark( "gnu.trove.benchmark.colt.ColtHashMapPut" ) ); --- 65,73 ---- // Setup + System.out.println( "Checking for external libraries..." ); + + System.out.print( " Colt: " ); if ( classIsAvailable( "cern.colt.map.OpenIntObjectHashMap" ) ) { ! System.out.println( " found" ); MAP_PUT_SET.addDynamic( createBenchmark( "gnu.trove.benchmark.colt.ColtHashMapPut" ) ); *************** *** 72,78 **** createBenchmark( "gnu.trove.benchmark.colt.ColtHashMapGet" ) ); } ! else System.out.println( "Colt IS NOT available for testing" ); for( Benchmark benchmark : CASES ) { --- 75,99 ---- createBenchmark( "gnu.trove.benchmark.colt.ColtHashMapGet" ) ); } ! else System.out.println( " not found" ); ! ! System.out.print( " Trove 2: " ); ! if ( classIsAvailable( "gnu.trove.TIntObjectHashMap" ) ) { ! System.out.println( "found" ); ! MAP_PUT_SET.addDynamic( ! createBenchmark( "gnu.trove.benchmark.trove2.Trove2HashMapPut" ) ); ! MAP_GET_SET.addDynamic( ! createBenchmark( "gnu.trove.benchmark.trove2.Trove2HashMapGet" ) ); ! MAP_ITERATION.addDynamic( ! createBenchmark( "gnu.trove.benchmark.trove2.Trove2HashMapIteration" ) ); ! MAP_ITERATION.addDynamic( ! createBenchmark( "gnu.trove.benchmark.trove2.Trove2HashMapForEach" ) ); ! } ! else System.out.println( "not found" ); + // Run + System.out.println(); + System.out.println( "Running tests..." ); + System.out.println(); for( Benchmark benchmark : CASES ) { Index: JavaHashMapGet.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/JavaHashMapGet.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** JavaHashMapGet.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- JavaHashMapGet.java 12 Oct 2009 03:56:01 -0000 1.1.2.3 *************** *** 29,36 **** private Map<Integer,Integer> map = new HashMap<Integer,Integer>(); - public boolean isAvailable() { - return true; - } - public void setUp() { if ( !map.isEmpty() ) return; --- 29,32 ---- |
From: Rob E. <ro...@us...> - 2009-10-12 03:44:00
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/benchmark/trove2 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26188/trove/test/gnu/trove/benchmark/trove2 Log Message: Directory /cvsroot/trove4j/trove/test/gnu/trove/benchmark/trove2 added to the repository |
From: Rob E. <ro...@us...> - 2009-10-12 03:40:21
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/benchmark In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25887/trove/test/gnu/trove/benchmark Modified Files: Tag: TROVE_3_WORKING BenchmarkSet.java Benchmark.java BenchmarkRunner.java Log Message: Remove unused method. Index: BenchmarkSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/BenchmarkSet.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** BenchmarkSet.java 12 Oct 2009 03:35:21 -0000 1.1.2.5 --- BenchmarkSet.java 12 Oct 2009 03:40:12 -0000 1.1.2.6 *************** *** 36,50 **** } - public boolean isAvailable() { - // Available if any test is available - for( Benchmark mark : cases ) { - if ( mark.isAvailable() ) return true; - } - return false; - } - public void setUp() { for ( Benchmark benchmark : cases ) { ! if ( benchmark.isAvailable() ) benchmark.setUp(); } } --- 36,42 ---- } public void setUp() { for ( Benchmark benchmark : cases ) { ! benchmark.setUp(); } } *************** *** 52,56 **** public void tearDown() { for ( Benchmark benchmark : cases ) { ! if ( benchmark.isAvailable() ) benchmark.tearDown(); } } --- 44,48 ---- public void tearDown() { for ( Benchmark benchmark : cases ) { ! benchmark.tearDown(); } } Index: Benchmark.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/Benchmark.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** Benchmark.java 27 Sep 2009 22:07:16 -0000 1.1.2.2 --- Benchmark.java 12 Oct 2009 03:40:12 -0000 1.1.2.3 *************** *** 22,27 **** */ public interface Benchmark extends Runnable { - public boolean isAvailable(); - public void setUp(); public void tearDown(); --- 22,25 ---- Index: BenchmarkRunner.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/BenchmarkRunner.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** BenchmarkRunner.java 12 Oct 2009 03:35:21 -0000 1.1.2.6 --- BenchmarkRunner.java 12 Oct 2009 03:40:12 -0000 1.1.2.7 *************** *** 77,82 **** for( Benchmark benchmark : CASES ) { - if ( !benchmark.isAvailable() ) continue; - String indent_level = ""; --- 77,80 ---- *************** *** 114,119 **** for( int i = 0; i < child_cases.size(); i++ ) { Benchmark child = child_cases.get( i ); - if ( !child.isAvailable() ) continue; - runBenchmark( child, child_indent, collectors ); } --- 112,115 ---- |
From: Rob E. <ro...@us...> - 2009-10-12 03:40:21
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/benchmark/colt In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25887/trove/test/gnu/trove/benchmark/colt Modified Files: Tag: TROVE_3_WORKING ColtHashMapGet.java ColtHashMapPut.java Removed Files: Tag: TROVE_3_WORKING ColtBenchmark.java Log Message: Remove unused method. Index: ColtHashMapGet.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/colt/Attic/ColtHashMapGet.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** ColtHashMapGet.java 12 Oct 2009 03:35:21 -0000 1.1.2.1 --- ColtHashMapGet.java 12 Oct 2009 03:40:12 -0000 1.1.2.2 *************** *** 21,24 **** --- 21,25 ---- import cern.colt.map.OpenIntObjectHashMap; import gnu.trove.benchmark.BenchmarkRunner; + import gnu.trove.benchmark.Benchmark; *************** *** 26,30 **** * */ ! public class ColtHashMapGet extends ColtBenchmark { private OpenIntObjectHashMap map = new OpenIntObjectHashMap(); --- 27,31 ---- * */ ! public class ColtHashMapGet implements Benchmark { private OpenIntObjectHashMap map = new OpenIntObjectHashMap(); Index: ColtHashMapPut.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/colt/Attic/ColtHashMapPut.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** ColtHashMapPut.java 12 Oct 2009 03:35:21 -0000 1.1.2.1 --- ColtHashMapPut.java 12 Oct 2009 03:40:12 -0000 1.1.2.2 *************** *** 21,24 **** --- 21,25 ---- import cern.colt.map.OpenIntObjectHashMap; import gnu.trove.benchmark.BenchmarkRunner; + import gnu.trove.benchmark.Benchmark; *************** *** 26,30 **** * */ ! public class ColtHashMapPut extends ColtBenchmark { private OpenIntObjectHashMap map; --- 27,31 ---- * */ ! public class ColtHashMapPut implements Benchmark { private OpenIntObjectHashMap map; --- ColtBenchmark.java DELETED --- |
From: Rob E. <ro...@us...> - 2009-10-12 03:35:34
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/benchmark In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25314/trove/test/gnu/trove/benchmark Modified Files: Tag: TROVE_3_WORKING BenchmarkSet.java BenchmarkRunner.java Log Message: Support for third-party benchmarks. Include tests for Colt map put/get. Index: BenchmarkSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/BenchmarkSet.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** BenchmarkSet.java 27 Sep 2009 22:07:16 -0000 1.1.2.4 --- BenchmarkSet.java 12 Oct 2009 03:35:21 -0000 1.1.2.5 *************** *** 18,21 **** --- 18,26 ---- package gnu.trove.benchmark; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.List; + + /** * *************** *** 24,32 **** private final String name; ! private final Benchmark[] cases; BenchmarkSet( String name, Benchmark... cases ) { this.name = name; ! this.cases = cases; } --- 29,37 ---- private final String name; ! private final List<Benchmark> cases; BenchmarkSet( String name, Benchmark... cases ) { this.name = name; ! this.cases = new ArrayList<Benchmark>( Arrays.asList( cases ) ); } *************** *** 61,66 **** ! public Benchmark[] getCases() { return cases; } } --- 66,76 ---- ! public List<Benchmark> getCases() { return cases; } + + + void addDynamic( Benchmark benchmark ) { + cases.add( benchmark ); + } } Index: BenchmarkRunner.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/benchmark/Attic/BenchmarkRunner.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** BenchmarkRunner.java 27 Sep 2009 22:10:35 -0000 1.1.2.5 --- BenchmarkRunner.java 12 Oct 2009 03:35:21 -0000 1.1.2.6 *************** *** 28,35 **** */ public class BenchmarkRunner { ! private static final Benchmark[] CASES = { ! new BenchmarkSet( "Map Puts", new JavaHashMapPut(), new TroveHashMapPut() ), ! // new ColtHashMapPut() ), ! new BenchmarkSet( "Map Gets", new JavaHashMapGet(), new TroveHashMapGet() ), // new ColtHashMapGet() ), new BenchmarkSet( "Map Iteration", new JavaHashMapIteration(), --- 28,36 ---- */ public class BenchmarkRunner { ! private static final BenchmarkSet MAP_PUT_SET = ! new BenchmarkSet( "Map Puts", new JavaHashMapPut(), new TroveHashMapPut() ); ! private static final BenchmarkSet MAP_GET_SET = ! new BenchmarkSet( "Map Gets", new JavaHashMapGet(), new TroveHashMapGet() ); ! private static final Benchmark[] CASES = { MAP_PUT_SET, MAP_GET_SET, // new ColtHashMapGet() ), new BenchmarkSet( "Map Iteration", new JavaHashMapIteration(), *************** *** 46,50 **** private static long case_settle_time = 20; ! public static void main( String[] args ) { List<GarbageCollectorMXBean> collectors = ManagementFactory.getGarbageCollectorMXBeans(); --- 47,51 ---- private static long case_settle_time = 20; ! public static void main( String[] args ) throws Exception { List<GarbageCollectorMXBean> collectors = ManagementFactory.getGarbageCollectorMXBeans(); *************** *** 62,65 **** --- 63,79 ---- } + + // Setup + if ( classIsAvailable( "cern.colt.map.OpenIntObjectHashMap" ) ) { + System.out.println( "Colt IS available for testing" ); + MAP_PUT_SET.addDynamic( + createBenchmark( "gnu.trove.benchmark.colt.ColtHashMapPut" ) ); + MAP_GET_SET.addDynamic( + createBenchmark( "gnu.trove.benchmark.colt.ColtHashMapGet" ) ); + } + else System.out.println( "Colt IS NOT available for testing" ); + + + for( Benchmark benchmark : CASES ) { if ( !benchmark.isAvailable() ) continue; *************** *** 97,102 **** String child_indent = indent_level + " "; ! Benchmark[] child_cases = ( ( BenchmarkSet ) mark ).getCases(); ! for( Benchmark child : child_cases ) { if ( !child.isAvailable() ) continue; --- 111,117 ---- String child_indent = indent_level + " "; ! List<Benchmark> child_cases = ( ( BenchmarkSet ) mark ).getCases(); ! for( int i = 0; i < child_cases.size(); i++ ) { ! Benchmark child = child_cases.get( i ); if ( !child.isAvailable() ) continue; *************** *** 150,153 **** --- 165,186 ---- } } + + + private static boolean classIsAvailable( String class_name ) { + try { + Class.forName( "cern.colt.map.OpenIntObjectHashMap" ); + return true; + } + catch( Throwable t ) { + return false; + } + } + + + private static Benchmark createBenchmark( String class_name ) + throws Exception { + + return ( Benchmark ) Class.forName( class_name ).newInstance(); + } |
From: Rob E. <ro...@us...> - 2009-10-12 03:35:34
|
Update of /cvsroot/trove4j/trove In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25314/trove Modified Files: Tag: TROVE_3_WORKING build.xml Log Message: Support for third-party benchmarks. Include tests for Colt map put/get. Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.61.2.6 retrieving revision 1.61.2.7 diff -C2 -d -r1.61.2.6 -r1.61.2.7 *** build.xml 9 Oct 2009 04:09:00 -0000 1.61.2.6 --- build.xml 12 Oct 2009 03:35:21 -0000 1.61.2.7 *************** *** 209,224 **** <!-- Compile and run the unit tests. --> <!-- =============================================================== --> ! <target name="test" depends="compile" description="Compile unit tests and run them using JUnit."> - - <echo message="output.dest = ${output.dest}"/> - - <javac destdir="${output.tests}" debug="${debug}" target="1.5"> - <src path="${test_src}"/> - <classpath> - <pathelement location="${lib}/junit.jar"/> - <pathelement location="${output.dest}"/> - </classpath> - </javac> <copy todir="${output.tests}"> --- 209,214 ---- <!-- Compile and run the unit tests. --> <!-- =============================================================== --> ! <target name="test" depends="compile,-build_tests" description="Compile unit tests and run them using JUnit."> <copy todir="${output.tests}"> *************** *** 245,250 **** <fail message="Tests failed. Check test output." if="test.failed"/> </target> ! ! <!-- =============================================================== --> <!-- Build generator classes. --> --- 235,260 ---- <fail message="Tests failed. Check test output." if="test.failed"/> </target> ! ! ! <!-- =============================================================== --> ! <!-- Run benchmarks. --> ! <!-- =============================================================== --> ! <target name="benchmark" depends="compile,-build_tests" ! description="Run benchmark suite."> ! ! <java classname="gnu.trove.benchmark.BenchmarkRunner" fork="true"> ! <classpath> ! <fileset dir="${lib}"> ! <include name="*.jar"/> ! </fileset> ! ! <pathelement path="${output.dest}"/> ! <pathelement path="${output.generator_classes}"/> ! <pathelement path="${output.tests}"/> ! </classpath> ! </java> ! </target> ! ! <!-- =============================================================== --> <!-- Build generator classes. --> *************** *** 257,261 **** source="1.5" target="1.5"/> </target> ! <!-- =================================================================== --> <!-- Initialization target --> --- 267,272 ---- source="1.5" target="1.5"/> </target> ! ! <!-- =================================================================== --> <!-- Initialization target --> *************** *** 276,278 **** --- 287,336 ---- <echo message="----------- ${Name} ${version} [${year}] ------------"/> </target> + + + <!-- =================================================================== --> + <!-- Targets related to benchmarks. --> + <!-- =================================================================== --> + + <target name="-build_tests" depends="-init"> + <javac destdir="${output.tests}" debug="${debug}" target="1.5"> + <src path="${test_src}"/> + <exclude name="gnu/trove/benchmark/colt/**"/> + + <classpath> + <pathelement location="${lib}/junit.jar"/> + <pathelement location="${output.dest}"/> + </classpath> + </javac> + + <!-- See if third party libraries are available --> + <available classname="cern.colt.map.OpenIntObjectHashMap" + property="colt.available"> + + <classpath> + <fileset dir="${lib}"> + <include name="*.jar"/> + </fileset> + </classpath> + </available> + <antcall target="-build_colt_benchmarks"/> + + </target> + + + <target name="-build_colt_benchmarks" depends="-init" if="colt.available"> + <javac destdir="${output.tests}" debug="${debug}" target="1.5"> + <src path="${test_src}"/> + + <include name="gnu/trove/benchmark/colt/**"/> + + <classpath> + <fileset dir="${lib}"> + <include name="*.jar"/> + </fileset> + <pathelement location="${output.dest}"/> + <pathelement location="${output.tests}"/> + </classpath> + </javac> + </target> </project> \ No newline at end of file |
From: Rob E. <ro...@us...> - 2009-10-12 03:35:31
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/benchmark/colt In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25314/trove/test/gnu/trove/benchmark/colt Added Files: Tag: TROVE_3_WORKING ColtHashMapPut.java ColtBenchmark.java ColtHashMapGet.java Log Message: Support for third-party benchmarks. Include tests for Colt map put/get. --- NEW FILE: ColtHashMapPut.java --- // //////////////////////////////////////////////////////////////////////////// // 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.benchmark.colt; import cern.colt.map.OpenIntObjectHashMap; import gnu.trove.benchmark.BenchmarkRunner; /** * */ public class ColtHashMapPut extends ColtBenchmark { private OpenIntObjectHashMap map; public void setUp() { if ( map != null ) return; map = new OpenIntObjectHashMap(); map.ensureCapacity( BenchmarkRunner.INTEGERS.length ); } public void tearDown() { map.clear(); } public String getName() { return "Colt HashMap Put"; } public void run() { for( Integer i : BenchmarkRunner.INTEGERS ) { map.put( i.intValue(), i ); } } } --- NEW FILE: ColtBenchmark.java --- // //////////////////////////////////////////////////////////////////////////// // 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.benchmark.colt; import gnu.trove.benchmark.Benchmark; /** * */ abstract class ColtBenchmark implements Benchmark { public final boolean isAvailable() { try { Class.forName( "cern.colt.map.OpenIntObjectHashMap" ); return true; } catch( Throwable t ) { return false; } } } --- NEW FILE: ColtHashMapGet.java --- // //////////////////////////////////////////////////////////////////////////// // 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.benchmark.colt; import cern.colt.map.OpenIntObjectHashMap; import gnu.trove.benchmark.BenchmarkRunner; /** * */ public class ColtHashMapGet extends ColtBenchmark { private OpenIntObjectHashMap map = new OpenIntObjectHashMap(); public void setUp() { if ( !map.isEmpty() ) return; for( Integer i : BenchmarkRunner.INTEGERS ) { map.put( i.intValue(), i ); } } public void tearDown() {} public String getName() { return "Colt HashMap Get"; } public void run() { for( int j = 0; j < 50; j++ ) { for( Integer i : BenchmarkRunner.INTEGERS ) { map.get( i.intValue() ); } } } } |
From: Rob E. <ro...@us...> - 2009-10-09 04:09:09
|
Update of /cvsroot/trove4j/trove In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15515/trove Modified Files: Tag: TROVE_3_WORKING build.xml Log Message: Correct (again, really this time) package exclusion. Clean up titles. Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.61.2.5 retrieving revision 1.61.2.6 diff -C2 -d -r1.61.2.5 -r1.61.2.6 *** build.xml 9 Oct 2009 03:53:12 -0000 1.61.2.5 --- build.xml 9 Oct 2009 04:09:00 -0000 1.61.2.6 *************** *** 22,26 **** <description>Builds the Trove4j library</description> ! <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> <property name="version" value="3.0.0a1"/> --- 22,26 ---- <description>Builds the Trove4j library</description> ! <property name="Name" value="Trove"/> <property name="name" value="trove"/> <property name="version" value="3.0.0a1"/> *************** *** 195,212 **** author="false" version="false" ! windowtitle="${Name} API v${version}" ! doctitle="${Name} API v${version}" header="<a href="http://trove4j.sourceforge.net/">GNU Trove</a>"> ! <fileset dir="${src}"> ! <exclude name="**/*.html"/> ! <exclude name="gnu/trove/benchmark/**"/> ! <exclude name="gnu/trove/generate/**"/> ! <exclude name="gnu/trove/test/**"/> ! </fileset> ! <fileset dir="${output.generated}"> ! <exclude name="**/*.html"/> ! <exclude name="gnu/trove/benchmark/**"/> ! <exclude name="gnu/trove/test/**"/> ! </fileset> </javadoc> </target> --- 195,205 ---- author="false" version="false" ! windowtitle="${Name} ${version}" ! doctitle="${Name} ${version}" header="<a href="http://trove4j.sourceforge.net/">GNU Trove</a>"> ! <sourcepath> ! <path location="src"/> ! <path location="${output.generated}"/> ! </sourcepath> </javadoc> </target> |
From: Rob E. <ro...@us...> - 2009-10-09 03:53:35
|
Update of /cvsroot/trove4j/trove/templates/gnu/trove/list/array In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13935/trove/templates/gnu/trove/list/array Modified Files: Tag: TROVE_3_WORKING _E_ArrayList.template Log Message: Fix Javadoc warnings. Increase the memory available to javadoc (was taking a realy long time due to memory thrashing). Index: _E_ArrayList.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/list/array/Attic/_E_ArrayList.template,v retrieving revision 1.1.2.18 retrieving revision 1.1.2.19 diff -C2 -d -r1.1.2.18 -r1.1.2.19 *** _E_ArrayList.template 9 Oct 2009 02:46:07 -0000 1.1.2.18 --- _E_ArrayList.template 9 Oct 2009 03:53:11 -0000 1.1.2.19 *************** *** 127,131 **** // sizing ! /** {@inheritDoc} */ public void ensureCapacity( int capacity ) { if ( capacity > _data.length ) { --- 127,135 ---- // sizing ! /** ! * Grow the internal array as needed to accommodate the specified number of elements. ! * The size of the array bytes on each resize unless capacity requires more than twice ! * the current capacity. ! */ public void ensureCapacity( int capacity ) { if ( capacity > _data.length ) { *************** *** 150,154 **** ! /** {@inheritDoc} */ public void trimToSize() { if ( _data.length > size() ) { --- 154,160 ---- ! /** ! * Sheds any excess capacity above and beyond the current size of the list. ! */ public void trimToSize() { if ( _data.length > size() ) { *************** *** 230,234 **** ! /** {@inheritDoc} */ public #e# getQuick( int offset ) { return _data[ offset ]; --- 236,242 ---- ! /** ! * Returns the value at the specified offset without doing any bounds checking. ! */ public #e# getQuick( int offset ) { return _data[ offset ]; *************** *** 271,275 **** ! /** {@inheritDoc} */ public void setQuick( int offset, #e# val ) { _data[ offset ] = val; --- 279,285 ---- ! /** ! * Sets the value at the specified offset without doing any bounds checking. ! */ public void setQuick( int offset, #e# val ) { _data[ offset ] = val; *************** *** 283,287 **** ! /** {@inheritDoc} */ public void clear( int capacity ) { _data = new #e#[ capacity ]; --- 293,300 ---- ! /** ! * Flushes the internal state of the list, setting the capacity of the empty list to ! * <tt>capacity</tt>. ! */ public void clear( int capacity ) { _data = new #e#[ capacity ]; *************** *** 290,294 **** ! /** {@inheritDoc} */ public void reset() { _pos = 0; --- 303,311 ---- ! /** ! * Sets the size of the list to 0, but does not change its capacity. This method can ! * be used as an alternative to the {@link #clear()} method if you want to recycle a ! * list without allocating new backing arrays. ! */ public void reset() { _pos = 0; *************** *** 297,301 **** ! /** {@inheritDoc} */ public void resetQuick() { _pos = 0; --- 314,325 ---- ! /** ! * Sets the size of the list to 0, but does not change its capacity. This method can ! * be used as an alternative to the {@link #clear()} method if you want to recycle a ! * list without allocating new backing arrays. This method differs from ! * {@link #reset()} in that it does not clear the old values in the backing array. ! * Thus, it is possible for getQuick to return stale data if this method is used and ! * the caller is careless about bounds checking. ! */ public void resetQuick() { _pos = 0; |
From: Rob E. <ro...@us...> - 2009-10-09 03:53:22
|
Update of /cvsroot/trove4j/trove In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13935/trove Modified Files: Tag: TROVE_3_WORKING build.xml Log Message: Fix Javadoc warnings. Increase the memory available to javadoc (was taking a realy long time due to memory thrashing). Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.61.2.4 retrieving revision 1.61.2.5 diff -C2 -d -r1.61.2.4 -r1.61.2.5 *** build.xml 9 Oct 2009 03:14:08 -0000 1.61.2.4 --- build.xml 9 Oct 2009 03:53:12 -0000 1.61.2.5 *************** *** 190,200 **** <javadoc destdir="${output.javadocs}" packagenames="gnu.trove.*" excludepackagenames="gnu.trove.impl.*" ! author="true" ! version="true" ! use="true" ! splitindex="true" ! noindex="false" windowtitle="${Name} API v${version}" doctitle="${Name} API v${version}" --- 190,198 ---- <javadoc destdir="${output.javadocs}" + maxmemory="256m" packagenames="gnu.trove.*" excludepackagenames="gnu.trove.impl.*" ! author="false" ! version="false" windowtitle="${Name} API v${version}" doctitle="${Name} API v${version}" |
From: Rob E. <ro...@us...> - 2009-10-09 03:53:22
|
Update of /cvsroot/trove4j/trove/templates/gnu/trove/map In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13935/trove/templates/gnu/trove/map Modified Files: Tag: TROVE_3_WORKING Object_E_Map.template _E_ObjectMap.template Log Message: Fix Javadoc warnings. Increase the memory available to javadoc (was taking a realy long time due to memory thrashing). Index: Object_E_Map.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/map/Attic/Object_E_Map.template,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** Object_E_Map.template 16 Sep 2009 20:57:51 -0000 1.1.2.2 --- Object_E_Map.template 9 Oct 2009 03:53:11 -0000 1.1.2.3 *************** *** 22,26 **** import gnu.trove.T#E#Collection; - import gnu.trove.set.hash.THashSet; import gnu.trove.function.T#E#Function; import gnu.trove.procedure.TObjectProcedure; --- 22,25 ---- *************** *** 99,103 **** * implementations of the <tt>Map</tt> interface. *<p/> ! * Note that no_entry_value is the result of {@link getNoEntryValue()} and represents * null for this map instance. * --- 98,102 ---- * implementations of the <tt>Map</tt> interface. *<p/> ! * Note that no_entry_value is the result of {@link #getNoEntryValue()} and represents * null for this map instance. * *************** *** 164,168 **** * @throws IllegalArgumentException if some property of the specified key * or value prevents it from being stored in this map ! * @see #getNoEntryValue(); */ #e# put( K key, #e# value); --- 163,167 ---- * @throws IllegalArgumentException if some property of the specified key * or value prevents it from being stored in this map ! * @see #getNoEntryValue() */ #e# put( K key, #e# value); *************** *** 218,222 **** * Copies all of the mappings from the specified map to this map * (optional operation). The effect of this call is equivalent to that ! * of calling {@link #put(Object,Object) put(k, v)} on this map once * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the * specified map. The behavior of this operation is undefined if the --- 217,221 ---- * Copies all of the mappings from the specified map to this map * (optional operation). The effect of this call is equivalent to that ! * of calling {@link #put(Object,#e#) put(k, v)} on this map once * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the * specified map. The behavior of this operation is undefined if the *************** *** 454,458 **** * * @return the hash code value for this map ! * @see TObject#E#Map.Entry#hashCode() * @see Object#equals(Object) * @see #equals(Object) --- 453,457 ---- * * @return the hash code value for this map ! * @see Object#equals(Object) * @see #equals(Object) Index: _E_ObjectMap.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/map/Attic/_E_ObjectMap.template,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** _E_ObjectMap.template 16 Sep 2009 20:57:51 -0000 1.1.2.2 --- _E_ObjectMap.template 9 Oct 2009 03:53:11 -0000 1.1.2.3 *************** *** 45,49 **** /** ! * Returns the value that represents null in the {@link keySet()}. * The default value is generally zero, but can be changed during * construction of the collection. --- 45,49 ---- /** ! * Returns the value that represents null in the {@link #keySet()}. * The default value is generally zero, but can be changed during * construction of the collection. *************** *** 141,145 **** * the key, the old value is replaced by the specified value. (A map * <tt>m</tt> is said to contain a mapping for a key <tt>k</tt> if and only ! * if {@link #containsKey(Object) m.containsKey(k)} would return * <tt>true</tt>.) * --- 141,145 ---- * the key, the old value is replaced by the specified value. (A map * <tt>m</tt> is said to contain a mapping for a key <tt>k</tt> if and only ! * if {@link #containsKey(#e#) m.containsKey(k)} would return * <tt>true</tt>.) * *************** *** 159,163 **** * @throws IllegalArgumentException if some property of the specified key * or value prevents it from being stored in this map ! * @see #getNoEntryValue(); */ V put( #e# key, V value); --- 159,163 ---- * @throws IllegalArgumentException if some property of the specified key * or value prevents it from being stored in this map ! * @see #getNoEntryKey() */ V put( #e# key, V value); *************** *** 171,176 **** * @param value an <tt>#e#</tt> value to be associated with the specified key * ! * @return the previous value associated with <tt>key</tt>, or the "no entry" value ! * if none was found (see {@link #getNoEntryValue}). */ V putIfAbsent( #e# key, V value ); --- 171,176 ---- * @param value an <tt>#e#</tt> value to be associated with the specified key * ! * @return the previous value associated with <tt>key</tt>, or null ! * if none was found. */ V putIfAbsent( #e# key, V value ); *************** *** 213,217 **** * Copies all of the mappings from the specified map to this map * (optional operation). The effect of this call is equivalent to that ! * of calling {@link #put(Object,Object) put(k, v)} on this map once * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the * specified map. The behavior of this operation is undefined if the --- 213,217 ---- * Copies all of the mappings from the specified map to this map * (optional operation). The effect of this call is equivalent to that ! * of calling {@link #put(#e#,Object) put(k, v)} on this map once * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the * specified map. The behavior of this operation is undefined if the *************** *** 253,257 **** /** ! * Returns a {@link Set} view of the keys contained in this map. * The set is backed by the map, so changes to the map are * reflected in the set, and vice-versa. If the map is modified --- 253,257 ---- /** ! * Returns a {@link T#E#Set} view of the keys contained in this map. * The set is backed by the map, so changes to the map are * reflected in the set, and vice-versa. If the map is modified *************** *** 418,422 **** * * @return the hash code value for this map ! * @see TObject#E#Map.Entry#hashCode() * @see Object#equals(Object) * @see #equals(Object) --- 418,422 ---- * * @return the hash code value for this map ! * @see Object#equals(Object) * @see #equals(Object) |
From: Rob E. <ro...@us...> - 2009-10-09 03:14:17
|
Update of /cvsroot/trove4j/trove In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10596/trove Modified Files: Tag: TROVE_3_WORKING build.xml Log Message: Correct the way the impl package is excluded. Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.61.2.3 retrieving revision 1.61.2.4 diff -C2 -d -r1.61.2.3 -r1.61.2.4 *** build.xml 9 Oct 2009 02:46:41 -0000 1.61.2.3 --- build.xml 9 Oct 2009 03:14:08 -0000 1.61.2.4 *************** *** 191,194 **** --- 191,195 ---- <javadoc destdir="${output.javadocs}" packagenames="gnu.trove.*" + excludepackagenames="gnu.trove.impl.*" author="true" version="true" *************** *** 201,205 **** <fileset dir="${src}"> <exclude name="**/*.html"/> - <exclude name="gnu/trove/impl/**"/> <exclude name="gnu/trove/benchmark/**"/> <exclude name="gnu/trove/generate/**"/> --- 202,205 ---- *************** *** 208,212 **** <fileset dir="${output.generated}"> <exclude name="**/*.html"/> - <exclude name="gnu/trove/impl/**"/> <exclude name="gnu/trove/benchmark/**"/> <exclude name="gnu/trove/test/**"/> --- 208,211 ---- |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:50
|
Update of /cvsroot/trove4j/trove In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7671/trove Modified Files: Tag: TROVE_3_WORKING build.xml Log Message: Exclude impl package from javadocs. Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.61.2.2 retrieving revision 1.61.2.3 diff -C2 -d -r1.61.2.2 -r1.61.2.3 *** build.xml 24 Sep 2009 04:18:05 -0000 1.61.2.2 --- build.xml 9 Oct 2009 02:46:41 -0000 1.61.2.3 *************** *** 201,204 **** --- 201,205 ---- <fileset dir="${src}"> <exclude name="**/*.html"/> + <exclude name="gnu/trove/impl/**"/> <exclude name="gnu/trove/benchmark/**"/> <exclude name="gnu/trove/generate/**"/> *************** *** 207,210 **** --- 208,212 ---- <fileset dir="${output.generated}"> <exclude name="**/*.html"/> + <exclude name="gnu/trove/impl/**"/> <exclude name="gnu/trove/benchmark/**"/> <exclude name="gnu/trove/test/**"/> |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:31
|
Update of /cvsroot/trove4j/trove/templates/gnu/trove/set/hash In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/templates/gnu/trove/set/hash Modified Files: Tag: TROVE_3_WORKING _E_HashSet.template Log Message: Back out builder changes. Index: _E_HashSet.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/set/hash/Attic/_E_HashSet.template,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** _E_HashSet.template 9 Oct 2009 01:44:34 -0000 1.1.2.9 --- _E_HashSet.template 9 Oct 2009 02:46:07 -0000 1.1.2.10 *************** *** 23,31 **** import gnu.trove.set.T#E#Set; import gnu.trove.iterator.T#E#Iterator; - import gnu.trove.iterator.TPrimitiveIterator; import gnu.trove.impl.*; import gnu.trove.impl.hash.*; import gnu.trove.T#E#Collection; - import gnu.trove.Builder; import java.io.IOException; --- 23,29 ---- *************** *** 53,58 **** static final long serialVersionUID = 1L; - /** a default builder object to use when none is specified. */ - private static final Builder<?, #ET#> DEFAULT_BUILDER = new Builder<Object, #ET#>(); /** --- 51,54 ---- *************** *** 61,65 **** */ public T#E#HashSet() { ! this( DEFAULT_BUILDER ); } --- 57,61 ---- */ public T#E#HashSet() { ! super(); } *************** *** 67,86 **** /** * Creates a new <code>T#E#HashSet</code> instance with a prime ! * capacity equal to or greater than <tt>initial_capacity</tt> and ! * with the specified load factor. * ! * @param builder describes the configurable parameters. */ ! public T#E#HashSet( Builder<?, ? extends #ET#> builder ) { ! super( builder.getInitialCapacity(), builder.getLoadFactor(), ! builder.getNoEntryValue() == null ? ! Constants.DEFAULT_#EC#_NO_ENTRY_VALUE : ! builder.getNoEntryValue().#e#Value() ); - #e# no_entry_value = builder.getNoEntryValue() == null ? - Constants.DEFAULT_#EC#_NO_ENTRY_VALUE : - builder.getNoEntryValue().#e#Value(); ! if ( no_entry_value != 0 ) { Arrays.fill( _set, no_entry_value ); } --- 63,103 ---- /** * Creates a new <code>T#E#HashSet</code> instance with a prime ! * capacity equal to or greater than <tt>initialCapacity</tt> and ! * with the default load factor. * ! * @param initialCapacity an <code>int</code> value */ ! public T#E#HashSet( int initialCapacity ) { ! super( initialCapacity ); ! } ! /** ! * Creates a new <code>TIntHash</code> 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 T#E#HashSet( int initialCapacity, float load_factor ) { ! super( initialCapacity, load_factor ); ! } ! ! ! /** ! * Creates a new <code>T#E#HashSet</code> instance with a prime ! * capacity equal to or greater than <tt>initial_capacity</tt> and ! * with the specified load factor. ! * ! * @param initial_capacity an <code>int</code> value ! * @param load_factor a <code>float</code> value ! * @param no_entry_value a <code>#e#</code> value that represents null. ! */ ! public T#E#HashSet( int initial_capacity, float load_factor, ! #e# no_entry_value ) { ! super( initial_capacity, load_factor, no_entry_value ); ! //noinspection RedundantCast ! if ( no_entry_value != ( #e# ) 0 ) { Arrays.fill( _set, no_entry_value ); } *************** *** 95,100 **** */ public T#E#HashSet( Collection<? extends #ET#> collection ) { ! this( new Builder<Object, #ET#>(). ! setInitialCapacity( Math.max( collection.size(), DEFAULT_CAPACITY ) ) ); addAll( collection ); } --- 112,116 ---- */ public T#E#HashSet( Collection<? extends #ET#> collection ) { ! this( Math.max( collection.size(), DEFAULT_CAPACITY ) ); addAll( collection ); } *************** *** 108,119 **** */ public T#E#HashSet( T#E#Collection collection ) { ! this( new Builder<Object, #ET#>(). ! setInitialCapacity( Math.max( collection.size(), DEFAULT_CAPACITY ) ). ! setNoEntryValue( collection.getNoEntryValue() ) ); if ( collection instanceof T#E#HashSet ) { T#E#HashSet hashset = ( T#E#HashSet ) collection; this._loadFactor = hashset._loadFactor; ! int size = Math.max( hashset.size(), DEFAULT_CAPACITY ); ! setUp( ( int ) Math.ceil( size / _loadFactor ) ); } addAll( collection ); --- 124,137 ---- */ public T#E#HashSet( T#E#Collection collection ) { ! this( Math.max( collection.size(), DEFAULT_CAPACITY ) ); if ( collection instanceof T#E#HashSet ) { T#E#HashSet hashset = ( T#E#HashSet ) collection; this._loadFactor = hashset._loadFactor; ! this.no_entry_value = hashset.no_entry_value; ! //noinspection RedundantCast ! if ( this.no_entry_value != ( #e# ) 0 ) { ! Arrays.fill( _set, this.no_entry_value ); ! } ! setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); } addAll( collection ); *************** *** 125,136 **** * elements of <tt>array</tt>. * - * @param builder describes the configurable parameters. * @param array an array of <code>#e#</code> primitives */ ! public T#E#HashSet( Builder<?, ? extends #ET#> builder, #e#[] array ) { ! this( builder == null ? ! new Builder<Object, #ET#>(). ! setInitialCapacity( Math.max( array.length, DEFAULT_CAPACITY ) ) : ! builder ); addAll( array ); } --- 143,150 ---- * elements of <tt>array</tt>. * * @param array an array of <code>#e#</code> primitives */ ! public T#E#HashSet( #e#[] array ) { ! this( Math.max( array.length, DEFAULT_CAPACITY ) ); addAll( array ); } |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:22
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/src/gnu/trove Removed Files: Tag: TROVE_3_WORKING Builder.java Log Message: Back out builder changes. --- Builder.java DELETED --- |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:21
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/list/array In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/test/gnu/trove/list/array Modified Files: Tag: TROVE_3_WORKING TPrimitiveArrayListTest.java Log Message: Back out builder changes. Index: TPrimitiveArrayListTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/list/array/Attic/TPrimitiveArrayListTest.java,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** TPrimitiveArrayListTest.java 6 Oct 2009 05:04:54 -0000 1.1.2.8 --- TPrimitiveArrayListTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.9 *************** *** 1,21 **** package gnu.trove.list.array; import junit.framework.TestCase; ! import java.util.*; import java.io.ByteArrayOutputStream; - import java.io.ObjectOutputStream; import java.io.ObjectInputStream; ! import java.io.ByteArrayInputStream; - import gnu.trove.list.TIntList; - import gnu.trove.impl.Constants; - import gnu.trove.procedure.TIntProcedure; - import gnu.trove.function.TIntFunction; - import gnu.trove.iterator.TIntIterator; - import gnu.trove.set.TIntSet; - import gnu.trove.set.hash.TIntHashSet; - import gnu.trove.TIntCollection; - import gnu.trove.Builder; --- 1,20 ---- package gnu.trove.list.array; + import gnu.trove.TIntCollection; + import gnu.trove.function.TIntFunction; + import gnu.trove.impl.Constants; + import gnu.trove.iterator.TIntIterator; + import gnu.trove.list.TIntList; + import gnu.trove.procedure.TIntProcedure; + import gnu.trove.set.TIntSet; + import gnu.trove.set.hash.TIntHashSet; import junit.framework.TestCase; ! import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.util.*; *************** *** 490,496 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 489,493 ---- } ! TIntArrayList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 525,531 **** public void testContainsAllTCollection() { int element_count = 20; ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count * 2 ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 522,526 ---- public void testContainsAllTCollection() { int element_count = 20; ! TIntArrayList list = new TIntArrayList( element_count * 2 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 565,572 **** int element_count = 20; int[] ints = new int[element_count]; ! ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count * 2 ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { ints[i] = i; --- 560,564 ---- int element_count = 20; int[] ints = new int[element_count]; ! TIntArrayList list = new TIntArrayList( element_count * 2 ); for ( int i = 0; i < element_count; i++ ) { ints[i] = i; *************** *** 590,596 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 582,586 ---- } ! TIntArrayList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 621,627 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 611,615 ---- } ! TIntArrayList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 679,685 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 667,671 ---- } ! TIntList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 718,724 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 704,708 ---- } ! TIntList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 758,764 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 742,746 ---- } ! TIntList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 798,804 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 780,784 ---- } ! TIntList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 818,822 **** // Reset the list ! list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 798,802 ---- // Reset the list ! list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 846,852 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 826,830 ---- } ! TIntList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 861,865 **** // Reset the list ! list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 839,843 ---- // Reset the list ! list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 874,878 **** // Reset the list ! list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 852,856 ---- // Reset the list ! list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 902,908 **** } ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 880,884 ---- } ! TIntList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 916,920 **** // Reset the list ! list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 892,896 ---- // Reset the list ! list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 942,948 **** public void testShuffle() { int element_count = 20; ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! TIntArrayList list = new TIntArrayList( builder ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); --- 918,922 ---- public void testShuffle() { int element_count = 20; ! TIntList list = new TIntArrayList( 20 ); for ( int i = 0; i < element_count; i++ ) { list.add( i ); *************** *** 1059,1065 **** int element_count = 100; ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( initial_size ); ! TIntArrayList array_list = new TIntArrayList( builder ); int initial_length = array_list._data.length; assertEquals( initial_size, initial_length ); --- 1033,1037 ---- int element_count = 100; ! TIntArrayList array_list = new TIntArrayList( initial_size ); int initial_length = array_list._data.length; assertEquals( initial_size, initial_length ); *************** *** 1292,1299 **** public void testReset() { int element_count = 20; ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( element_count ); ! builder.setNoEntryValue( Integer.MIN_VALUE ); ! TIntArrayList a = new TIntArrayList( builder ); for ( int i = 1; i <= element_count; i++ ) { a.add( i ); --- 1264,1268 ---- public void testReset() { int element_count = 20; ! TIntArrayList a = new TIntArrayList( 20, Integer.MIN_VALUE ); for ( int i = 1; i <= element_count; i++ ) { a.add( i ); |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:20
|
Update of /cvsroot/trove4j/trove/templates/gnu/trove/impl/hash In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/templates/gnu/trove/impl/hash Modified Files: Tag: TROVE_3_WORKING _E_Hash.template _K__V_Hash.template Log Message: Back out builder changes. Index: _E_Hash.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/impl/hash/Attic/_E_Hash.template,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** _E_Hash.template 27 Sep 2009 06:23:59 -0000 1.1.2.4 --- _E_Hash.template 9 Oct 2009 02:46:07 -0000 1.1.2.5 *************** *** 56,59 **** --- 56,108 ---- /** + * Creates a new <code>T#E#Hash</code> instance with the default + * capacity and load factor. + */ + public T#E#Hash() { + super(); + no_entry_value = Constants.DEFAULT_#EC#_NO_ENTRY_VALUE; + //noinspection RedundantCast + if ( no_entry_value != ( #e# ) 0 ) { + Arrays.fill( _set, no_entry_value ); + } + } + + + /** + * Creates a new <code>T#E#Hash</code> instance whose capacity + * is the next highest prime above <tt>initialCapacity + 1</tt> + * unless that value is already prime. + * + * @param initialCapacity an <code>int</code> value + */ + public T#E#Hash( int initialCapacity ) { + super( initialCapacity ); + no_entry_value = Constants.DEFAULT_#EC#_NO_ENTRY_VALUE; + //noinspection RedundantCast + if ( no_entry_value != ( #e# ) 0 ) { + Arrays.fill( _set, no_entry_value ); + } + } + + + /** + * Creates a new <code>T#E#Hash</code> 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 T#E#Hash( int initialCapacity, float loadFactor ) { + super(initialCapacity, loadFactor); + no_entry_value = Constants.DEFAULT_#EC#_NO_ENTRY_VALUE; + //noinspection RedundantCast + if ( no_entry_value != ( #e# ) 0 ) { + Arrays.fill( _set, no_entry_value ); + } + } + + + /** * Creates a new <code>T#E#Hash</code> instance with a prime * value at or near the specified capacity and load factor. Index: _K__V_Hash.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/impl/hash/Attic/_K__V_Hash.template,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** _K__V_Hash.template 27 Sep 2009 06:23:59 -0000 1.1.2.4 --- _K__V_Hash.template 9 Oct 2009 02:46:07 -0000 1.1.2.5 *************** *** 71,74 **** --- 71,99 ---- /** + * Creates a new <code>T#E#Hash</code> instance with the default + * capacity and load factor. + */ + public T#K##V#Hash() { + super(); + no_entry_key = ( #k# ) 0; + no_entry_value = ( #v# ) 0; + } + + + /** + * Creates a new <code>T#E#Hash</code> instance whose capacity + * is the next highest prime above <tt>initialCapacity + 1</tt> + * unless that value is already prime. + * + * @param initialCapacity an <code>int</code> value + */ + public T#K##V#Hash( int initialCapacity ) { + super( initialCapacity ); + no_entry_key = ( #k# ) 0; + no_entry_value = ( #v# ) 0; + } + + + /** * Creates a new <code>T#K##V#Hash</code> instance with a prime * value at or near the specified capacity and load factor. *************** *** 77,82 **** * @param loadFactor used to calculate the threshold over which * rehashing takes place. ! * @param no_entry_key value that represents null for keys ! * @param no_entry_value value that represents null for values */ public T#K##V#Hash( int initialCapacity, float loadFactor, --- 102,121 ---- * @param loadFactor used to calculate the threshold over which * rehashing takes place. ! */ ! public T#K##V#Hash( int initialCapacity, float loadFactor ) { ! super(initialCapacity, loadFactor); ! no_entry_key = ( #k# ) 0; ! no_entry_value = ( #v# ) 0; ! } ! ! ! /** ! * Creates a new <code>T#K##V#Hash</code> 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 T#K##V#Hash( int initialCapacity, float loadFactor, |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:18
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/set/hash In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/test/gnu/trove/set/hash Modified Files: Tag: TROVE_3_WORKING TPrimitiveHashSetTest.java Log Message: Back out builder changes. Index: TPrimitiveHashSetTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/set/hash/Attic/TPrimitiveHashSetTest.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** TPrimitiveHashSetTest.java 27 Sep 2009 06:23:59 -0000 1.1.2.4 --- TPrimitiveHashSetTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.5 *************** *** 1,16 **** package gnu.trove.set.hash; import junit.framework.TestCase; - import java.util.*; - import java.io.ByteArrayOutputStream; - import java.io.ObjectOutputStream; import java.io.ByteArrayInputStream; import java.io.ObjectInputStream; - import gnu.trove.set.TIntSet; - import gnu.trove.iterator.TIntIterator; - import gnu.trove.procedure.TIntProcedure; - import gnu.trove.Builder; --- 1,15 ---- package gnu.trove.set.hash; + import gnu.trove.iterator.TIntIterator; + import gnu.trove.procedure.TIntProcedure; + import gnu.trove.set.TIntSet; import junit.framework.TestCase; import java.io.ByteArrayInputStream; + import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; + import java.util.*; *************** *** 43,59 **** assertTrue( "set not a copy: " + set + ", " + copy, set.equals( copy ) ); ! Builder<?,Integer> builder = new Builder<Object,Integer>(); ! builder.setInitialCapacity( 20 ); ! TIntSet another = new TIntHashSet( builder ); another.addAll( ints ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); ! builder.setInitialCapacity( 2 ); ! builder.setLoadFactor( 1.0f ); ! another = new TIntHashSet( builder ); another.addAll( ints ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); ! another = new TIntHashSet( builder, ints ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); } --- 42,54 ---- assertTrue( "set not a copy: " + set + ", " + copy, set.equals( copy ) ); ! TIntSet another = new TIntHashSet( 20 ); another.addAll( ints ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); ! another = new TIntHashSet( 2, 1.0f ); another.addAll( ints ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); ! another = new TIntHashSet( ints ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); } *************** *** 389,395 **** public void testToArrayWithParams() { int no_entry_value = Integer.MIN_VALUE; ! Builder<?,Integer> builder = new Builder<Object,Integer>(); ! builder.setNoEntryValue( no_entry_value ); ! TIntSet set = new TIntHashSet( builder ); assertEquals( no_entry_value, set.getNoEntryValue() ); --- 384,388 ---- public void testToArrayWithParams() { int no_entry_value = Integer.MIN_VALUE; ! TIntSet set = new TIntHashSet( 10, 0.5f, no_entry_value ); assertEquals( no_entry_value, set.getNoEntryValue() ); *************** *** 421,425 **** public void testRehashing() throws Exception { int size = 10000; ! TIntSet set = new TIntHashSet(); for ( int i = 0; i < size; i++ ) { set.add( i ); --- 414,418 ---- public void testRehashing() throws Exception { int size = 10000; ! TIntSet set = new TIntHashSet( 10 ); for ( int i = 0; i < size; i++ ) { set.add( i ); *************** *** 494,498 **** public void testForEach() { ! TIntSet set = new TIntHashSet(); int[] ints = {1138, 42, 86, 99, 101}; set.addAll( ints ); --- 487,491 ---- public void testForEach() { ! TIntSet set = new TIntHashSet( 10, 0.5f ); int[] ints = {1138, 42, 86, 99, 101}; set.addAll( ints ); |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:18
|
Update of /cvsroot/trove4j/trove/templates/gnu/trove/list/array In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/templates/gnu/trove/list/array Modified Files: Tag: TROVE_3_WORKING _E_ArrayList.template Log Message: Back out builder changes. Index: _E_ArrayList.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/list/array/Attic/_E_ArrayList.template,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -C2 -d -r1.1.2.17 -r1.1.2.18 *** _E_ArrayList.template 6 Oct 2009 05:04:54 -0000 1.1.2.17 --- _E_ArrayList.template 9 Oct 2009 02:46:07 -0000 1.1.2.18 *************** *** 27,31 **** import gnu.trove.T#E#Collection; import gnu.trove.impl.*; - import gnu.trove.Builder; import java.io.Externalizable; --- 27,30 ---- *************** *** 47,53 **** static final long serialVersionUID = 1L; - /** a default builder object to use when none is specified. */ - private static final Builder<?, #ET#> DEFAULT_BUILDER = new Builder<Object, #ET#>(); - /** the data of the list */ protected #e#[] _data; --- 46,49 ---- *************** *** 67,72 **** * default capacity. */ public T#E#ArrayList() { ! this( DEFAULT_BUILDER ); } --- 63,69 ---- * default capacity. */ + @SuppressWarnings({"RedundantCast"}) public T#E#ArrayList() { ! this( DEFAULT_CAPACITY, ( #e# ) 0 ); } *************** *** 74,96 **** /** * Creates a new <code>T#E#ArrayList</code> instance with the ! * specified configurable elements. * ! * @param builder describes the configurable parameters. */ ! public T#E#ArrayList( Builder<?, ? extends #ET#> builder ) { ! _data = new #e#[ builder.getInitialCapacity() ]; ! _pos = 0; ! no_entry_value = builder.getNoEntryValue() == null ? ! Constants.DEFAULT_#EC#_NO_ENTRY_VALUE : ! builder.getNoEntryValue().#e#Value(); ! ! //noinspection RedundantCast ! if ( no_entry_value != ( #e# ) 0 ) { ! Arrays.fill( _data, no_entry_value ); ! } } /** * Creates a new <code>T#E#ArrayList</code> instance that contains * a copy of the collection passed to us. --- 71,98 ---- /** * Creates a new <code>T#E#ArrayList</code> instance with the ! * specified capacity. * ! * @param capacity an <code>int</code> value */ ! @SuppressWarnings({"RedundantCast"}) ! public T#E#ArrayList( int capacity ) { ! this( capacity, ( #e# ) 0 ); } /** + * Creates a new <code>T#E#ArrayList</code> instance with the + * specified capacity. + * + * @param capacity an <code>int</code> value + * @param no_entry_value an <code>#e#</code> value that represents null. + */ + public T#E#ArrayList( int capacity, #e# no_entry_value ) { + _data = new #e#[ capacity ]; + _pos = 0; + this.no_entry_value = no_entry_value; + } + + /** * Creates a new <code>T#E#ArrayList</code> instance that contains * a copy of the collection passed to us. *************** *** 99,104 **** */ public T#E#ArrayList ( T#E#Collection collection ) { ! this( new Builder<Object, #ET#>().setInitialCapacity( collection.size() ) ! .setNoEntryValue( collection.getNoEntryValue() ) ); addAll( collection ); } --- 101,105 ---- */ public T#E#ArrayList ( T#E#Collection collection ) { ! this( collection.size() ); addAll( collection ); } *************** *** 110,118 **** * initial contents are the specified values. * - * @param builder describes the configurable parameters. * @param values an <code>#e#[]</code> value */ ! public T#E#ArrayList( Builder<?, #ET#> builder, #e#[] values ) { ! this( builder == null ? DEFAULT_BUILDER : builder ); add( values ); } --- 111,118 ---- * initial contents are the specified values. * * @param values an <code>#e#[]</code> value */ ! public T#E#ArrayList( #e#[] values ) { ! this( values.length ); add( values ); } *************** *** 176,180 **** ! /** {@inheritDoc} */ public void add( #e#[] vals, int offset, int length ) { ensureCapacity( _pos + length ); --- 176,180 ---- ! /** {@inheritDoc} */ public void add( #e#[] vals, int offset, int length ) { ensureCapacity( _pos + length ); *************** *** 287,295 **** _data = new #e#[ capacity ]; _pos = 0; - - //noinspection RedundantCast - if ( no_entry_value != ( int ) 0 ) { - Arrays.fill( _data, no_entry_value ); - } } --- 287,290 ---- *************** *** 599,605 **** throw new IndexOutOfBoundsException( "end index < " + _data.length ); } ! Builder<Object, #ET#> builder = new Builder<Object, #ET#>(); ! builder.setInitialCapacity( end - begin ).setNoEntryValue( getNoEntryValue() ); ! T#E#ArrayList list = new T#E#ArrayList( builder ); for ( int i = begin; i < end; i++ ) { list.add( _data[ i ] ); --- 594,598 ---- throw new IndexOutOfBoundsException( "end index < " + _data.length ); } ! T#E#ArrayList list = new T#E#ArrayList( end - begin ); for ( int i = begin; i < end; i++ ) { list.add( _data[ i ] ); *************** *** 956,960 **** - /** {@inheritDoc} */ public void writeExternal( ObjectOutput out ) throws IOException { // VERSION --- 949,952 ---- *************** *** 976,980 **** - /** {@inheritDoc} */ public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { --- 968,971 ---- |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:18
|
Update of /cvsroot/trove4j/trove/src/gnu/trove/impl/hash In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/src/gnu/trove/impl/hash Modified Files: Tag: TROVE_3_WORKING TPrimitiveHash.java Log Message: Back out builder changes. Index: TPrimitiveHash.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/impl/hash/Attic/TPrimitiveHash.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** TPrimitiveHash.java 9 Oct 2009 01:44:34 -0000 1.1.2.4 --- TPrimitiveHash.java 9 Oct 2009 02:46:07 -0000 1.1.2.5 *************** *** 60,63 **** --- 60,84 ---- /** + * Creates a new <code>THash</code> instance with the default + * capacity and load factor. + */ + public TPrimitiveHash() { + super(); + } + + + /** + * Creates a new <code>TPrimitiveHash</code> instance with a prime + * capacity at or near the specified capacity and with the default + * load factor. + * + * @param initialCapacity an <code>int</code> value + */ + public TPrimitiveHash( int initialCapacity ) { + this( initialCapacity, DEFAULT_LOAD_FACTOR ); + } + + + /** * Creates a new <code>TPrimitiveHash</code> instance with a prime * capacity at or near the minimum needed to hold *************** *** 91,95 **** * @param index an <code>int</code> value */ ! protected void removeAt( int index ) { _states[index] = REMOVED; super.removeAt( index ); --- 112,116 ---- * @param index an <code>int</code> value */ ! protected void removeAt( int index ) { _states[index] = REMOVED; super.removeAt( index ); |
Update of /cvsroot/trove4j/trove/test/gnu/trove/map/hash In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/test/gnu/trove/map/hash Modified Files: Tag: TROVE_3_WORKING TPrimitiveObjectHashMapTest.java TObjectPrimitiveHashMapTest.java TPrimitivePrimitiveHashMapTest.java Log Message: Back out builder changes. Index: TPrimitiveObjectHashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/map/hash/Attic/TPrimitiveObjectHashMapTest.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** TPrimitiveObjectHashMapTest.java 27 Sep 2009 06:23:58 -0000 1.1.2.4 --- TPrimitiveObjectHashMapTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.5 *************** *** 22,46 **** ! import junit.framework.TestCase; ! ! import java.util.*; ! import java.io.ByteArrayOutputStream; ! import java.io.ObjectOutputStream; ! import java.io.ByteArrayInputStream; ! import java.io.ObjectInputStream; ! import gnu.trove.iterator.TIntIterator; import gnu.trove.iterator.TIntObjectIterator; - import gnu.trove.procedure.TIntProcedure; - import gnu.trove.procedure.TObjectProcedure; - import gnu.trove.procedure.TIntObjectProcedure; - import gnu.trove.map.TIntObjectMap; import gnu.trove.list.TIntList; import gnu.trove.list.array.TIntArrayList; ! import gnu.trove.function.TObjectFunction; import gnu.trove.set.TIntSet; import gnu.trove.set.hash.TIntHashSet; ! import gnu.trove.TIntCollection; ! import gnu.trove.Builder; --- 22,45 ---- ! import gnu.trove.TIntCollection; ! import gnu.trove.function.TObjectFunction; import gnu.trove.iterator.TIntIterator; import gnu.trove.iterator.TIntObjectIterator; import gnu.trove.list.TIntList; import gnu.trove.list.array.TIntArrayList; ! import gnu.trove.map.TIntObjectMap; ! import gnu.trove.procedure.TIntObjectProcedure; ! import gnu.trove.procedure.TIntProcedure; ! import gnu.trove.procedure.TObjectProcedure; import gnu.trove.set.TIntSet; import gnu.trove.set.hash.TIntHashSet; ! import junit.framework.TestCase; ! ! import java.io.ByteArrayInputStream; ! import java.io.ByteArrayOutputStream; ! import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.util.*; ! *************** *** 67,74 **** } - Builder<Integer,String> builder = new Builder<Integer, String>(); - builder.setInitialCapacity( element_count ); TIntObjectMap<String> capacity = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { capacity.put( keys[i], vals[i] ); --- 66,71 ---- } TIntObjectMap<String> capacity = ! new TIntObjectHashMap<String>( 20 ); for ( int i = 0; i < element_count; i++ ) { capacity.put( keys[i], vals[i] ); *************** *** 76,82 **** assertEquals( map, capacity ); - builder.setLoadFactor( 0.75f ); TIntObjectMap<String> cap_and_factor = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { cap_and_factor.put( keys[i], vals[i] ); --- 73,78 ---- assertEquals( map, capacity ); TIntObjectMap<String> cap_and_factor = ! new TIntObjectHashMap<String>( 20, 0.75f ); for ( int i = 0; i < element_count; i++ ) { cap_and_factor.put( keys[i], vals[i] ); *************** *** 84,90 **** assertEquals( map, cap_and_factor ); - builder.setNoEntryKey( Integer.MIN_VALUE ); TIntObjectMap<String> fully_specified = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { fully_specified.put( keys[i], vals[i] ); --- 80,85 ---- assertEquals( map, cap_and_factor ); TIntObjectMap<String> fully_specified = ! new TIntObjectHashMap<String>( 20, 0.75f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { fully_specified.put( keys[i], vals[i] ); *************** *** 411,415 **** Collection<Integer> test_collection = new HashSet<Integer>(); - //noinspection ManualArrayToCollectionCopy for ( int i = 0; i < element_count; i++ ) { test_collection.add( keys[i] ); --- 406,409 ---- *************** *** 512,516 **** Collection<Integer> test_collection = new HashSet<Integer>(); - //noinspection ManualArrayToCollectionCopy for ( int i = 0; i < element_count; i++ ) { test_collection.add( keys[i] ); --- 506,509 ---- *************** *** 820,824 **** assertEquals( keyset.hashCode(), keyset.hashCode() ); ! TIntSet other = new TIntHashSet( null, keys ); other.add( 1138 ); assertTrue( keyset.hashCode() != other.hashCode() ); --- 813,817 ---- assertEquals( keyset.hashCode(), keyset.hashCode() ); ! TIntSet other = new TIntHashSet( keys ); other.add( 1138 ); assertTrue( keyset.hashCode() != other.hashCode() ); *************** *** 842,846 **** int[] keys_array = map.keys(); assertEquals( element_count, keys_array.length ); ! TIntList keys_list = new TIntArrayList( null, keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); --- 835,839 ---- int[] keys_array = map.keys(); assertEquals( element_count, keys_array.length ); ! TIntList keys_list = new TIntArrayList( keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); *************** *** 850,854 **** keys_array = map.keys( new int[0] ); assertEquals( element_count, keys_array.length ); ! keys_list = new TIntArrayList( null, keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); --- 843,847 ---- keys_array = map.keys( new int[0] ); assertEquals( element_count, keys_array.length ); ! keys_list = new TIntArrayList( keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); *************** *** 858,862 **** keys_array = map.keys( new int[map.size()] ); assertEquals( element_count, keys_array.length ); ! keys_list = new TIntArrayList( null, keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); --- 851,855 ---- keys_array = map.keys( new int[map.size()] ); assertEquals( element_count, keys_array.length ); ! keys_list = new TIntArrayList( keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); *************** *** 866,870 **** keys_array = map.keys( new int[element_count * 2] ); assertEquals( element_count * 2, keys_array.length ); ! keys_list = new TIntArrayList( null, keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); --- 859,863 ---- keys_array = map.keys( new int[element_count * 2] ); assertEquals( element_count * 2, keys_array.length ); ! keys_list = new TIntArrayList( keys_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( keys_list.contains( keys[i] ) ); *************** *** 1361,1368 **** int remaining = element_count / 2; ! Builder<Integer,String> builder = new Builder<Integer, String>(); ! builder.setInitialCapacity( element_count ); ! builder.setNoEntryKey( Integer.MIN_VALUE ); ! TIntObjectHashMap<String> map = new TIntObjectHashMap<String>( builder ); for ( int pass = 0; pass < 10; pass++ ) { --- 1354,1359 ---- int remaining = element_count / 2; ! TIntObjectHashMap<String> map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int pass = 0; pass < 10; pass++ ) { *************** *** 1386,1394 **** String[] vals = new String[element_count]; - Builder<Integer,String> builder = new Builder<Integer, String>(); - builder.setInitialCapacity( element_count ); - builder.setNoEntryKey( Integer.MIN_VALUE ); TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; --- 1377,1382 ---- String[] vals = new String[element_count]; TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; *************** *** 1417,1421 **** map.forEachKey( foreach ); TIntList built = foreach.getBuilt(); ! TIntList keys_list = new TIntArrayList( null, map.keys( new int[map.size()] ) ); assertEquals( keys_list, built ); --- 1405,1409 ---- map.forEachKey( foreach ); TIntList built = foreach.getBuilt(); ! TIntList keys_list = new TIntArrayList( map.keys( new int[map.size()] ) ); assertEquals( keys_list, built ); *************** *** 1444,1448 **** map.forEachKey( foreach_false ); built = foreach_false.getBuilt(); ! keys_list = new TIntArrayList( null, map.keys( new int[map.size()] ) ); assertEquals( 1, built.size() ); assertEquals( keys_list.get( 0 ), built.get( 0 ) ); --- 1432,1436 ---- map.forEachKey( foreach_false ); built = foreach_false.getBuilt(); ! keys_list = new TIntArrayList( map.keys( new int[map.size()] ) ); assertEquals( 1, built.size() ); assertEquals( keys_list.get( 0 ), built.get( 0 ) ); *************** *** 1455,1463 **** String[] vals = new String[element_count]; - Builder<Integer,String> builder = new Builder<Integer, String>(); - builder.setInitialCapacity( element_count ); - builder.setNoEntryKey( Integer.MIN_VALUE ); TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; --- 1443,1448 ---- String[] vals = new String[element_count]; TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; *************** *** 1524,1532 **** String[] vals = new String[element_count]; - Builder<Integer,String> builder = new Builder<Integer, String>(); - builder.setInitialCapacity( element_count ); - builder.setNoEntryKey( Integer.MIN_VALUE ); TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; --- 1509,1514 ---- String[] vals = new String[element_count]; TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; *************** *** 1671,1679 **** String[] vals = new String[element_count]; - Builder<Integer,String> builder = new Builder<Integer, String>(); - builder.setInitialCapacity( element_count ); - builder.setNoEntryKey( Integer.MIN_VALUE ); TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; --- 1653,1658 ---- String[] vals = new String[element_count]; TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; *************** *** 1701,1709 **** String[] vals = new String[element_count]; - Builder<Integer,String> builder = new Builder<Integer, String>(); - builder.setInitialCapacity( element_count ); - builder.setNoEntryKey( Integer.MIN_VALUE ); TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; --- 1680,1685 ---- String[] vals = new String[element_count]; TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; *************** *** 1713,1719 **** assertEquals( element_count, map.size() ); - builder.setLoadFactor( 0.75f ); TIntObjectHashMap<String> fully_specified = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { fully_specified.put( keys[i], vals[i] ); --- 1689,1694 ---- assertEquals( element_count, map.size() ); TIntObjectHashMap<String> fully_specified = ! new TIntObjectHashMap<String>( 20, 0.75f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { fully_specified.put( keys[i], vals[i] ); *************** *** 1749,1757 **** int counter = 0; - Builder<Integer,String> builder = new Builder<Integer, String>(); - builder.setInitialCapacity( element_count ); - builder.setNoEntryKey( Integer.MIN_VALUE ); TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++, counter++ ) { keys[i] = counter + 1; --- 1724,1729 ---- int counter = 0; TIntObjectMap<String> map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++, counter++ ) { keys[i] = counter + 1; *************** *** 1770,1774 **** TIntObjectMap<String> map2 = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++, counter++ ) { keys[i] = counter + 1; --- 1742,1746 ---- TIntObjectMap<String> map2 = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++, counter++ ) { keys[i] = counter + 1; *************** *** 1780,1784 **** TIntObjectMap<String> map3 = ! new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++, counter++ ) { keys[i] = counter + 1; --- 1752,1756 ---- TIntObjectMap<String> map3 = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++, counter++ ) { keys[i] = counter + 1; Index: TObjectPrimitiveHashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/map/hash/Attic/TObjectPrimitiveHashMapTest.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** TObjectPrimitiveHashMapTest.java 27 Sep 2009 06:23:58 -0000 1.1.2.3 --- TObjectPrimitiveHashMapTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.4 *************** *** 22,43 **** import junit.framework.TestCase; - import java.util.*; - import java.io.ByteArrayOutputStream; - import java.io.ObjectOutputStream; import java.io.ByteArrayInputStream; import java.io.ObjectInputStream; ! ! import gnu.trove.iterator.TObjectIntIterator; ! import gnu.trove.iterator.TIntIterator; ! import gnu.trove.procedure.TObjectIntProcedure; ! import gnu.trove.procedure.TIntProcedure; ! import gnu.trove.procedure.TObjectProcedure; ! import gnu.trove.map.TObjectIntMap; ! import gnu.trove.list.TIntList; ! import gnu.trove.list.array.TIntArrayList; ! import gnu.trove.function.TIntFunction; ! import gnu.trove.TIntCollection; --- 22,42 ---- + import gnu.trove.TIntCollection; + import gnu.trove.function.TIntFunction; + import gnu.trove.iterator.TIntIterator; + import gnu.trove.iterator.TObjectIntIterator; + import gnu.trove.list.TIntList; + import gnu.trove.list.array.TIntArrayList; + import gnu.trove.map.TObjectIntMap; + import gnu.trove.procedure.TIntProcedure; + import gnu.trove.procedure.TObjectIntProcedure; + import gnu.trove.procedure.TObjectProcedure; import junit.framework.TestCase; import java.io.ByteArrayInputStream; + import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.util.*; *************** *** 861,865 **** int[] values_array = map.values(); assertEquals( element_count, values_array.length ); ! TIntList values_list = new TIntArrayList( null, values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); --- 860,864 ---- int[] values_array = map.values(); assertEquals( element_count, values_array.length ); ! TIntList values_list = new TIntArrayList( values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); *************** *** 869,873 **** values_array = map.values( new int[0] ); assertEquals( element_count, values_array.length ); ! values_list = new TIntArrayList( null, values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); --- 868,872 ---- values_array = map.values( new int[0] ); assertEquals( element_count, values_array.length ); ! values_list = new TIntArrayList( values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); *************** *** 877,881 **** values_array = map.values( new int[map.size()] ); assertEquals( element_count, values_array.length ); ! values_list = new TIntArrayList( null, values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); --- 876,880 ---- values_array = map.values( new int[map.size()] ); assertEquals( element_count, values_array.length ); ! values_list = new TIntArrayList( values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); *************** *** 885,889 **** values_array = map.values( new int[element_count * 2] ); assertEquals( element_count * 2, values_array.length ); ! values_list = new TIntArrayList( null, values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); --- 884,888 ---- values_array = map.values( new int[element_count * 2] ); assertEquals( element_count * 2, values_array.length ); ! values_list = new TIntArrayList( values_array ); for ( int i = 0; i < element_count; i++ ) { assertTrue( values_list.contains( vals[i] ) ); *************** *** 1185,1189 **** map.forEachValue( foreach ); TIntList built = foreach.getBuilt(); ! TIntList values = new TIntArrayList( null, map.values() ); assertEquals( values, built ); --- 1184,1188 ---- map.forEachValue( foreach ); TIntList built = foreach.getBuilt(); ! TIntList values = new TIntArrayList( map.values() ); assertEquals( values, built ); *************** *** 1212,1216 **** map.forEachValue( foreach_false ); built = foreach_false.getBuilt(); ! values = new TIntArrayList( null, map.values() ); assertEquals( 1, built.size() ); assertEquals( values.get( 0 ), built.get( 0 ) ); --- 1211,1215 ---- map.forEachValue( foreach_false ); built = foreach_false.getBuilt(); ! values = new TIntArrayList( map.values() ); assertEquals( 1, built.size() ); assertEquals( values.get( 0 ), built.get( 0 ) ); Index: TPrimitivePrimitiveHashMapTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/map/hash/Attic/TPrimitivePrimitiveHashMapTest.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** TPrimitivePrimitiveHashMapTest.java 2 Oct 2009 00:37:31 -0000 1.1.2.7 --- TPrimitivePrimitiveHashMapTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.8 *************** *** 41,45 **** import gnu.trove.TLongCollection; import gnu.trove.TIntCollection; - import gnu.trove.Builder; import junit.framework.TestCase; --- 41,44 ---- *************** *** 77,83 **** assertEquals( keys.length, map.size() ); ! Builder<Integer,Long> builder = new Builder<Integer, Long>(); ! builder.setInitialCapacity( 20 ); ! TIntLongMap capacity = new TIntLongHashMap( builder ); for ( int i = 0; i < keys.length; i++ ) { capacity.put( keys[i], vals[i] ); --- 76,80 ---- assertEquals( keys.length, map.size() ); ! TIntLongMap capacity = new TIntLongHashMap( 20 ); for ( int i = 0; i < keys.length; i++ ) { capacity.put( keys[i], vals[i] ); *************** *** 85,90 **** assertEquals( keys.length, capacity.size() ); ! builder.setLoadFactor( 0.75f ); ! TIntLongMap cap_and_factor = new TIntLongHashMap( builder ); for ( int i = 0; i < keys.length; i++ ) { cap_and_factor.put( keys[i], vals[i] ); --- 82,86 ---- assertEquals( keys.length, capacity.size() ); ! TIntLongMap cap_and_factor = new TIntLongHashMap( 20, 0.75f ); for ( int i = 0; i < keys.length; i++ ) { cap_and_factor.put( keys[i], vals[i] ); *************** *** 92,97 **** assertEquals( keys.length, cap_and_factor.size() ); ! builder = new Builder<Integer, Long>( 20, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); ! TIntLongMap fully_specified = new TIntLongHashMap( builder ); for ( int i = 0; i < keys.length; i++ ) { fully_specified.put( keys[i], vals[i] ); --- 88,93 ---- assertEquals( keys.length, cap_and_factor.size() ); ! TIntLongMap fully_specified = ! new TIntLongHashMap( 20, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); for ( int i = 0; i < keys.length; i++ ) { fully_specified.put( keys[i], vals[i] ); *************** *** 102,106 **** assertEquals( keys.length, fully_specified.size() ); ! TIntLongMap arrays = new TIntLongHashMap( builder, keys, vals ); assertEquals( keys.length, arrays.size() ); --- 98,102 ---- assertEquals( keys.length, fully_specified.size() ); ! TIntLongMap arrays = new TIntLongHashMap( keys, vals ); assertEquals( keys.length, arrays.size() ); *************** *** 318,322 **** // test with a java.util.Map Set<Number> java_set = new HashSet<Number>(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { java_set.add( Integer.valueOf( keys[i] ) ); --- 314,317 ---- *************** *** 331,335 **** // test with a TCollection ! TIntSet tintset = new TIntHashSet( null, keys ); assertTrue( set.containsAll( tintset ) ); tintset.add( 12 ); --- 326,330 ---- // test with a TCollection ! TIntSet tintset = new TIntHashSet( keys ); assertTrue( set.containsAll( tintset ) ); tintset.add( 12 ); *************** *** 359,363 **** // test with a java.util.Map Set<Integer> java_set = new HashSet<Integer>(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { java_set.add( Integer.valueOf( keys[i] ) ); --- 354,357 ---- *************** *** 406,410 **** // test with a java.util.Map Set<Number> java_set = new HashSet<Number>(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { java_set.add( Integer.valueOf( keys[i] ) ); --- 400,403 ---- *************** *** 413,417 **** assertEquals( keys.length, set.size() ); assertEquals( keys.length, map.size() ); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { assertTrue( set.contains( keys[i] ) ); --- 406,409 ---- *************** *** 423,427 **** assertEquals( keys.length - 1, set.size() ); assertEquals( keys.length - 1, map.size() ); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { if ( keys[i] != 42 ) { --- 415,418 ---- *************** *** 453,460 **** // test with a TCollection ! TIntSet tintset = new TIntHashSet( null, keys ); assertFalse( "set: " + set + ", collection: " + tintset, set.retainAll( tintset ) ); ! TIntCollection collection = new TIntArrayList( null, keys ); assertFalse( "set: " + set + ", collection: " + collection, set.retainAll( collection ) ); --- 444,451 ---- // test with a TCollection ! TIntSet tintset = new TIntHashSet( keys ); assertFalse( "set: " + set + ", collection: " + tintset, set.retainAll( tintset ) ); ! TIntCollection collection = new TIntArrayList( keys ); assertFalse( "set: " + set + ", collection: " + collection, set.retainAll( collection ) ); *************** *** 522,527 **** assertFalse( set.removeAll( java_set ) ); assertEquals( keys.length, set.size() ); ! assertEquals( keys.length, map.size() ); ! //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { assertTrue( set.contains( keys[i] ) ); --- 513,517 ---- assertFalse( set.removeAll( java_set ) ); assertEquals( keys.length, set.size() ); ! assertEquals( keys.length, map.size() ); for ( int i = 0; i < keys.length; i++ ) { assertTrue( set.contains( keys[i] ) ); *************** *** 529,533 **** } - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { java_set.add( Integer.valueOf( keys[i] ) ); --- 519,522 ---- *************** *** 538,542 **** assertEquals( "set: " + set, 1, set.size() ); assertEquals( "set: " + set, 1, map.size() ); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { if ( keys[i] == 42 ) { --- 527,530 ---- *************** *** 582,586 **** // With partial set ! tintset = new TIntHashSet( null, keys ); tintset.remove( 42 ); assertTrue( "set: " + set + ", collection: " + tintset, --- 570,574 ---- // With partial set ! tintset = new TIntHashSet( keys ); tintset.remove( 42 ); assertTrue( "set: " + set + ", collection: " + tintset, *************** *** 588,592 **** assertEquals( "set: " + set, 1, set.size() ); assertEquals( "set: " + set, 1, map.size() ); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { if ( keys[i] == 42 ) { --- 576,579 ---- *************** *** 613,617 **** // partial list ! collection = new TIntArrayList( null, keys ); collection.remove( 42 ); assertTrue( "set: " + set + ", collection: " + collection, --- 600,604 ---- // partial list ! collection = new TIntArrayList( keys ); collection.remove( 42 ); assertTrue( "set: " + set + ", collection: " + collection, *************** *** 619,623 **** assertEquals( "set: " + set, 1, set.size() ); assertEquals( "set: " + set, 1, map.size() ); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { if ( keys[i] == 42 ) { --- 606,609 ---- *************** *** 779,783 **** } ! TIntList list = new TIntArrayList( null, keys ); TIntSet set = map.keySet(); assertEquals( map.getNoEntryKey(), set.getNoEntryValue() ); --- 765,769 ---- } ! TIntList list = new TIntArrayList( keys ); TIntSet set = map.keySet(); assertEquals( map.getNoEntryKey(), set.getNoEntryValue() ); *************** *** 828,832 **** int[] keys = map.keys( new int[map.size()] ); assertEquals( 2, keys.length ); ! TIntList keys_list = new TIntArrayList( null, keys ); assertTrue( keys_list.contains( KEY_ONE ) ); --- 814,818 ---- int[] keys = map.keys( new int[map.size()] ); assertEquals( 2, keys.length ); ! TIntList keys_list = new TIntArrayList( keys ); assertTrue( keys_list.contains( KEY_ONE ) ); *************** *** 835,839 **** int[] keys2 = map.keys(); assertEquals( 2, keys2.length ); ! TIntList keys_list2 = new TIntArrayList( null, keys2 ); assertTrue( keys_list2.contains( KEY_ONE ) ); --- 821,825 ---- int[] keys2 = map.keys(); assertEquals( 2, keys2.length ); ! TIntList keys_list2 = new TIntArrayList( keys2 ); assertTrue( keys_list2.contains( KEY_ONE ) ); *************** *** 918,922 **** // test with a java.util.Map Set<Number> java_set = new HashSet<Number>(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < vals.length; i++ ) { java_set.add( Long.valueOf( vals[i] ) ); --- 904,907 ---- *************** *** 931,935 **** // test with a TCollection ! TLongSet tintset = new TLongHashSet( null, vals ); assertTrue( values.containsAll( tintset ) ); tintset.add( 12 ); --- 916,920 ---- // test with a TCollection ! TLongSet tintset = new TLongHashSet( vals ); assertTrue( values.containsAll( tintset ) ); tintset.add( 12 ); *************** *** 959,963 **** // test with a java.util.Map Set<Long> java_set = new HashSet<Long>(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < vals.length; i++ ) { java_set.add( Long.valueOf( vals[i] ) ); --- 944,947 ---- *************** *** 1006,1010 **** // test with a java.util.Map Set<Number> java_set = new HashSet<Number>(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < vals.length; i++ ) { java_set.add( Long.valueOf( vals[i] ) ); --- 990,993 ---- *************** *** 1052,1059 **** // test with a TCollection ! TLongSet tintset = new TLongHashSet( null, vals ); assertFalse( "values: " + values + ", collection: " + tintset, values.retainAll( tintset ) ); ! TLongCollection collection = new TLongArrayList( null, vals ); assertFalse( "values: " + values + ", collection: " + collection, values.retainAll( collection ) ); --- 1035,1042 ---- // test with a TCollection ! TLongSet tintset = new TLongHashSet( vals ); assertFalse( "values: " + values + ", collection: " + tintset, values.retainAll( tintset ) ); ! TLongCollection collection = new TLongArrayList( vals ); assertFalse( "values: " + values + ", collection: " + collection, values.retainAll( collection ) ); *************** *** 1127,1131 **** } - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < vals.length; i++ ) { java_set.add( Long.valueOf( vals[i] ) ); --- 1110,1113 ---- *************** *** 1136,1140 **** assertEquals( "set: " + values, 1, values.size() ); assertEquals( "set: " + values, 1, map.size() ); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < vals.length; i++ ) { if ( vals[i] == 42 * 2 ) { --- 1118,1121 ---- *************** *** 1180,1184 **** // With partial set ! tlongset = new TLongHashSet( null, vals ); tlongset.remove( 42 * 2 ); assertTrue( "values: " + values + ", collection: " + tlongset, --- 1161,1165 ---- // With partial set ! tlongset = new TLongHashSet( vals ); tlongset.remove( 42 * 2 ); assertTrue( "values: " + values + ", collection: " + tlongset, *************** *** 1210,1214 **** // partial list ! collection = new TLongArrayList( null, vals ); collection.remove( 42 * 2 ); assertTrue( "values: " + values + ", collection: " + collection, --- 1191,1195 ---- // partial list ! collection = new TLongArrayList( vals ); collection.remove( 42 * 2 ); assertTrue( "values: " + values + ", collection: " + collection, *************** *** 1316,1320 **** values.equals( values_list ) ); ! TLongList list = new TLongArrayList( null, vals ); values_list.sort(); list.sort(); --- 1297,1301 ---- values.equals( values_list ) ); ! TLongList list = new TLongArrayList( vals ); values_list.sort(); list.sort(); *************** *** 1341,1345 **** // value in map twice, in list twice. ! list = new TLongArrayList( null, vals ); map.put( 1, vals[0] ); values_list = new TLongArrayList( map.valueCollection() ); --- 1322,1326 ---- // value in map twice, in list twice. ! list = new TLongArrayList( vals ); map.put( 1, vals[0] ); values_list = new TLongArrayList( map.valueCollection() ); *************** *** 1351,1355 **** // value in the map twice, same length list, but value only in list once. ! list = new TLongArrayList( null, vals ); list.add( -1 ); list.sort(); --- 1332,1336 ---- // value in the map twice, same length list, but value only in list once. ! list = new TLongArrayList( vals ); list.add( -1 ); list.sort(); *************** *** 1390,1394 **** } ! TLongList list = new TLongArrayList( null, vals ); TLongCollection set = map.valueCollection(); assertEquals( map.getNoEntryValue(), set.getNoEntryValue() ); --- 1371,1375 ---- } ! TLongList list = new TLongArrayList( vals ); TLongCollection set = map.valueCollection(); assertEquals( map.getNoEntryValue(), set.getNoEntryValue() ); *************** *** 1439,1443 **** long[] values = map.values( new long[map.size()] ); assertEquals( 2, values.length ); ! TLongList values_list = new TLongArrayList( null, values ); assertTrue( values_list.contains( 1 ) ); --- 1420,1424 ---- long[] values = map.values( new long[map.size()] ); assertEquals( 2, values.length ); ! TLongList values_list = new TLongArrayList( values ); assertTrue( values_list.contains( 1 ) ); *************** *** 1446,1450 **** long[] values2 = map.values(); assertEquals( 2, values2.length ); ! TLongList keys_list2 = new TLongArrayList( null, values2 ); assertTrue( keys_list2.contains( 1 ) ); --- 1427,1431 ---- long[] values2 = map.values(); assertEquals( 2, values2.length ); ! TLongList keys_list2 = new TLongArrayList( values2 ); assertTrue( keys_list2.contains( 1 ) ); *************** *** 1492,1496 **** map.forEachKey( foreach ); TIntList built = foreach.getBuilt(); ! TIntList keys = new TIntArrayList( null, map.keys() ); assertEquals( keys, built ); --- 1473,1477 ---- map.forEachKey( foreach ); TIntList built = foreach.getBuilt(); ! TIntList keys = new TIntArrayList( map.keys() ); assertEquals( keys, built ); *************** *** 1517,1521 **** map.forEachKey( foreach_false ); built = foreach_false.getBuilt(); ! keys = new TIntArrayList( null, map.keys() ); assertEquals( 1, built.size() ); assertEquals( keys.get( 0 ), built.get( 0 ) ); --- 1498,1502 ---- map.forEachKey( foreach_false ); built = foreach_false.getBuilt(); ! keys = new TIntArrayList( map.keys() ); assertEquals( 1, built.size() ); assertEquals( keys.get( 0 ), built.get( 0 ) ); *************** *** 1547,1551 **** map.forEachValue( foreach ); TLongList built = foreach.getBuilt(); ! TLongList vals = new TLongArrayList( null, map.values() ); assertEquals( vals, built ); --- 1528,1532 ---- map.forEachValue( foreach ); TLongList built = foreach.getBuilt(); ! TLongList vals = new TLongArrayList( map.values() ); assertEquals( vals, built ); *************** *** 1572,1576 **** map.forEachValue( foreach_false ); built = foreach_false.getBuilt(); ! vals = new TLongArrayList( null, map.values() ); assertEquals( 1, built.size() ); assertEquals( vals.get( 0 ), built.get( 0 ) ); --- 1553,1557 ---- map.forEachValue( foreach_false ); built = foreach_false.getBuilt(); ! vals = new TLongArrayList( map.values() ); assertEquals( 1, built.size() ); assertEquals( vals.get( 0 ), built.get( 0 ) ); *************** *** 1977,1981 **** TIntLongMap unequal = new TIntLongHashMap(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < keys.length; i++ ) { unequal.put( keys[i], keys[i] ); --- 1958,1961 ---- *************** *** 1986,1990 **** int[] mismatched = {72, 49, 53, 1024, 999}; TIntLongMap mismatched_map = new TIntLongHashMap(); - //noinspection ForLoopReplaceableByForEach for ( int i = 0; i < mismatched.length; i++ ) { mismatched_map.put( mismatched[i], mismatched[i] * 37 ); --- 1966,1969 ---- |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:17
|
Update of /cvsroot/trove4j/trove/test/gnu/trove In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/test/gnu/trove Modified Files: Tag: TROVE_3_WORKING TArrayListTest.java TStackTest.java Log Message: Back out builder changes. Index: TArrayListTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/TArrayListTest.java,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -C2 -d -r1.4.2.3 -r1.4.2.4 *** TArrayListTest.java 27 Sep 2009 06:23:59 -0000 1.4.2.3 --- TArrayListTest.java 9 Oct 2009 02:46:07 -0000 1.4.2.4 *************** *** 21,34 **** package gnu.trove; import junit.framework.TestCase; ! import java.util.Arrays; import java.io.ByteArrayOutputStream; - import java.io.ObjectOutputStream; import java.io.ObjectInputStream; ! import java.io.ByteArrayInputStream; ! ! import gnu.trove.list.array.TIntArrayList; ! import gnu.trove.list.TIntList; --- 21,33 ---- package gnu.trove; + import gnu.trove.list.TIntList; + import gnu.trove.list.array.TIntArrayList; import junit.framework.TestCase; ! import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.util.Arrays; *************** *** 42,49 **** super.setUp(); ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( 15 ); ! builder.setNoEntryValue( Integer.MIN_VALUE ); ! list = new TIntArrayList( builder ); list.add( 1 ); list.add( 2 ); --- 41,45 ---- super.setUp(); ! list = new TIntArrayList( 15, Integer.MIN_VALUE ); list.add( 1 ); list.add( 2 ); Index: TStackTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/TStackTest.java,v retrieving revision 1.1.4.4 retrieving revision 1.1.4.5 diff -C2 -d -r1.1.4.4 -r1.1.4.5 *** TStackTest.java 27 Sep 2009 06:23:59 -0000 1.1.4.4 --- TStackTest.java 9 Oct 2009 02:46:07 -0000 1.1.4.5 *************** *** 57,61 **** assertEquals( 2, stack.size() ); ! TIntStack other = new TIntArrayStack(); other.push( 10 ); other.push( 20 ); --- 57,61 ---- assertEquals( 2, stack.size() ); ! TIntStack other = new TIntArrayStack( 20 ); other.push( 10 ); other.push( 20 ); *************** *** 101,107 **** public void testArrays() { int no_entry_value = Integer.MIN_VALUE; ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setNoEntryValue( no_entry_value ); ! TIntStack stack = new TIntArrayStack( builder ); assertEquals( no_entry_value, stack.getNoEntryValue() ); --- 101,105 ---- public void testArrays() { int no_entry_value = Integer.MIN_VALUE; ! TIntStack stack = new TIntArrayStack(10, no_entry_value); assertEquals( no_entry_value, stack.getNoEntryValue() ); *************** *** 179,185 **** assertEquals( 2, stack.size() ); ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( 20 ); ! TIntStack other = new TIntArrayStack( builder ); other.push( 10 ); other.push( 20 ); --- 177,181 ---- assertEquals( 2, stack.size() ); ! TIntStack other = new TIntArrayStack( 20 ); other.push( 10 ); other.push( 20 ); *************** *** 192,196 **** stack.equals( other ) ); ! TIntArrayList list = new TIntArrayList( builder, stack.toArray() ); assertFalse( "stack should not equal list: " + stack + ", " + list, stack.equals( list ) ); --- 188,192 ---- stack.equals( other ) ); ! TIntArrayList list = new TIntArrayList( stack.toArray() ); assertFalse( "stack should not equal list: " + stack + ", " + list, stack.equals( list ) ); *************** *** 206,212 **** assertEquals( 2, stack.size() ); ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( 20 ); ! TIntStack other = new TIntArrayStack( builder ); other.push( 10 ); other.push( 20 ); --- 202,206 ---- assertEquals( 2, stack.size() ); ! TIntStack other = new TIntArrayStack( 20 ); other.push( 10 ); other.push( 20 ); |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:17
|
Update of /cvsroot/trove4j/trove/test/gnu/trove/impl/hash In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/test/gnu/trove/impl/hash Modified Files: Tag: TROVE_3_WORKING THashTest.java Log Message: Back out builder changes. Index: THashTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/impl/hash/Attic/THashTest.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** THashTest.java 27 Sep 2009 06:23:58 -0000 1.1.2.6 --- THashTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.7 *************** *** 10,14 **** import gnu.trove.map.TIntObjectMap; import gnu.trove.map.TObjectIntMap; - import gnu.trove.Builder; import java.io.ByteArrayOutputStream; --- 10,13 ---- *************** *** 149,155 **** int cap = 20; ! Builder<Integer,Long> builder = ! new Builder<Integer, Long>( cap, 0.75f, null, null ); ! TIntLongMap cap_and_factor = new TIntLongHashMap( builder ); TPrimitiveHash cap_and_factor_hash = (TPrimitiveHash) cap_and_factor; assertTrue( "capacity not sufficient: " + cap + ", " + cap_and_factor_hash.capacity(), --- 148,152 ---- int cap = 20; ! TIntLongMap cap_and_factor = new TIntLongHashMap( cap, 0.75f ); TPrimitiveHash cap_and_factor_hash = (TPrimitiveHash) cap_and_factor; assertTrue( "capacity not sufficient: " + cap + ", " + cap_and_factor_hash.capacity(), *************** *** 157,162 **** assertEquals( 0.75f, cap_and_factor_hash._loadFactor ); ! builder = new Builder<Integer, Long>( cap, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); ! TIntLongMap fully_specified = new TIntLongHashMap( builder ); TPrimitiveHash fully_specified_hash = (TPrimitiveHash) fully_specified; assertTrue( "capacity not sufficient: " + cap + ", " + fully_specified_hash.capacity(), --- 154,159 ---- assertEquals( 0.75f, cap_and_factor_hash._loadFactor ); ! TIntLongMap fully_specified = ! new TIntLongHashMap( cap, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); TPrimitiveHash fully_specified_hash = (TPrimitiveHash) fully_specified; assertTrue( "capacity not sufficient: " + cap + ", " + fully_specified_hash.capacity(), *************** *** 173,180 **** long[] vals = new long[keys.length]; - Builder<Integer, Long> builder = - new Builder<Integer, Long>( 200, 0.75f, Integer.MIN_VALUE, Long.MIN_VALUE ); TIntLongMap original_map = ! new TIntLongHashMap( builder ); for ( int i = 0; i < keys.length; i++ ) { vals[i] = keys[i] * 2; --- 170,175 ---- long[] vals = new long[keys.length]; TIntLongMap original_map = ! new TIntLongHashMap( 200, 0.75f, Integer.MIN_VALUE, Long.MIN_VALUE ); for ( int i = 0; i < keys.length; i++ ) { vals[i] = keys[i] * 2; *************** *** 206,214 **** String[] vals = new String[keys.length]; ! Builder<Integer,String> builder = new Builder<Integer, String>(); ! builder.setInitialCapacity( 200 ); ! builder.setLoadFactor( 0.75f ); ! builder.setNoEntryKey( Integer.MIN_VALUE ); ! TIntObjectMap<String> original_map = new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < keys.length; i++ ) { vals[i] = String.valueOf( keys[i] * 2 ); --- 201,206 ---- String[] vals = new String[keys.length]; ! TIntObjectMap<String> original_map = ! new TIntObjectHashMap<String>( 200, 0.75f, Integer.MIN_VALUE ); for ( int i = 0; i < keys.length; i++ ) { vals[i] = String.valueOf( keys[i] * 2 ); |
From: Rob E. <ro...@us...> - 2009-10-09 02:46:17
|
Update of /cvsroot/trove4j/trove/templates/gnu/trove/stack/array In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/templates/gnu/trove/stack/array Modified Files: Tag: TROVE_3_WORKING _E_ArrayStack.template Log Message: Back out builder changes. Index: _E_ArrayStack.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/stack/array/Attic/_E_ArrayStack.template,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** _E_ArrayStack.template 27 Sep 2009 06:23:59 -0000 1.1.2.10 --- _E_ArrayStack.template 9 Oct 2009 02:46:07 -0000 1.1.2.11 *************** *** 24,28 **** import gnu.trove.stack.T#E#Stack; import gnu.trove.list.array.T#E#ArrayList; ! import gnu.trove.Builder; import java.io.Externalizable; --- 24,28 ---- import gnu.trove.stack.T#E#Stack; import gnu.trove.list.array.T#E#ArrayList; ! import gnu.trove.impl.*; import java.io.Externalizable; *************** *** 45,50 **** protected T#E#ArrayList _list; ! /** a default builder object to use when none is specified. */ ! public static final Builder<?, #ET#> DEFAULT_BUILDER = new Builder<Object, #ET#>(); --- 45,49 ---- protected T#E#ArrayList _list; ! public static final int DEFAULT_CAPACITY = Constants.DEFAULT_CAPACITY; *************** *** 54,58 **** */ public T#E#ArrayStack() { ! this( DEFAULT_BUILDER ); } --- 53,57 ---- */ public T#E#ArrayStack() { ! this( DEFAULT_CAPACITY ); } *************** *** 62,69 **** * specified capacity. * ! * @param builder describes the configurable parameters. */ ! public T#E#ArrayStack( Builder<?, #ET#> builder ) { ! _list = new T#E#ArrayList( builder ); } --- 61,80 ---- * specified capacity. * ! * @param capacity the initial depth of the stack */ ! public T#E#ArrayStack( int capacity ) { ! _list = new T#E#ArrayList( capacity ); ! } ! ! ! /** ! * Creates a new <code>T#E#ArrayStack</code> instance with the ! * specified capacity. ! * ! * @param capacity the initial depth of the stack ! * @param no_entry_value value that represents null ! */ ! public T#E#ArrayStack( int capacity, #e# no_entry_value ) { ! _list = new T#E#ArrayList( capacity, no_entry_value ); } |
Update of /cvsroot/trove4j/trove/test/gnu/trove/decorator In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7501/trove/test/gnu/trove/decorator Modified Files: Tag: TROVE_3_WORKING TPrimitivePrimitiveMapDecoratorTest.java TPrimitiveSetDecoratorTest.java TPrimitiveObjectMapDecoratorTest.java Log Message: Back out builder changes. Index: TPrimitivePrimitiveMapDecoratorTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/decorator/Attic/TPrimitivePrimitiveMapDecoratorTest.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TPrimitivePrimitiveMapDecoratorTest.java 27 Sep 2009 06:23:58 -0000 1.1.2.2 --- TPrimitivePrimitiveMapDecoratorTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.3 *************** *** 22,26 **** import gnu.trove.TDecorators; - import gnu.trove.Builder; import gnu.trove.set.TIntSet; import gnu.trove.set.hash.TIntHashSet; --- 22,25 ---- *************** *** 70,77 **** assertEquals( keys.length, map.size() ); ! Builder<Integer,Long> builder = new Builder<Integer, Long>(); ! builder.setInitialCapacity( 20 ); ! ! TIntLongMap raw_capacity = new TIntLongHashMap( builder ); for ( int i = 0; i < keys.length; i++ ) { raw_capacity.put( keys[i], vals[i] ); --- 69,73 ---- assertEquals( keys.length, map.size() ); ! TIntLongMap raw_capacity = new TIntLongHashMap( 20 ); for ( int i = 0; i < keys.length; i++ ) { raw_capacity.put( keys[i], vals[i] ); *************** *** 80,85 **** assertEquals( keys.length, capacity.size() ); ! builder.setLoadFactor( 0.75f ); ! TIntLongMap raw_cap_and_factor = new TIntLongHashMap( builder ); for ( int i = 0; i < keys.length; i++ ) { raw_cap_and_factor.put( keys[i], vals[i] ); --- 76,80 ---- assertEquals( keys.length, capacity.size() ); ! TIntLongMap raw_cap_and_factor = new TIntLongHashMap( 20, 0.75f ); for ( int i = 0; i < keys.length; i++ ) { raw_cap_and_factor.put( keys[i], vals[i] ); *************** *** 88,94 **** assertEquals( keys.length, cap_and_factor.size() ); ! builder.setInitialCapacity( 20 ).setLoadFactor( 0.5f ); ! builder.setNoEntryKey( Integer.MIN_VALUE ).setNoEntryValue( Long.MIN_VALUE ); ! TIntLongMap raw_fully_specified = new TIntLongHashMap( builder ); for ( int i = 0; i < keys.length; i++ ) { raw_fully_specified.put( keys[i], vals[i] ); --- 83,88 ---- assertEquals( keys.length, cap_and_factor.size() ); ! TIntLongMap raw_fully_specified = ! new TIntLongHashMap( 20, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); for ( int i = 0; i < keys.length; i++ ) { raw_fully_specified.put( keys[i], vals[i] ); *************** *** 101,105 **** assertEquals( keys.length, fully_specified.size() ); ! TIntLongMap raw_arrays = new TIntLongHashMap( null, keys, vals ); Map<Integer,Long> arrays = TDecorators.wrap( raw_arrays ); assertEquals( keys.length, arrays.size() ); --- 95,99 ---- assertEquals( keys.length, fully_specified.size() ); ! TIntLongMap raw_arrays = new TIntLongHashMap( keys, vals ); Map<Integer,Long> arrays = TDecorators.wrap( raw_arrays ); assertEquals( keys.length, arrays.size() ); *************** *** 672,678 **** int element_count = 20; ! Builder<Integer,Long> builder = ! new Builder<Integer, Long>( element_count, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); ! raw_map = new TIntLongHashMap( builder ); map = TDecorators.wrap( raw_map ); for ( int i = 0; i < element_count; i++ ) { --- 666,670 ---- int element_count = 20; ! raw_map = new TIntLongHashMap( element_count, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); map = TDecorators.wrap( raw_map ); for ( int i = 0; i < element_count; i++ ) { *************** *** 975,981 **** int element_count = 20; ! Builder<Integer,Long> builder = ! new Builder<Integer, Long>( element_count, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); ! raw_map = new TIntLongHashMap( builder ); map = TDecorators.wrap( raw_map ); for ( int i = 0; i < element_count; i++ ) { --- 967,971 ---- int element_count = 20; ! raw_map = new TIntLongHashMap( 20, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); map = TDecorators.wrap( raw_map ); for ( int i = 0; i < element_count; i++ ) { *************** *** 1000,1007 **** Long[] vals = new Long[element_count]; - Builder<Integer,Long> builder = - new Builder<Integer, Long>( 20, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); TIntLongMap raw_map = ! new TIntLongHashMap( builder ); Map<Integer,Long> map = TDecorators.wrap( raw_map ); --- 990,995 ---- Long[] vals = new Long[element_count]; TIntLongMap raw_map = ! new TIntLongHashMap( element_count, 0.5f, Integer.MIN_VALUE, Long.MIN_VALUE ); Map<Integer,Long> map = TDecorators.wrap( raw_map ); Index: TPrimitiveSetDecoratorTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/decorator/Attic/TPrimitiveSetDecoratorTest.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TPrimitiveSetDecoratorTest.java 27 Sep 2009 06:23:58 -0000 1.1.2.2 --- TPrimitiveSetDecoratorTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.3 *************** *** 25,29 **** import gnu.trove.set.hash.TIntHashSet; import gnu.trove.TDecorators; - import gnu.trove.Builder; import java.util.*; --- 25,28 ---- *************** *** 69,81 **** assertTrue( "set not a copy: " + set + ", " + copy, set.equals( copy ) ); ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setInitialCapacity( 20 ); ! TIntSet raw_another = new TIntHashSet( builder ); Set<Integer> another = TDecorators.wrap( raw_another ); another.addAll( Arrays.asList( ints ) ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); ! builder.setLoadFactor( 1.0f ); ! raw_another = new TIntHashSet( builder ); another = TDecorators.wrap( raw_another ); another.addAll( Arrays.asList( ints ) ); --- 68,77 ---- assertTrue( "set not a copy: " + set + ", " + copy, set.equals( copy ) ); ! TIntSet raw_another = new TIntHashSet( 20 ); Set<Integer> another = TDecorators.wrap( raw_another ); another.addAll( Arrays.asList( ints ) ); assertTrue( "set not equal: " + set + ", " + copy, set.equals( another ) ); ! raw_another = new TIntHashSet( 2, 1.0f ); another = TDecorators.wrap( raw_another ); another.addAll( Arrays.asList( ints ) ); *************** *** 402,408 **** public void testToArrayWithParams() { int no_entry_value = Integer.MIN_VALUE; ! Builder<?,Integer> builder = new Builder<Object, Integer>(); ! builder.setNoEntryValue( no_entry_value ); ! TIntSet raw_set = new TIntHashSet( builder ); Set<Integer> set = TDecorators.wrap( raw_set ); --- 398,402 ---- public void testToArrayWithParams() { int no_entry_value = Integer.MIN_VALUE; ! TIntSet raw_set = new TIntHashSet( 10, 0.5f, no_entry_value ); Set<Integer> set = TDecorators.wrap( raw_set ); *************** *** 430,434 **** public void testRehashing() throws Exception { int size = 10000; ! TIntSet set = new TIntHashSet(); for ( int i = 0; i < size; i++ ) { set.add( i ); --- 424,428 ---- public void testRehashing() throws Exception { int size = 10000; ! TIntSet set = new TIntHashSet( 10 ); for ( int i = 0; i < size; i++ ) { set.add( i ); Index: TPrimitiveObjectMapDecoratorTest.java =================================================================== RCS file: /cvsroot/trove4j/trove/test/gnu/trove/decorator/Attic/TPrimitiveObjectMapDecoratorTest.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TPrimitiveObjectMapDecoratorTest.java 27 Sep 2009 06:23:58 -0000 1.1.2.2 --- TPrimitiveObjectMapDecoratorTest.java 9 Oct 2009 02:46:07 -0000 1.1.2.3 *************** *** 24,28 **** import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.TDecorators; - import gnu.trove.Builder; import gnu.trove.set.TIntSet; import gnu.trove.set.hash.TIntHashSet; --- 24,27 ---- *************** *** 65,71 **** Map<Integer,String> map = TDecorators.wrap( raw_map ); ! Builder<Integer,String> builder = new Builder<Integer,String>(); ! builder.setInitialCapacity( element_count ); ! TIntObjectMap<String> raw_capacity = new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { raw_capacity.put( keys[i], vals[i] ); --- 64,69 ---- Map<Integer,String> map = TDecorators.wrap( raw_map ); ! TIntObjectMap<String> raw_capacity = ! new TIntObjectHashMap<String>( 20 ); for ( int i = 0; i < element_count; i++ ) { raw_capacity.put( keys[i], vals[i] ); *************** *** 74,79 **** assertEquals( map, capacity ); ! builder.setLoadFactor( 0.75f ); ! TIntObjectMap<String> raw_cap_and_factor = new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { raw_cap_and_factor.put( keys[i], vals[i] ); --- 72,77 ---- assertEquals( map, capacity ); ! TIntObjectMap<String> raw_cap_and_factor = ! new TIntObjectHashMap<String>( 20, 0.75f ); for ( int i = 0; i < element_count; i++ ) { raw_cap_and_factor.put( keys[i], vals[i] ); *************** *** 82,87 **** assertEquals( map, cap_and_factor ); ! builder.setNoEntryKey( Integer.MIN_VALUE ); ! TIntObjectMap<String> raw_fully_specified = new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { raw_fully_specified.put( keys[i], vals[i] ); --- 80,85 ---- assertEquals( map, cap_and_factor ); ! TIntObjectMap<String> raw_fully_specified = ! new TIntObjectHashMap<String>( 20, 0.75f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { raw_fully_specified.put( keys[i], vals[i] ); *************** *** 871,878 **** String[] vals = new String[element_count]; ! Builder<Integer,String> builder = new Builder<Integer,String>(); ! builder.setInitialCapacity( element_count ); ! builder.setNoEntryKey( Integer.MIN_VALUE ); ! TIntObjectMap<String> raw_map = new TIntObjectHashMap<String>( builder ); Map<Integer,String> map = TDecorators.wrap( raw_map ); --- 869,874 ---- String[] vals = new String[element_count]; ! TIntObjectMap<String> raw_map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); Map<Integer,String> map = TDecorators.wrap( raw_map ); *************** *** 955,962 **** String[] vals = new String[element_count]; ! Builder<Integer,String> builder = new Builder<Integer,String>(); ! builder.setInitialCapacity( element_count ); ! builder.setNoEntryKey( Integer.MIN_VALUE ); ! TIntObjectMap<String> raw_map = new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; --- 951,956 ---- String[] vals = new String[element_count]; ! TIntObjectMap<String> raw_map = ! new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { keys[i] = i + 1; *************** *** 967,972 **** assertEquals( element_count, map.size() ); ! builder.setLoadFactor( 0.75f ); ! TIntObjectHashMap<String> raw_fully_specified = new TIntObjectHashMap<String>( builder ); for ( int i = 0; i < element_count; i++ ) { raw_fully_specified.put( keys[i], vals[i] ); --- 961,966 ---- assertEquals( element_count, map.size() ); ! TIntObjectHashMap<String> raw_fully_specified = ! new TIntObjectHashMap<String>( 20, 0.75f, Integer.MIN_VALUE ); for ( int i = 0; i < element_count; i++ ) { raw_fully_specified.put( keys[i], vals[i] ); |