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...> - 2006-11-10 23:28:27
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11753/trove Modified Files: AUTHORS ChangeLog LICENSE.txt build.xml Log Message: Support for generics, auto-compaction and other minor tweaks. Generated classes are now generated from Generate java class and templates. New build.xml. Index: AUTHORS =================================================================== RCS file: /cvsroot/trove4j/trove/AUTHORS,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AUTHORS 24 Sep 2002 02:26:14 -0000 1.2 --- AUTHORS 10 Nov 2006 23:27:54 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- Eric D. Friedman <er...@us...> + Rob Eden <ro...@us...> Please do NOT email bug reports or feature requests. Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ChangeLog 27 Dec 2005 21:46:06 -0000 1.35 --- ChangeLog 10 Nov 2006 23:27:54 -0000 1.36 *************** *** 1,14 **** v 1.1b5 Bugs fixed: [ 1391359 ] Duplicate iteration in THashSet.toArray(Object[]) ! removed the duplication [ 1382196 ] THashMap.entrySet().retainAll() ! implemented missing methods on elements of entrySet, refactored retainAll ! to use retainEntries, which saves a bunch of allocations [ 1378868 ] CVS has junit.jar checked in as ASCII ! flipped on '-kb' for this file [ 1193416 ] TByteArrayList throws ArrayIndexOutOfBoundsException wrongly ! fixed off by one error v 1.1b4 --- 1,21 ---- + v 2.0b1 + + Bugs Fixed: + [ 1518795 ] NullPointerException in TLinkedList's removeFirst()/Last() + [ 1277703 ] make T**HashMap serializable + + v 1.1b5 Bugs fixed: [ 1391359 ] Duplicate iteration in THashSet.toArray(Object[]) ! removed the duplication [ 1382196 ] THashMap.entrySet().retainAll() ! implemented missing methods on elements of entrySet, refactored retainAll ! to use retainEntries, which saves a bunch of allocations [ 1378868 ] CVS has junit.jar checked in as ASCII ! flipped on '-kb' for this file [ 1193416 ] TByteArrayList throws ArrayIndexOutOfBoundsException wrongly ! fixed off by one error v 1.1b4 *************** *** 33,37 **** Fixed 937977 -- primitive array lists were not doing a true deep clone of the underlying array. This is fixed ! v 1.1b3 --- 40,44 ---- Fixed 937977 -- primitive array lists were not doing a true deep clone of the underlying array. This is fixed ! v 1.1b3 *************** *** 148,152 **** } }); ! v 0.1.4 --- 155,159 ---- } }); ! v 0.1.4 Index: LICENSE.txt =================================================================== RCS file: /cvsroot/trove4j/trove/LICENSE.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LICENSE.txt 10 Nov 2001 22:30:27 -0000 1.1 --- LICENSE.txt 10 Nov 2006 23:27:54 -0000 1.2 *************** *** 1,4 **** ! GNU LESSER GENERAL PUBLIC LICENSE ! Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. --- 1,4 ---- ! GNU LESSER GENERAL PUBLIC LICENSE ! Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. *************** *** 11,15 **** the version number 2.1.] ! Preamble The licenses for most software are designed to take away your --- 11,15 ---- the version number 2.1.] ! Preamble The licenses for most software are designed to take away your *************** *** 113,117 **** be combined with the library in order to run. ! GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION --- 113,117 ---- be combined with the library in order to run. ! GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION *************** *** 433,437 **** and reuse of software generally. ! NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO --- 433,437 ---- and reuse of software generally. ! NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO *************** *** 456,460 **** DAMAGES. ! END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries --- 456,460 ---- DAMAGES. ! END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** build.xml 27 Dec 2005 19:14:28 -0000 1.35 --- build.xml 10 Nov 2006 23:27:54 -0000 1.36 *************** *** 1,28 **** ! <!-- $Id$ --> ! ! <project default="jar" basedir="."> ! ! <!-- =================================================================== --> ! <!-- Initialization target --> ! <!-- =================================================================== --> ! <target name="init"> ! <tstamp/> <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="1.1b5"/> ! <property name="year" value="2001-2005"/> ! ! <echo message="----------- ${Name} ${version} [${year}] ------------"/> ! <property name="debug" value="on"/> <property name="optimize" value="off"/> <property name="deprecation" value="on"/> ! <property name="lib.dir" value="./lib"/> ! <property name="src.dir" value="./src"/> ! <property name="packages" value="gnu.trove.*"/> ! ! <property name="output.dir" value="./output"/> <property name="output.dest" value="${output.dir}/classes"/> <property name="output.lib" value="${output.dir}/lib"/> <property name="output.tests" value="${output.dir}/tests"/> --- 1,26 ---- ! <project name="Trove4j" default="jar" basedir="."> ! <description> ! Builds the Trove4j library ! </description> ! <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="2.0b1"/> ! <property name="year" value="2001-2006"/> ! <property name="debug" value="on"/> <property name="optimize" value="off"/> <property name="deprecation" value="on"/> ! ! <property name="jar_name" value="trove.jar"/> ! ! <property name="generator_subtree" value="gnu/trove/generate"/> ! ! <property name="output.dir" value="output"/> <property name="output.dest" value="${output.dir}/classes"/> + <property name="output.tests" value="${output.dir}/test_classes"/> + <property name="output.generator_classes" value="${output.dir}/generator_classes"/> + <property name="output.generated" value="${output.dir}/gen_src"/> <property name="output.lib" value="${output.dir}/lib"/> <property name="output.tests" value="${output.dir}/tests"/> *************** *** 32,205 **** <property name="dist.root" value="${output.dir}/dist"/> <property name="dist.dir" value="${dist.root}/${name}-${version}"/> ! <property name="junit.jar" value="${lib.dir}/junit.jar" /> ! ! <filter token="year" value="${year}"/> ! <filter token="version" value="${version}"/> ! <filter token="date" value="${TODAY}"/> ! <filter token="log" value="true"/> ! <filter token="verbose" value="true"/> ! ! <path id="build.classpath"> ! </path> ! ! </target> ! ! <!-- =================================================================== --> ! <!-- Prepares the output directory --> ! <!-- =================================================================== --> ! <target name="prepare" depends="init"> ! <mkdir dir="${output.dir}"/> ! <mkdir dir="${output.dest}"/> ! <mkdir dir="${output.lib}"/> ! </target> ! ! <!-- =================================================================== --> ! <!-- Compiles the source directory --> ! <!-- =================================================================== --> ! <target name="compile" ! depends="prepare" ! description="compiles the source code"> ! <javac srcdir="${src.dir}" ! destdir="${output.dest}" ! debug="${debug}" ! classpathref="build.classpath" ! optimize="${optimize}"> ! <include name="**/*.java" /> ! <exclude name="**/*Tests.java" /> ! </javac> ! </target> ! ! <target name="jar" ! depends="compile" ! description="creates the jar file"> ! <jar jarfile="${output.lib}/${name}.jar" ! excludes="**/benchmark/" ! basedir="${output.dest}"> ! <manifest> ! <attribute name="Built-By" value="${user.name}"/> ! <attribute name="Implementation-Title" value="${Name}"/> ! <attribute name="Implementation-Version" value="${version}"/> ! <attribute name="Implementation-URL" value="http://trove4j.sourceforge.net/"/> ! <attribute name="Sealed" value="false"/> ! </manifest> ! </jar> ! </target> ! ! <target name="compile_tests" ! depends="jar,junit" ! if="junit.present"> ! <mkdir dir="${output.tests}"/> ! <javac srcdir="${src.dir}" ! destdir="${output.tests}" ! debug="${debug}" ! optimize="${optimize}"> ! <classpath> ! <pathelement location="${output.lib}/${name}.jar" /> ! <path refid="build.classpath" /> ! <path refid="junit.classpath" /> ! </classpath> ! <include name="**/*Tests.java" /> ! </javac> ! </target> ! ! <target name="dist" depends="jar,javadoc"> ! <mkdir dir="${dist.root}" /> ! <mkdir dir="${dist.dir}" /> ! <mkdir dir="${dist.dir}/src" /> ! <copy todir="${dist.dir}"> ! <fileset dir="${output.dir}" includes="lib/**,javadocs/**" /> ! <fileset dir="${basedir}" includes="AUTHORS,LICENSE.txt,README*.txt,ChangeLog" /> ! </copy> ! <copy todir="${dist.dir}/src"> ! <fileset dir="${src.dir}" ! excludes="**/*Tests.java,**/Benchmark.java" ! includes="**/*.java" /> ! </copy> ! </target> ! ! <!-- =================================================================== --> ! <!-- Creates the release file --> ! <!-- =================================================================== --> ! <target name="release" depends="dist"> ! <tar tarfile="${name}-${version}.tar" ! basedir="${dist.root}"/> ! <gzip src="${name}-${version}.tar" ! zipfile="${output.dir}/${name}-${version}.tar.gz" /> ! <delete file="${name}-${version}.tar" /> ! </target> ! ! ! <!-- =================================================================== --> ! <!-- Creates the API documentation --> ! <!-- =================================================================== --> ! <target name="javadoc" depends="init"> ! <mkdir dir="${output.javadocs}"/> ! <mkdir dir="${output.tmp}"/> ! <copy todir="${output.tmp}"> ! <fileset dir="${src.dir}" ! includes="**/package.html,**/*.java,**/*.pl" ! excludes="**/*Tests.java,**/benchmark/**.java" /> ! </copy> ! <javadoc packagenames="${packages}" ! sourcepath="${output.tmp}" ! destdir="${output.javadocs}" ! author="true" ! version="true" ! use="true" ! splitindex="true" ! noindex="false" ! windowtitle="${Name} API v${version}" ! doctitle="${Name} API v${version}" ! header="<a href="http://trove4j.sourceforge.net/">GNU Trove</a>" ! bottom="GNU Trove is copyright © ${year} Eric D. Friedman. All Rights Reserved." ! /> ! <delete dir="${output.tmp}" /> ! </target> ! ! <target name="junit" depends="init"> ! <path id="junit.classpath" location="${junit.jar}" /> ! ! <available classname="junit.framework.TestCase" ! classpathref="junit.classpath" ! property="junit.present" /> ! </target> ! ! <target name="test" ! depends="junit,jar,compile_tests" ! if="junit.present"> ! <junit haltonfailure="true"> ! <classpath> ! <path refid="build.classpath" /> ! <pathelement location="${output.lib}/${name}.jar" /> ! <pathelement location="${output.tests}" /> ! </classpath> ! <formatter type="plain" ! usefile="false" /> ! <batchtest fork="no" ! todir="${output.dir}"> ! <fileset dir="${src.dir}"> ! <include name="**/*Tests*" /> ! </fileset> ! </batchtest> ! </junit> ! </target> ! ! ! <!-- =================================================================== --> ! <!-- Clean targets --> ! <!-- =================================================================== --> ! <target name="clean" ! depends="init" ! description="cleans up the directory"> ! <delete dir="${output.dir}"/> ! </target> ! ! <target name="cleandocs" depends="init"> ! <delete dir="${output.javadocs}"/> ! </target> ! ! ! </project> ! ! <!-- End of file --> --- 30,247 ---- <property name="dist.root" value="${output.dir}/dist"/> <property name="dist.dir" value="${dist.root}/${name}-${version}"/> + + <property name="src" value="src"/> + <property name="test_src" value="test"/> + <property name="lib" value="lib"/> + + + <!-- =============================================================== --> + <!-- The main target for building a release. This will perform a --> + <!-- "clean" followed by a "dist". --> + <!-- =============================================================== --> + <target name="release"> + <antcall target="clean"/> + <antcall target="dist"/> + <antcall target="test"/> + + <tar tarfile="${name}-${version}.tar" basedir="${dist.root}"/> + <gzip src="${name}-${version}.tar" + zipfile="${dist.root}/${name}-${version}.tar.gz" /> + <delete file="${name}-${version}.tar" /> + </target> + + + <!-- =============================================================== --> + <!-- Clean all output --> + <!-- =============================================================== --> + <target name="clean"> + <delete dir="${output.dir}"/> + </target> + + + <!-- =============================================================== --> + <!-- Generate classes based on templates. --> + <!-- =============================================================== --> + <target name="generate" depends="-build_generator"> + <java classname="gnu.trove.generate.Generate"> + <arg value="${output.generated}/gnu/trove/"/> + <classpath> + <pathelement path="${output.generator_classes}"/> + </classpath> + </java> + </target> + + + <!-- =============================================================== --> + <!-- Compile the source directory. --> + <!-- =============================================================== --> + <target name="compile" depends="generate"> + <javac destdir="${output.dest}" + classpath="${lib}/junit.jar" + debug="on"> + <src path="${src}"/> + <src path="${output.generated}"/> + </javac> + </target> + + + <!-- =============================================================== --> + <!-- Build the main jar. --> + <!-- =============================================================== --> + <target name="jar" depends="compile"> + <jar destfile="${output.lib}/${name}.jar"> + <fileset dir="${output.dest}"> + <exclude name="gnu/trove/benchmark/**"/> + <exclude name="gnu/trove/test/**"/> + <exclude name="gnu/trove/generate/**"/> + </fileset> + <manifest> + <attribute name="Built-By" value="${user.name}"/> + <attribute name="Implementation-Title" value="${Name}"/> + <attribute name="Implementation-Version" value="${version}"/> + <attribute name="Implementation-URL" value="http://trove4j.sourceforge.net/"/> + <attribute name="Sealed" value="false"/> + </manifest> + </jar> + </target> + + + <!-- =============================================================== --> + <!-- Places files to prepare for a release. --> + <!-- This build javadocs and copies misc. files. --> + <!-- =============================================================== --> + <target name="dist" depends="jar,javadoc"> + <mkdir dir="${dist.root}"/> + <mkdir dir="${dist.dir}"/> + <mkdir dir="${dist.dir}/src"/> + + <!-- Copy source --> + <copy todir="${dist.dir}/src"> + <fileset dir="${src}"/> + </copy> + <copy todir="${dist.dir}/test"> + <fileset dir="${test_src}"/> + </copy> + + <!-- Copy javadocs & libs --> + <copy todir="${dist.dir}"> + <fileset dir="${output.dir}" includes="lib/**,javadocs/**" /> + </copy> + <copy todir="${dist.dir}/lib" file="${lib}/junit.jar"/> + + <!-- Misc. Files --> + <copy todir="${dist.dir}" file="AUTHORS"/> + <copy todir="${dist.dir}" file="ChangeLog"/> + <copy todir="${dist.dir}" file="LICENSE.txt"/> + <copy todir="${dist.dir}" file="README-license.txt"/> + <copy todir="${dist.dir}" file="README.txt"/> + <copy todir="${dist.dir}" file="build.xml"/> + </target> + + + <!-- =============================================================== --> + <!-- Create the javadocs. --> + <!-- =============================================================== --> + <target name="javadoc" depends="compile"> + <mkdir dir="${output.javadocs}"/> + + <copy file="${src}/gnu/trove/decorator/package.html" + tofile="${output.generated}/gnu/trove/decorator/package.html"/> + + <javadoc destdir="${output.javadocs}" + packagenames="gnu.trove.*" + author="true" + version="true" + use="true" + splitindex="true" + noindex="false" + windowtitle="${Name} API v${version}" + doctitle="${Name} API v${version}" + header="<a href="http://trove4j.sourceforge.net/">GNU Trove</a>" + bottom="GNU Trove is copyright © ${year} Eric D. Friedman. All Rights Reserved."> + <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> + + + <!-- =============================================================== --> + <!-- 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="on"> + <src path="${test_src}"/> + <classpath> + <pathelement location="${lib}/junit.jar"/> + <pathelement location="${output.dest}"/> + </classpath> + </javac> + + <!-- Verify that JUnit is available on the classpath --> + <available classname="junit.framework.TestCase" property="junit.present"/> + <fail unless="junit.present" message="To run this task, install junit.jar and optional.jar into ${ant.home}/lib/ JUnit is available free at http://www.junit.org"/> + <!-- Execute JUnit tests --> + <junit printsummary="true" showoutput="false" fork="on" + errorProperty="test.failed" failureProperty="test.failed"> + <assertions> + <enable/> + </assertions> + <classpath path="${output.tests}:${output.dest}:${lib}/junit.jar"/> + <formatter type="brief" usefile="false"/> + <batchtest fork="no" todir="${output.dir}"> + <fileset dir="${output.tests}/" includes="**/**Test.class"/> + </batchtest> + </junit> + <fail message="Tests failed. Check test output." if="test.failed"/> + </target> + + + <!-- =============================================================== --> + <!-- Build generator classes. --> + <!-- =============================================================== --> + <target name="-build_generator" depends="-init"> + <javac srcdir="${src}/${generator_subtree}" + destdir="${output.generator_classes}" + defaultexcludes="yes" + debug="on" + source="1.5"/> + + <copy todir="${output.generator_classes}"> + <fileset dir="${src}"> + <include name="${generator_subtree}/*.template"/> + </fileset> + </copy> + </target> + + <!-- =================================================================== --> + <!-- Initialization target --> + <!-- =================================================================== --> + <target name="-init"> + <tstamp/> + + <mkdir dir="${output.dir}"/> + <mkdir dir="${output.generator_classes}"/> + <mkdir dir="${output.dest}"/> + <mkdir dir="${output.tests}"/> + <mkdir dir="${output.generated}"/> + <mkdir dir="${output.generated}/gnu"/> + <mkdir dir="${output.generated}/gnu/trove"/> + <mkdir dir="${output.lib}"/> + <mkdir dir="${dist.root}"/> ! <echo message="----------- ${Name} ${version} [${year}] ------------"/> ! </target> ! </project> \ No newline at end of file |
From: Eric F. <er...@us...> - 2005-12-27 21:50:29
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15868 Modified Files: README-license.txt Log Message: dual license stuff Index: README-license.txt =================================================================== RCS file: /cvsroot/trove4j/trove/README-license.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README-license.txt 10 Nov 2001 23:05:59 -0000 1.1 --- README-license.txt 27 Dec 2005 21:50:20 -0000 1.2 *************** *** 2,5 **** --- 2,8 ---- which is included with the distribution in a file called LICENSE.txt. + Other license arrangements are possible, for a fee: contact + er...@us... for terms/pricing. + The PrimeFinder and HashFunctions classes in Trove are subject to the following license restrictions: |
From: Eric F. <er...@us...> - 2005-12-27 21:46:20
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15049 Modified Files: ChangeLog Log Message: fixed off by one bug in array list bulk set operation Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ChangeLog 27 Dec 2005 21:32:04 -0000 1.34 --- ChangeLog 27 Dec 2005 21:46:06 -0000 1.35 *************** *** 9,12 **** --- 9,14 ---- [ 1378868 ] CVS has junit.jar checked in as ASCII flipped on '-kb' for this file + [ 1193416 ] TByteArrayList throws ArrayIndexOutOfBoundsException wrongly + fixed off by one error v 1.1b4 |
From: Eric F. <er...@us...> - 2005-12-27 21:46:20
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15049/src/gnu/trove Modified Files: TByteArrayList.java TDoubleArrayList.java TFloatArrayList.java TIntArrayList.java TIntArrayListTests.java TLongArrayList.java TShortArrayList.java gen_primitive_list.pl Log Message: fixed off by one bug in array list bulk set operation Index: TByteArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteArrayList.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TByteArrayList.java 26 Mar 2005 18:04:42 -0000 1.3 --- TByteArrayList.java 27 Dec 2005 21:46:06 -0000 1.4 *************** *** 297,301 **** */ public void set(int offset, byte[] values, int valOffset, int length) { ! if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } --- 297,301 ---- */ public void set(int offset, byte[] values, int valOffset, int length) { ! if (offset < 0 || offset + length > _pos) { throw new ArrayIndexOutOfBoundsException(offset); } Index: TDoubleArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleArrayList.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TDoubleArrayList.java 26 Mar 2005 18:04:42 -0000 1.18 --- TDoubleArrayList.java 27 Dec 2005 21:46:06 -0000 1.19 *************** *** 297,301 **** */ public void set(int offset, double[] values, int valOffset, int length) { ! if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } --- 297,301 ---- */ public void set(int offset, double[] values, int valOffset, int length) { ! if (offset < 0 || offset + length > _pos) { throw new ArrayIndexOutOfBoundsException(offset); } Index: TFloatArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatArrayList.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TFloatArrayList.java 26 Mar 2005 18:04:42 -0000 1.18 --- TFloatArrayList.java 27 Dec 2005 21:46:06 -0000 1.19 *************** *** 297,301 **** */ public void set(int offset, float[] values, int valOffset, int length) { ! if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } --- 297,301 ---- */ public void set(int offset, float[] values, int valOffset, int length) { ! if (offset < 0 || offset + length > _pos) { throw new ArrayIndexOutOfBoundsException(offset); } Index: TIntArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntArrayList.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TIntArrayList.java 9 Nov 2003 09:22:22 -0000 1.13 --- TIntArrayList.java 27 Dec 2005 21:46:06 -0000 1.14 *************** *** 297,301 **** */ public void set(int offset, int[] values, int valOffset, int length) { ! if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } --- 297,301 ---- */ public void set(int offset, int[] values, int valOffset, int length) { ! if (offset < 0 || offset + length > _pos) { throw new ArrayIndexOutOfBoundsException(offset); } Index: TIntArrayListTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntArrayListTests.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TIntArrayListTests.java 9 Nov 2003 09:35:09 -0000 1.11 --- TIntArrayListTests.java 27 Dec 2005 21:46:06 -0000 1.12 *************** *** 438,440 **** --- 438,452 ---- assertEquals("{-5}", list3.toString()); } + + public void testSetFromOffset() { + list.add(new int[] { 0, 1, 2, 3 }); + int[] set = new int[] {0, -1, -2, -3}; + list.set(0, set); + + int[] res = list.toNativeArray(); + assertEquals(set.length, res.length); + for (int i = 0; i < set.length; i++) { + assertEquals(set[i], res[i]); + } + } } // TIntArrayListTests Index: TLongArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongArrayList.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TLongArrayList.java 26 Mar 2005 18:04:42 -0000 1.18 --- TLongArrayList.java 27 Dec 2005 21:46:06 -0000 1.19 *************** *** 297,301 **** */ public void set(int offset, long[] values, int valOffset, int length) { ! if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } --- 297,301 ---- */ public void set(int offset, long[] values, int valOffset, int length) { ! if (offset < 0 || offset + length > _pos) { throw new ArrayIndexOutOfBoundsException(offset); } Index: TShortArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortArrayList.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TShortArrayList.java 26 Mar 2005 18:04:43 -0000 1.3 --- TShortArrayList.java 27 Dec 2005 21:46:06 -0000 1.4 *************** *** 297,301 **** */ public void set(int offset, short[] values, int valOffset, int length) { ! if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } --- 297,301 ---- */ public void set(int offset, short[] values, int valOffset, int length) { ! if (offset < 0 || offset + length > _pos) { throw new ArrayIndexOutOfBoundsException(offset); } Index: gen_primitive_list.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/gen_primitive_list.pl,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gen_primitive_list.pl 26 Mar 2005 18:04:43 -0000 1.14 --- gen_primitive_list.pl 27 Dec 2005 21:46:06 -0000 1.15 *************** *** 318,322 **** */ public void set(int offset, <type>[] values, int valOffset, int length) { ! if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } --- 318,322 ---- */ public void set(int offset, <type>[] values, int valOffset, int length) { ! if (offset < 0 || offset + length > _pos) { throw new ArrayIndexOutOfBoundsException(offset); } |
From: Eric F. <er...@us...> - 2005-12-27 21:32:17
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12753 Modified Files: ChangeLog Log Message: fix for retainAll on EntryView Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ChangeLog 27 Dec 2005 19:14:28 -0000 1.33 --- ChangeLog 27 Dec 2005 21:32:04 -0000 1.34 *************** *** 3,6 **** --- 3,12 ---- Bugs fixed: [ 1391359 ] Duplicate iteration in THashSet.toArray(Object[]) + removed the duplication + [ 1382196 ] THashMap.entrySet().retainAll() + implemented missing methods on elements of entrySet, refactored retainAll + to use retainEntries, which saves a bunch of allocations + [ 1378868 ] CVS has junit.jar checked in as ASCII + flipped on '-kb' for this file v 1.1b4 |
From: Eric F. <er...@us...> - 2005-12-27 21:32:17
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12753/src/gnu/trove Modified Files: THashMap.java THashMapTests.java Log Message: fix for retainAll on EntryView Index: THashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashMap.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** THashMap.java 26 Mar 2005 17:52:56 -0000 1.18 --- THashMap.java 27 Dec 2005 21:32:04 -0000 1.19 *************** *** 210,213 **** --- 210,228 ---- return p.getHashCode(); } + + public String toString() { + final StringBuffer buf = new StringBuffer("{"); + forEachEntry(new TObjectObjectProcedure() { + public boolean execute(Object key, Object value) { + buf.append(key); + buf.append("="); + buf.append(value); + buf.append(", "); + return true; + } + }); + buf.append("}"); + return buf.toString(); + } private final class HashProcedure implements TObjectObjectProcedure { *************** *** 558,561 **** --- 573,587 ---- } + public boolean retainAll(final Collection collection) { + final Entry e = new Entry(null, null, -1); + return retainEntries(new TObjectObjectProcedure() { + public boolean execute(Object key, Object value) { + e.setKey(key); + e.setValue0(value); + return collection.contains(e); + } + }); + } + public boolean contains(Object entry) { Object val = get(keyForEntry(entry)); *************** *** 702,714 **** final class Entry implements Map.Entry { ! private final Object key; private Object val; private final int index; ! Entry(final Object key, Object value, final int index) { this.key = key; this.val = value; this.index = index; } public Object getKey() { --- 728,748 ---- final class Entry implements Map.Entry { ! private Object key; private Object val; private final int index; ! Entry(Object key, Object value, final int index) { this.key = key; this.val = value; this.index = index; } + + void setKey(Object aKey) { + this.key = aKey; + } + + void setValue0(Object aValue) { + this.val = aValue; + } public Object getKey() { *************** *** 730,733 **** --- 764,781 ---- return o; } + + public boolean equals(Object o) { + if (o instanceof Map.Entry) { + Map.Entry e1 = this; + Map.Entry e2 = (Map.Entry) o; + return (e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) + && (e1.getValue()==null ? e2.getValue()==null : e1.getValue().equals(e2.getValue())); + } + return false; + } + + public int hashCode() { + return (getKey()==null ? 0 : getKey().hashCode()) ^ (getValue()==null ? 0 : getValue().hashCode()); + } } Index: THashMapTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashMapTests.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** THashMapTests.java 26 Mar 2005 17:22:29 -0000 1.17 --- THashMapTests.java 27 Dec 2005 21:32:04 -0000 1.18 *************** *** 302,306 **** mm.put(1, -1); mm.put(0, 0); ! mm.put(127, 68888); ByteArrayOutputStream baos = new ByteArrayOutputStream(); --- 302,306 ---- mm.put(1, -1); mm.put(0, 0); ! mm.put(127, 68888); ByteArrayOutputStream baos = new ByteArrayOutputStream(); *************** *** 375,397 **** public void testKeySetEqualsEquivalentSet() { ! Set set = new java.util.HashSet(); ! set.add("foo"); ! set.add("doh"); ! set.add("hal"); ! THashMap tv1 = new THashMap(); ! tv1.put("doh", "blah"); ! tv1.put("foo", "blah"); ! tv1.put("hal", "notblah"); assertTrue(tv1.keySet().equals(set)); } public void testNullValue() { ! THashMap t = new THashMap(); ! t.put("foo", null); ! t.put("bar", null); ! t.put("baz", null); ! assertEquals(Arrays.asList(new Object[] { null, null, null }), new ArrayList(t.values())); } --- 375,397 ---- public void testKeySetEqualsEquivalentSet() { ! Set set = new java.util.HashSet(); ! set.add("foo"); ! set.add("doh"); ! set.add("hal"); ! THashMap tv1 = new THashMap(); ! tv1.put("doh", "blah"); ! tv1.put("foo", "blah"); ! tv1.put("hal", "notblah"); assertTrue(tv1.keySet().equals(set)); } public void testNullValue() { ! THashMap t = new THashMap(); ! t.put("foo", null); ! t.put("bar", null); ! t.put("baz", null); ! assertEquals(Arrays.asList(new Object[] { null, null, null }), new ArrayList(t.values())); } *************** *** 405,411 **** public void testNullKey() { ! THashMap t = new THashMap(); ! t.put(null, null); ! assertEquals(null, t.keySet().iterator().next()); } --- 405,438 ---- public void testNullKey() { ! THashMap t = new THashMap(); ! t.put(null, null); ! assertEquals(null, t.keySet().iterator().next()); ! } ! ! public void testRetainEntrySet() { ! Map orig = new THashMap(); ! orig.put("one", "frodo"); ! orig.put("two", "bilbo"); ! orig.put("three", "samwise"); ! ! Map subset = new HashMap(); ! subset.put("two", "bilbo"); ! ! assertTrue(orig.entrySet().retainAll(subset.entrySet())); ! ! assertEquals(subset, orig); ! } ! ! public void testMapEntrySetHashCode() { ! Map m1 = new THashMap(); ! m1.put("one", "foo"); ! Map m2 = new THashMap(); ! m2.put("one", "foo"); ! ! Object o1 = m1.entrySet().iterator().next(); ! Object o2 = m1.entrySet().iterator().next(); ! assertTrue(o1 != o2); ! assertTrue(o1.equals(o2)); ! assertEquals(o1.hashCode(), o2.hashCode()); } |
From: Eric F. <er...@us...> - 2005-12-27 19:14:36
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22303 Modified Files: ChangeLog build.xml Log Message: updated docs for 1.1b5 Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ChangeLog 26 Mar 2005 18:04:42 -0000 1.32 --- ChangeLog 27 Dec 2005 19:14:28 -0000 1.33 *************** *** 1,2 **** --- 1,7 ---- + v 1.1b5 + + Bugs fixed: + [ 1391359 ] Duplicate iteration in THashSet.toArray(Object[]) + v 1.1b4 Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** build.xml 26 Mar 2005 17:12:39 -0000 1.34 --- build.xml 27 Dec 2005 19:14:28 -0000 1.35 *************** *** 10,14 **** <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="1.1b4"/> <property name="year" value="2001-2005"/> --- 10,14 ---- <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="1.1b5"/> <property name="year" value="2001-2005"/> |
From: Eric F. <er...@us...> - 2005-12-27 19:13:24
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21984 Modified Files: THashSet.java THashSetTests.java Log Message: Fix for 1391359: duplicate iteration in THashSet.toArray(Object[]) Index: THashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashSet.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** THashSet.java 26 Mar 2005 17:52:56 -0000 1.13 --- THashSet.java 27 Dec 2005 19:13:16 -0000 1.14 *************** *** 229,237 **** forEach(new ToObjectArrayProcedure(a)); ! Iterator it = iterator(); ! for (int i=0; i<size; i++) { ! a[i] = it.next(); ! } ! if (a.length > size) { a[size] = null; --- 229,240 ---- forEach(new ToObjectArrayProcedure(a)); ! // If this collection fits in the specified array with room to ! // spare (i.e., the array has more elements than this ! // collection), the element in the array immediately following ! // the end of the collection is set to null. This is useful in ! // determining the length of this collection only if the ! // caller knows that this collection does not contain any null ! // elements.) ! if (a.length > size) { a[size] = null; Index: THashSetTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashSetTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** THashSetTests.java 23 Mar 2003 04:06:59 -0000 1.6 --- THashSetTests.java 27 Dec 2005 19:13:16 -0000 1.7 *************** *** 151,154 **** --- 151,172 ---- } + public void testToArrayWithParams() { + Object[] str = { "hi", "bye", "hello", "goodbye" }; + s.addAll(Arrays.asList(str)); + String[] sink = new String[str.length + 2]; + sink[sink.length - 1] = "residue"; + sink[sink.length - 2] = "will be cleared"; + Object[] res = s.toArray(sink); + + Set copy = new HashSet(); + copy.addAll(Arrays.asList(res)); + + Set bogey = new HashSet(); + bogey.addAll(Arrays.asList(str)); + bogey.add("residue"); + bogey.add(null); + assertEquals(bogey, copy); + } + public void testReusesRemovedSlotsOnCollision() { THashSet set = new THashSet(11, 0.5f); |
From: Eric F. <er...@us...> - 2005-03-26 18:27:02
|
Update of /cvsroot/trove4j/trove_web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11193 Modified Files: index.shtml Log Message: Index: index.shtml =================================================================== RCS file: /cvsroot/trove4j/trove_web/index.shtml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.shtml 19 Dec 2003 20:03:51 -0000 1.5 --- index.shtml 26 Mar 2005 18:26:53 -0000 1.6 *************** *** 11,14 **** --- 11,18 ---- <p> + <big><a href="http://sourceforge.net/project/showfiles.php?group_id=39235">Trove 1.1b4 released: 03/26/2005</a></big> + </p> + + <p> <b><a href="http://sourceforge.net/donate/index.php?group_id=39235">Donate to GNU Trove</a></b> </p> |
From: Eric F. <er...@us...> - 2005-03-26 18:04:54
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31945/src/gnu/trove Modified Files: TByteArrayList.java TDoubleArrayList.java TDoubleArrayListTests.java TFloatArrayList.java TLongArrayList.java TShortArrayList.java gen_primitive_list.pl Log Message: Fixed 937977 -- primitive array lists were not doing a true deep clone of the underlying array. This is fixed Index: TByteArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteArrayList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TByteArrayList.java 26 Mar 2005 17:52:55 -0000 1.2 --- TByteArrayList.java 26 Mar 2005 18:04:42 -0000 1.3 *************** *** 474,484 **** */ public Object clone() { ! Object o = null; try { ! o = super.clone(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return o; } --- 474,485 ---- */ public Object clone() { ! TByteArrayList list = null; try { ! list = (TByteArrayList) super.clone(); ! list._data = toNativeArray(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return list; } Index: TDoubleArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleArrayList.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TDoubleArrayList.java 26 Mar 2005 17:52:55 -0000 1.17 --- TDoubleArrayList.java 26 Mar 2005 18:04:42 -0000 1.18 *************** *** 474,484 **** */ public Object clone() { ! Object o = null; try { ! o = super.clone(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return o; } --- 474,485 ---- */ public Object clone() { ! TDoubleArrayList list = null; try { ! list = (TDoubleArrayList) super.clone(); ! list._data = toNativeArray(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return list; } Index: TDoubleArrayListTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleArrayListTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleArrayListTests.java 9 Nov 2003 09:23:37 -0000 1.1 --- TDoubleArrayListTests.java 26 Mar 2005 18:04:42 -0000 1.2 *************** *** 56,58 **** --- 56,73 ---- assertEquals("{-1.0, 4.0, 957.0, 32.0, 11.0}", list.toString()); } + + public void testDeepCopyOnClone() throws Exception { + double[] a1 = {0.28, 0.26,0.22}; + + TDoubleArrayList da1 = new TDoubleArrayList(a1); + TDoubleArrayList da1clone=(TDoubleArrayList)da1.clone(); + + assertEquals(da1,da1clone); + + da1clone.reverse(); + + if (da1.equals(da1clone)) { + fail("deep clone failed"); + } + } } // TDoubleArrayListTests Index: TFloatArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatArrayList.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TFloatArrayList.java 26 Mar 2005 17:52:55 -0000 1.17 --- TFloatArrayList.java 26 Mar 2005 18:04:42 -0000 1.18 *************** *** 474,484 **** */ public Object clone() { ! Object o = null; try { ! o = super.clone(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return o; } --- 474,485 ---- */ public Object clone() { ! TFloatArrayList list = null; try { ! list = (TFloatArrayList) super.clone(); ! list._data = toNativeArray(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return list; } Index: TLongArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongArrayList.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TLongArrayList.java 26 Mar 2005 17:52:56 -0000 1.17 --- TLongArrayList.java 26 Mar 2005 18:04:42 -0000 1.18 *************** *** 474,484 **** */ public Object clone() { ! Object o = null; try { ! o = super.clone(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return o; } --- 474,485 ---- */ public Object clone() { ! TLongArrayList list = null; try { ! list = (TLongArrayList) super.clone(); ! list._data = toNativeArray(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return list; } Index: TShortArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortArrayList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TShortArrayList.java 26 Mar 2005 17:52:56 -0000 1.2 --- TShortArrayList.java 26 Mar 2005 18:04:43 -0000 1.3 *************** *** 474,484 **** */ public Object clone() { ! Object o = null; try { ! o = super.clone(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return o; } --- 474,485 ---- */ public Object clone() { ! TShortArrayList list = null; try { ! list = (TShortArrayList) super.clone(); ! list._data = toNativeArray(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return list; } Index: gen_primitive_list.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/gen_primitive_list.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gen_primitive_list.pl 26 Mar 2005 17:52:56 -0000 1.13 --- gen_primitive_list.pl 26 Mar 2005 18:04:43 -0000 1.14 *************** *** 495,505 **** */ public Object clone() { ! Object o = null; try { ! o = super.clone(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return o; } --- 495,506 ---- */ public Object clone() { ! T<Type>ArrayList list = null; try { ! list = (T<Type>ArrayList) super.clone(); ! list._data = toNativeArray(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch ! return list; } |
From: Eric F. <er...@us...> - 2005-03-26 18:04:54
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31945 Modified Files: ChangeLog Log Message: Fixed 937977 -- primitive array lists were not doing a true deep clone of the underlying array. This is fixed Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ChangeLog 26 Mar 2005 17:53:35 -0000 1.31 --- ChangeLog 26 Mar 2005 18:04:42 -0000 1.32 *************** *** 17,20 **** --- 17,23 ---- reverse compatible versions and so will break archived collections created with earlier versions of trove. + + Fixed 937977 -- primitive array lists were not doing a true deep clone + of the underlying array. This is fixed v 1.1b3 |
From: Eric F. <er...@us...> - 2005-03-26 17:53:43
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26114 Modified Files: ChangeLog Log Message: fmt on text Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ChangeLog 26 Mar 2005 17:52:55 -0000 1.30 --- ChangeLog 26 Mar 2005 17:53:35 -0000 1.31 *************** *** 12,18 **** Fixed doc problem reported in 939016 ! Fixed 995597, missing serial version IDs. NOTE: THashMap, THashSet and TLinkedList have IDs generated by ! serialver and are believed to be b/w compatible. The generated collections, however, are NOT reverse compatible ! versions and so will break archived collections created with earlier versions of trove. v 1.1b3 --- 12,20 ---- Fixed doc problem reported in 939016 ! Fixed 995597, missing serial version IDs. NOTE: THashMap, THashSet ! and TLinkedList have IDs generated by serialver and are believed ! to be b/w compatible. The generated collections, however, are NOT ! reverse compatible versions and so will break archived collections ! created with earlier versions of trove. v 1.1b3 *************** *** 53,67 **** revamped versioning scheme ! added hashCode implementation to collections so that they can appear in collections ! too. ! added check+exception to detect violations of the equals() <-> hashCode() contract ! specified in java.lang.Object's api. v 0.1.8 ! Added gnu.trove.decorator package, with Decorator classes that wrap trove's ! primitive maps and sets for conformance with the java.util.{Map,Set} ! APIs. v 0.1.7 --- 55,69 ---- revamped versioning scheme ! added hashCode implementation to collections so that they can appear ! in collections too. ! added check+exception to detect violations of the equals() <-> ! hashCode() contract specified in java.lang.Object's api. v 0.1.8 ! Added gnu.trove.decorator package, with Decorator classes that wrap ! trove's primitive maps and sets for conformance with the ! java.util.{Map,Set} APIs. v 0.1.7 *************** *** 75,80 **** Fixed bug 602376 -- ClassCastException n THashMap.putAll ! Made all collections implement Cloneable. primitive collections clone deeply; ! Object collections produce shallow clones. v 0.1.6 --- 77,82 ---- Fixed bug 602376 -- ClassCastException n THashMap.putAll ! Made all collections implement Cloneable. primitive collections ! clone deeply; Object collections produce shallow clones. v 0.1.6 |
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25537/src/gnu/trove Modified Files: TByteArrayList.java TByteByteHashMap.java TByteDoubleHashMap.java TByteFloatHashMap.java TByteHashSet.java TByteIntHashMap.java TByteLongHashMap.java TByteObjectHashMap.java TByteShortHashMap.java TDoubleArrayList.java TDoubleByteHashMap.java TDoubleDoubleHashMap.java TDoubleFloatHashMap.java TDoubleHashSet.java TDoubleIntHashMap.java TDoubleLongHashMap.java TDoubleObjectHashMap.java TDoubleShortHashMap.java TFloatArrayList.java TFloatByteHashMap.java TFloatDoubleHashMap.java TFloatFloatHashMap.java TFloatHashSet.java TFloatIntHashMap.java TFloatLongHashMap.java TFloatObjectHashMap.java TFloatShortHashMap.java THashMap.java THashSet.java TIntByteHashMap.java TIntDoubleHashMap.java TIntFloatHashMap.java TIntHashSet.java TIntIntHashMap.java TIntLongHashMap.java TIntObjectHashMap.java TIntShortHashMap.java TLinkedList.java TLongArrayList.java TLongByteHashMap.java TLongDoubleHashMap.java TLongFloatHashMap.java TLongHashSet.java TLongIntHashMap.java TLongLongHashMap.java TLongObjectHashMap.java TLongShortHashMap.java TObjectByteHashMap.java TObjectDoubleHashMap.java TObjectFloatHashMap.java TObjectIntHashMap.java TObjectLongHashMap.java TObjectShortHashMap.java TShortArrayList.java TShortByteHashMap.java TShortDoubleHashMap.java TShortFloatHashMap.java TShortHashSet.java TShortIntHashMap.java TShortLongHashMap.java TShortObjectHashMap.java TShortShortHashMap.java gen_obj_primitive_map.pl gen_primitive_list.pl gen_primitive_map.pl gen_primitive_set.pl Log Message: Fixed 995597, missing serial version IDs. NOTE: THashMap, THashSet and TLinkedList have IDs generated by serialver and are believed to be b/w compatible. The generated collections, however, are NOT reverse compatible versions and so will break archived collections created with earlier versions of trove. Index: TByteArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteArrayList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteArrayList.java 9 Nov 2004 15:48:45 -0000 1.1 --- TByteArrayList.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteArrayList implements Serializable, Cloneable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the data of the list */ protected byte[] _data; Index: TByteByteHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteByteHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteByteHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteByteHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteByteHashMap extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient byte[] _values; Index: TByteDoubleHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteDoubleHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteDoubleHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteDoubleHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteDoubleHashMap extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient double[] _values; Index: TByteFloatHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteFloatHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteFloatHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteFloatHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteFloatHashMap extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient float[] _values; Index: TByteHashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteHashSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteHashSet.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteHashSet.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 37,40 **** --- 37,43 ---- public class TByteHashSet extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** * Creates a new <code>TByteHashSet</code> instance with the default Index: TByteIntHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteIntHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteIntHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteIntHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteIntHashMap extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient int[] _values; Index: TByteLongHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteLongHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteLongHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteLongHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteLongHashMap extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient long[] _values; Index: TByteObjectHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteObjectHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteObjectHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteObjectHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteObjectHashMap extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient Object[] _values; Index: TByteShortHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteShortHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteShortHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteShortHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TByteShortHashMap extends TByteHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient short[] _values; Index: TDoubleArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleArrayList.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TDoubleArrayList.java 9 Nov 2004 15:48:46 -0000 1.16 --- TDoubleArrayList.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleArrayList implements Serializable, Cloneable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the data of the list */ protected double[] _data; Index: TDoubleByteHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleByteHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleByteHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TDoubleByteHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleByteHashMap extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient byte[] _values; Index: TDoubleDoubleHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleDoubleHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TDoubleDoubleHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TDoubleDoubleHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleDoubleHashMap extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient double[] _values; Index: TDoubleFloatHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleFloatHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TDoubleFloatHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TDoubleFloatHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleFloatHashMap extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient float[] _values; Index: TDoubleHashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleHashSet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TDoubleHashSet.java 9 Nov 2004 15:48:46 -0000 1.12 --- TDoubleHashSet.java 26 Mar 2005 17:52:55 -0000 1.13 *************** *** 37,40 **** --- 37,43 ---- public class TDoubleHashSet extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** * Creates a new <code>TDoubleHashSet</code> instance with the default Index: TDoubleIntHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleIntHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TDoubleIntHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TDoubleIntHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleIntHashMap extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient int[] _values; Index: TDoubleLongHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleLongHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TDoubleLongHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TDoubleLongHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleLongHashMap extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient long[] _values; Index: TDoubleObjectHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleObjectHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TDoubleObjectHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TDoubleObjectHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleObjectHashMap extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient Object[] _values; Index: TDoubleShortHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleShortHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleShortHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TDoubleShortHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TDoubleShortHashMap extends TDoubleHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient short[] _values; Index: TFloatArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatArrayList.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TFloatArrayList.java 9 Nov 2004 15:48:46 -0000 1.16 --- TFloatArrayList.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TFloatArrayList implements Serializable, Cloneable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the data of the list */ protected float[] _data; Index: TFloatByteHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatByteHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatByteHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TFloatByteHashMap.java 26 Mar 2005 17:52:55 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TFloatByteHashMap extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient byte[] _values; Index: TFloatDoubleHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatDoubleHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TFloatDoubleHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TFloatDoubleHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TFloatDoubleHashMap extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient double[] _values; Index: TFloatFloatHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatFloatHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TFloatFloatHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TFloatFloatHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TFloatFloatHashMap extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient float[] _values; Index: TFloatHashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatHashSet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TFloatHashSet.java 9 Nov 2004 15:48:46 -0000 1.12 --- TFloatHashSet.java 26 Mar 2005 17:52:55 -0000 1.13 *************** *** 37,40 **** --- 37,43 ---- public class TFloatHashSet extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** * Creates a new <code>TFloatHashSet</code> instance with the default Index: TFloatIntHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatIntHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TFloatIntHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TFloatIntHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TFloatIntHashMap extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient int[] _values; Index: TFloatLongHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatLongHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TFloatLongHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TFloatLongHashMap.java 26 Mar 2005 17:52:55 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TFloatLongHashMap extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient long[] _values; Index: TFloatObjectHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatObjectHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TFloatObjectHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TFloatObjectHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TFloatObjectHashMap extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient Object[] _values; Index: TFloatShortHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatShortHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatShortHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TFloatShortHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TFloatShortHashMap extends TFloatHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient short[] _values; Index: THashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashMap.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** THashMap.java 9 Nov 2004 15:48:46 -0000 1.17 --- THashMap.java 26 Mar 2005 17:52:56 -0000 1.18 *************** *** 43,46 **** --- 43,48 ---- public class THashMap extends TObjectHash implements Map, Serializable { + static final long serialVersionUID = 5182945951854128074L; + /** the values of the map */ protected transient Object[] _values; Index: THashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashSet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** THashSet.java 9 Nov 2004 15:48:46 -0000 1.12 --- THashSet.java 26 Mar 2005 17:52:56 -0000 1.13 *************** *** 40,43 **** --- 40,45 ---- public class THashSet extends TObjectHash implements Set, Serializable { + static final long serialVersionUID = -2353400642617702135L; + /** * Creates a new <code>THashSet</code> instance with the default Index: TIntByteHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntByteHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntByteHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TIntByteHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TIntByteHashMap extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient byte[] _values; Index: TIntDoubleHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntDoubleHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TIntDoubleHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TIntDoubleHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TIntDoubleHashMap extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient double[] _values; Index: TIntFloatHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntFloatHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TIntFloatHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TIntFloatHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TIntFloatHashMap extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient float[] _values; Index: TIntHashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntHashSet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TIntHashSet.java 9 Nov 2004 15:48:46 -0000 1.12 --- TIntHashSet.java 26 Mar 2005 17:52:56 -0000 1.13 *************** *** 37,40 **** --- 37,43 ---- public class TIntHashSet extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** * Creates a new <code>TIntHashSet</code> instance with the default Index: TIntIntHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntIntHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TIntIntHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TIntIntHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TIntIntHashMap extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient int[] _values; Index: TIntLongHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntLongHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TIntLongHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TIntLongHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TIntLongHashMap extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient long[] _values; Index: TIntObjectHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntObjectHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TIntObjectHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TIntObjectHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TIntObjectHashMap extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient Object[] _values; Index: TIntShortHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntShortHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntShortHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TIntShortHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TIntShortHashMap extends TIntHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient short[] _values; Index: TLinkedList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLinkedList.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TLinkedList.java 8 Apr 2002 02:02:28 -0000 1.4 --- TLinkedList.java 26 Mar 2005 17:52:56 -0000 1.5 *************** *** 60,63 **** --- 60,65 ---- implements Serializable { + static final long serialVersionUID = 8255356362445153793L; + /** the head of the list */ protected TLinkable _head; Index: TLongArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongArrayList.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TLongArrayList.java 9 Nov 2004 15:48:46 -0000 1.16 --- TLongArrayList.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TLongArrayList implements Serializable, Cloneable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the data of the list */ protected long[] _data; Index: TLongByteHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongByteHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongByteHashMap.java 9 Nov 2004 15:48:46 -0000 1.1 --- TLongByteHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TLongByteHashMap extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient byte[] _values; Index: TLongDoubleHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongDoubleHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TLongDoubleHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TLongDoubleHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TLongDoubleHashMap extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient double[] _values; Index: TLongFloatHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongFloatHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TLongFloatHashMap.java 9 Nov 2004 15:48:46 -0000 1.16 --- TLongFloatHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TLongFloatHashMap extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient float[] _values; Index: TLongHashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongHashSet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TLongHashSet.java 9 Nov 2004 15:48:47 -0000 1.12 --- TLongHashSet.java 26 Mar 2005 17:52:56 -0000 1.13 *************** *** 37,40 **** --- 37,43 ---- public class TLongHashSet extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** * Creates a new <code>TLongHashSet</code> instance with the default Index: TLongIntHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongIntHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TLongIntHashMap.java 9 Nov 2004 15:48:47 -0000 1.16 --- TLongIntHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TLongIntHashMap extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient int[] _values; Index: TLongLongHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongLongHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TLongLongHashMap.java 9 Nov 2004 15:48:47 -0000 1.16 --- TLongLongHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TLongLongHashMap extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient long[] _values; Index: TLongObjectHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongObjectHashMap.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TLongObjectHashMap.java 9 Nov 2004 15:48:47 -0000 1.16 --- TLongObjectHashMap.java 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 34,37 **** --- 34,40 ---- public class TLongObjectHashMap extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient Object[] _values; Index: TLongShortHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongShortHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongShortHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TLongShortHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TLongShortHashMap extends TLongHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient short[] _values; Index: TObjectByteHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectByteHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TObjectByteHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TObjectByteHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 35,38 **** --- 35,41 ---- public class TObjectByteHashMap extends TObjectHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient byte[] _values; Index: TObjectDoubleHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectDoubleHashMap.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TObjectDoubleHashMap.java 9 Nov 2004 15:48:47 -0000 1.14 --- TObjectDoubleHashMap.java 26 Mar 2005 17:52:56 -0000 1.15 *************** *** 35,38 **** --- 35,41 ---- public class TObjectDoubleHashMap extends TObjectHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient double[] _values; Index: TObjectFloatHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectFloatHashMap.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TObjectFloatHashMap.java 9 Nov 2004 15:48:47 -0000 1.14 --- TObjectFloatHashMap.java 26 Mar 2005 17:52:56 -0000 1.15 *************** *** 35,38 **** --- 35,41 ---- public class TObjectFloatHashMap extends TObjectHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient float[] _values; Index: TObjectIntHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectIntHashMap.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TObjectIntHashMap.java 9 Nov 2004 15:48:47 -0000 1.14 --- TObjectIntHashMap.java 26 Mar 2005 17:52:56 -0000 1.15 *************** *** 35,38 **** --- 35,41 ---- public class TObjectIntHashMap extends TObjectHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient int[] _values; Index: TObjectLongHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectLongHashMap.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TObjectLongHashMap.java 9 Nov 2004 15:48:47 -0000 1.14 --- TObjectLongHashMap.java 26 Mar 2005 17:52:56 -0000 1.15 *************** *** 35,38 **** --- 35,41 ---- public class TObjectLongHashMap extends TObjectHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient long[] _values; Index: TObjectShortHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectShortHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TObjectShortHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TObjectShortHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 35,38 **** --- 35,41 ---- public class TObjectShortHashMap extends TObjectHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient short[] _values; Index: TShortArrayList.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortArrayList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortArrayList.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortArrayList.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortArrayList implements Serializable, Cloneable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the data of the list */ protected short[] _data; Index: TShortByteHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortByteHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortByteHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortByteHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortByteHashMap extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient byte[] _values; Index: TShortDoubleHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortDoubleHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortDoubleHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortDoubleHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortDoubleHashMap extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient double[] _values; Index: TShortFloatHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortFloatHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortFloatHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortFloatHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortFloatHashMap extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient float[] _values; Index: TShortHashSet.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortHashSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortHashSet.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortHashSet.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 37,40 **** --- 37,43 ---- public class TShortHashSet extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** * Creates a new <code>TShortHashSet</code> instance with the default Index: TShortIntHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortIntHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortIntHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortIntHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortIntHashMap extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient int[] _values; Index: TShortLongHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortLongHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortLongHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortLongHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortLongHashMap extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient long[] _values; Index: TShortObjectHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortObjectHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortObjectHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortObjectHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortObjectHashMap extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient Object[] _values; Index: TShortShortHashMap.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TShortShortHashMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TShortShortHashMap.java 9 Nov 2004 15:48:47 -0000 1.1 --- TShortShortHashMap.java 26 Mar 2005 17:52:56 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- public class TShortShortHashMap extends TShortHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient short[] _values; Index: gen_obj_primitive_map.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/gen_obj_primitive_map.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gen_obj_primitive_map.pl 9 Nov 2004 15:48:47 -0000 1.8 --- gen_obj_primitive_map.pl 26 Mar 2005 17:52:56 -0000 1.9 *************** *** 130,133 **** --- 130,136 ---- public class TObject<ValueType>HashMap extends TObjectHash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient <valueType>[] _values; Index: gen_primitive_list.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/gen_primitive_list.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gen_primitive_list.pl 9 Nov 2004 15:48:47 -0000 1.12 --- gen_primitive_list.pl 26 Mar 2005 17:52:56 -0000 1.13 *************** *** 55,58 **** --- 55,61 ---- public class T<Type>ArrayList implements Serializable, Cloneable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the data of the list */ protected <type>[] _data; Index: gen_primitive_map.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/gen_primitive_map.pl,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gen_primitive_map.pl 9 Nov 2004 15:48:47 -0000 1.16 --- gen_primitive_map.pl 26 Mar 2005 17:52:56 -0000 1.17 *************** *** 182,185 **** --- 182,188 ---- public class T<KeyType><ValueType>HashMap extends T<KeyType>Hash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** the values of the map */ protected transient <valueType>[] _values; Index: gen_primitive_set.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/gen_primitive_set.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gen_primitive_set.pl 9 Nov 2004 15:48:47 -0000 1.12 --- gen_primitive_set.pl 26 Mar 2005 17:52:56 -0000 1.13 *************** *** 58,61 **** --- 58,64 ---- public class T<Type>HashSet extends T<Type>Hash implements Serializable { + /** compatible serialization ID - not present in 1.1b3 and earlier */ + static final long serialVersionUID = 1L; + /** * Creates a new <code>T<Type>HashSet</code> instance with the default |
From: Eric F. <er...@us...> - 2005-03-26 17:53:04
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25537 Modified Files: ChangeLog Log Message: Fixed 995597, missing serial version IDs. NOTE: THashMap, THashSet and TLinkedList have IDs generated by serialver and are believed to be b/w compatible. The generated collections, however, are NOT reverse compatible versions and so will break archived collections created with earlier versions of trove. Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ChangeLog 26 Mar 2005 17:30:15 -0000 1.29 --- ChangeLog 26 Mar 2005 17:52:55 -0000 1.30 *************** *** 11,14 **** --- 11,18 ---- Fixed doc problem reported in 939016 + + Fixed 995597, missing serial version IDs. NOTE: THashMap, THashSet and TLinkedList have IDs generated by + serialver and are believed to be b/w compatible. The generated collections, however, are NOT reverse compatible + versions and so will break archived collections created with earlier versions of trove. v 1.1b3 |
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13488/src/gnu/trove Modified Files: TByteByteIterator.java TByteDoubleIterator.java TByteFloatIterator.java TByteIntIterator.java TByteLongIterator.java TByteObjectIterator.java TByteShortIterator.java TDoubleByteIterator.java TDoubleDoubleIterator.java TDoubleFloatIterator.java TDoubleIntIterator.java TDoubleLongIterator.java TDoubleObjectIterator.java TDoubleShortIterator.java TFloatByteIterator.java TFloatDoubleIterator.java TFloatFloatIterator.java TFloatIntIterator.java TFloatLongIterator.java TFloatObjectIterator.java TFloatShortIterator.java TIntByteIterator.java TIntDoubleIterator.java TIntFloatIterator.java TIntIntIterator.java TIntLongIterator.java TIntObjectIterator.java TIntShortIterator.java TLongByteIterator.java TLongDoubleIterator.java TLongFloatIterator.java TLongIntIterator.java TLongLongIterator.java TLongObjectIterator.java TLongShortIterator.java TObjectByteIterator.java TObjectDoubleIterator.java TObjectFloatIterator.java TObjectIntIterator.java TObjectLongIterator.java TObjectShortIterator.java TShortByteIterator.java TShortDoubleIterator.java TShortFloatIterator.java TShortIntIterator.java TShortLongIterator.java TShortObjectIterator.java TShortShortIterator.java gen_map_iterators.pl gen_object_primitive_iterators.pl Log Message: fixed doc problem reported in 939016 Index: TByteByteIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteByteIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteByteIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteByteIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TByteDoubleIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteDoubleIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteDoubleIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteDoubleIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TByteDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TByteDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TByteDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TByteDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TByteDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TByteDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TByteFloatIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteFloatIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteFloatIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteFloatIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TByteFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TByteFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TByteFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TByteFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TByteFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TByteFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TByteIntIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteIntIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteIntIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteIntIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TByteIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TByteIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TByteIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TByteIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TByteIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TByteIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TByteLongIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteLongIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteLongIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteLongIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TByteLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TByteLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TByteLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TByteLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TByteLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TByteLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TByteObjectIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteObjectIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteObjectIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteObjectIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TByteObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TByteObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TByteObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TByteObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TByteObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TByteObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TByteShortIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TByteShortIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TByteShortIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TByteShortIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TByteShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TByteShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TByteShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TByteShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TByteShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TByteShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TDoubleByteIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleByteIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleByteIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TDoubleByteIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TDoubleByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TDoubleByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TDoubleByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TDoubleByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TDoubleByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TDoubleByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TDoubleDoubleIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleDoubleIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TDoubleDoubleIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TDoubleDoubleIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TDoubleDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TDoubleDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TDoubleDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TDoubleDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TDoubleDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TDoubleDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TDoubleFloatIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleFloatIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TDoubleFloatIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TDoubleFloatIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TDoubleFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TDoubleFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TDoubleFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TDoubleFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TDoubleFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TDoubleFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TDoubleIntIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleIntIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TDoubleIntIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TDoubleIntIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TDoubleIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TDoubleIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TDoubleIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TDoubleIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TDoubleIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TDoubleIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TDoubleLongIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleLongIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TDoubleLongIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TDoubleLongIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TDoubleLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TDoubleLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TDoubleLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TDoubleLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TDoubleLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TDoubleLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TDoubleObjectIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleObjectIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TDoubleObjectIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TDoubleObjectIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TDoubleObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TDoubleObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TDoubleObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TDoubleObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TDoubleObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TDoubleObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TDoubleShortIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TDoubleShortIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleShortIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TDoubleShortIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TDoubleShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TDoubleShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TDoubleShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TDoubleShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TDoubleShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TDoubleShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TFloatByteIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatByteIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatByteIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TFloatByteIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TFloatByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TFloatByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TFloatByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TFloatByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TFloatByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TFloatByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TFloatDoubleIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatDoubleIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TFloatDoubleIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TFloatDoubleIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TFloatDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TFloatDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TFloatDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TFloatDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TFloatDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TFloatDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TFloatFloatIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatFloatIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TFloatFloatIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TFloatFloatIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TFloatFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TFloatFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TFloatFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TFloatFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TFloatFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TFloatFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TFloatIntIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatIntIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TFloatIntIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TFloatIntIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TFloatIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TFloatIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TFloatIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TFloatIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TFloatIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TFloatIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TFloatLongIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatLongIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TFloatLongIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TFloatLongIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TFloatLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TFloatLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TFloatLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TFloatLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TFloatLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TFloatLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TFloatObjectIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatObjectIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TFloatObjectIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TFloatObjectIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TFloatObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TFloatObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TFloatObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TFloatObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TFloatObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TFloatObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TFloatShortIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TFloatShortIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatShortIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TFloatShortIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TFloatShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TFloatShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TFloatShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TFloatShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TFloatShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TFloatShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TIntByteIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntByteIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntByteIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TIntByteIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TIntByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TIntByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TIntByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TIntByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TIntByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TIntByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TIntDoubleIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntDoubleIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TIntDoubleIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TIntDoubleIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TIntDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TIntDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TIntDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TIntDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TIntDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TIntDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TIntFloatIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntFloatIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TIntFloatIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TIntFloatIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TIntFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TIntFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TIntFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TIntFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TIntFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TIntFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TIntIntIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntIntIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TIntIntIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TIntIntIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TIntIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TIntIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TIntIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TIntIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TIntIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TIntIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TIntLongIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntLongIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TIntLongIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TIntLongIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TIntLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TIntLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TIntLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TIntLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TIntLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TIntLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TIntObjectIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntObjectIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TIntObjectIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TIntObjectIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TIntObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TIntObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TIntObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TIntObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TIntObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TIntObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TIntShortIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TIntShortIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntShortIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TIntShortIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TIntShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TIntShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TIntShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TIntShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TIntShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TIntShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TLongByteIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongByteIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongByteIterator.java 9 Nov 2004 15:48:46 -0000 1.1 --- TLongByteIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TLongByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TLongByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TLongByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TLongByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TLongByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TLongByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TLongDoubleIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongDoubleIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TLongDoubleIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TLongDoubleIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TLongDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TLongDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TLongDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TLongDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TLongDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TLongDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TLongFloatIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongFloatIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TLongFloatIterator.java 9 Nov 2004 15:48:46 -0000 1.2 --- TLongFloatIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TLongFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TLongFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TLongFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TLongFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TLongFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TLongFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TLongIntIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongIntIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TLongIntIterator.java 9 Nov 2004 15:48:47 -0000 1.2 --- TLongIntIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TLongIntIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TLongLongIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongLongIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TLongLongIterator.java 9 Nov 2004 15:48:47 -0000 1.2 --- TLongLongIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TLongLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TLongLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TLongLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TLongLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TLongLongIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TLongLongIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TLongObjectIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongObjectIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TLongObjectIterator.java 9 Nov 2004 15:48:47 -0000 1.2 --- TLongObjectIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 45,49 **** * for (TLongObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TLongObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TLongObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TLongObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TLongObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TLongObjectIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TLongShortIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TLongShortIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongShortIterator.java 9 Nov 2004 15:48:47 -0000 1.1 --- TLongShortIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 45,49 **** * for (TLongShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 45,49 ---- * for (TLongShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 56,60 **** * for (TLongShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 56,60 ---- * for (TLongShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 67,71 **** * for (TLongShortIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 67,71 ---- * for (TLongShortIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TObjectByteIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectByteIterator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TObjectByteIterator.java 9 Nov 2004 15:48:47 -0000 1.1 --- TObjectByteIterator.java 26 Mar 2005 17:30:24 -0000 1.2 *************** *** 47,51 **** * for (TObjectByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 47,51 ---- * for (TObjectByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 58,62 **** * for (TObjectByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 58,62 ---- * for (TObjectByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 69,73 **** * for (TObjectByteIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 69,73 ---- * for (TObjectByteIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TObjectDoubleIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectDoubleIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TObjectDoubleIterator.java 9 Nov 2004 15:48:47 -0000 1.2 --- TObjectDoubleIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 47,51 **** * for (TObjectDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 47,51 ---- * for (TObjectDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 58,62 **** * for (TObjectDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 58,62 ---- * for (TObjectDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 69,73 **** * for (TObjectDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); --- 69,73 ---- * for (TObjectDoubleIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.remove(); Index: TObjectFloatIterator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/TObjectFloatIterator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TObjectFloatIterator.java 9 Nov 2004 15:48:47 -0000 1.2 --- TObjectFloatIterator.java 26 Mar 2005 17:30:24 -0000 1.3 *************** *** 47,51 **** * for (TObjectFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); --- 47,51 ---- * for (TObjectFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); *************** *** 58,62 **** * for (TObjectFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); --- 58,62 ---- * for (TObjectFloatIterator it = map.iterator(); * it.hasNext();) { ! * it.advance(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); *************** *** 69,... [truncated message content] |
From: Eric F. <er...@us...> - 2005-03-26 17:30:33
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13488 Modified Files: ChangeLog Log Message: fixed doc problem reported in 939016 Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ChangeLog 26 Mar 2005 17:22:29 -0000 1.28 --- ChangeLog 26 Mar 2005 17:30:15 -0000 1.29 *************** *** 9,12 **** --- 9,14 ---- Added testSerializablePrimitives unit test to validate that behavior reported in 1113420 does work as it's supposed to. + + Fixed doc problem reported in 939016 v 1.1b3 |
From: Eric F. <er...@us...> - 2005-03-26 17:22:41
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8883/src/gnu/trove Modified Files: THashMapTests.java Log Message: added unit tests to address concern raised in 1113420 (could not reproduce) Index: THashMapTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashMapTests.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** THashMapTests.java 9 Nov 2004 15:52:54 -0000 1.16 --- THashMapTests.java 26 Mar 2005 17:22:29 -0000 1.17 *************** *** 298,301 **** --- 298,319 ---- } + public void testSerializablePrimitives() throws Exception { + TIntIntHashMap mm = new TIntIntHashMap(); + mm.put(1, -1); + mm.put(0, 0); + mm.put(127, 68888); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(mm); + + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + + TIntIntHashMap mm2 = (TIntIntHashMap)ois.readObject(); + + assertEquals(mm, mm2); + } + public void testRetainEntries() throws Exception { THashMap mm = new THashMap(); |
From: Eric F. <er...@us...> - 2005-03-26 17:22:41
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8883 Modified Files: ChangeLog Log Message: added unit tests to address concern raised in 1113420 (could not reproduce) Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ChangeLog 9 Nov 2004 15:48:45 -0000 1.27 --- ChangeLog 26 Mar 2005 17:22:29 -0000 1.28 *************** *** 7,10 **** --- 7,13 ---- A big thanks to Steven Lunt for putting this patch together. + Added testSerializablePrimitives unit test to validate that behavior + reported in 1113420 does work as it's supposed to. + v 1.1b3 |
From: Eric F. <er...@us...> - 2005-03-26 17:12:47
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3519 Modified Files: build.xml Log Message: extended (c) year to 2005 Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** build.xml 9 Nov 2004 15:48:45 -0000 1.33 --- build.xml 26 Mar 2005 17:12:39 -0000 1.34 *************** *** 11,15 **** <property name="name" value="trove"/> <property name="version" value="1.1b4"/> ! <property name="year" value="2001-2004"/> <echo message="----------- ${Name} ${version} [${year}] ------------"/> --- 11,15 ---- <property name="name" value="trove"/> <property name="version" value="1.1b4"/> ! <property name="year" value="2001-2005"/> <echo message="----------- ${Name} ${version} [${year}] ------------"/> |
From: Eric F. <er...@us...> - 2004-11-09 15:53:16
|
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30488 Modified Files: THashMapTests.java Log Message: added test for null value size Index: THashMapTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/THashMapTests.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** THashMapTests.java 9 Nov 2004 15:48:46 -0000 1.15 --- THashMapTests.java 9 Nov 2004 15:52:54 -0000 1.16 *************** *** 378,381 **** --- 378,389 ---- } + public void testNullValueSize() { + THashMap map = new THashMap(); + + map.put("narf",null); + map.put("narf",null); + assertEquals(1, map.size()); + } + public void testNullKey() { THashMap t = new THashMap(); |
Update of /cvsroot/trove4j/trove/src/gnu/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29171/src/gnu/trove Modified Files: SerializationProcedure.java TDoubleArrayList.java TDoubleDoubleHashMap.java TDoubleDoubleIterator.java TDoubleDoubleProcedure.java TDoubleFloatHashMap.java TDoubleFloatIterator.java TDoubleFloatProcedure.java TDoubleFunction.java TDoubleHash.java TDoubleHashSet.java TDoubleHashingStrategy.java TDoubleIntHashMap.java TDoubleIntIterator.java TDoubleIntProcedure.java TDoubleIterator.java TDoubleLongHashMap.java TDoubleLongIterator.java TDoubleLongProcedure.java TDoubleObjectHashMap.java TDoubleObjectIterator.java TDoubleObjectProcedure.java TDoubleProcedure.java TFloatArrayList.java TFloatDoubleHashMap.java TFloatDoubleIterator.java TFloatDoubleProcedure.java TFloatFloatHashMap.java TFloatFloatIterator.java TFloatFloatProcedure.java TFloatFunction.java TFloatHash.java TFloatHashSet.java TFloatHashingStrategy.java TFloatIntHashMap.java TFloatIntIterator.java TFloatIntProcedure.java TFloatIterator.java TFloatLongHashMap.java TFloatLongIterator.java TFloatLongProcedure.java TFloatObjectHashMap.java TFloatObjectIterator.java TFloatObjectProcedure.java TFloatProcedure.java THashIterator.java THashMap.java THashMapTests.java THashSet.java TIntDoubleHashMap.java TIntDoubleIterator.java TIntDoubleProcedure.java TIntFloatHashMap.java TIntFloatIterator.java TIntFloatProcedure.java TIntFunction.java TIntHash.java TIntHashSet.java TIntHashingStrategy.java TIntIntHashMap.java TIntIntIterator.java TIntIntProcedure.java TIntIterator.java TIntLongHashMap.java TIntLongIterator.java TIntLongProcedure.java TIntObjectHashMap.java TIntObjectIterator.java TIntObjectProcedure.java TIntProcedure.java TLongArrayList.java TLongDoubleHashMap.java TLongDoubleIterator.java TLongDoubleProcedure.java TLongFloatHashMap.java TLongFloatIterator.java TLongFloatProcedure.java TLongFunction.java TLongHash.java TLongHashSet.java TLongHashingStrategy.java TLongIntHashMap.java TLongIntIterator.java TLongIntProcedure.java TLongIterator.java TLongLongHashMap.java TLongLongIterator.java TLongLongProcedure.java TLongObjectHashMap.java TLongObjectIterator.java TLongObjectProcedure.java TLongProcedure.java TObjectDoubleHashMap.java TObjectDoubleIterator.java TObjectDoubleProcedure.java TObjectFloatHashMap.java TObjectFloatIterator.java TObjectFloatProcedure.java TObjectHash.java TObjectIntHashMap.java TObjectIntIterator.java TObjectIntProcedure.java TObjectLongHashMap.java TObjectLongIterator.java TObjectLongProcedure.java gen_map_functions.pl gen_map_iterators.pl gen_map_procedures.pl gen_obj_primitive_map.pl gen_object_primitive_iterators.pl gen_primitive_base.pl gen_primitive_list.pl gen_primitive_map.pl gen_primitive_set.pl gen_primitive_strategy.pl gen_set_iterators.pl gen_set_procedures.pl Added Files: TByteArrayList.java TByteByteHashMap.java TByteByteIterator.java TByteByteProcedure.java TByteDoubleHashMap.java TByteDoubleIterator.java TByteDoubleProcedure.java TByteFloatHashMap.java TByteFloatIterator.java TByteFloatProcedure.java TByteFunction.java TByteHash.java TByteHashSet.java TByteHashingStrategy.java TByteIntHashMap.java TByteIntIterator.java TByteIntProcedure.java TByteIterator.java TByteLongHashMap.java TByteLongIterator.java TByteLongProcedure.java TByteObjectHashMap.java TByteObjectIterator.java TByteObjectProcedure.java TByteProcedure.java TByteShortHashMap.java TByteShortIterator.java TByteShortProcedure.java TDoubleByteHashMap.java TDoubleByteIterator.java TDoubleByteProcedure.java TDoubleShortHashMap.java TDoubleShortIterator.java TDoubleShortProcedure.java TFloatByteHashMap.java TFloatByteIterator.java TFloatByteProcedure.java TFloatShortHashMap.java TFloatShortIterator.java TFloatShortProcedure.java TIntByteHashMap.java TIntByteIterator.java TIntByteProcedure.java TIntShortHashMap.java TIntShortIterator.java TIntShortProcedure.java TLongByteHashMap.java TLongByteIterator.java TLongByteProcedure.java TLongShortHashMap.java TLongShortIterator.java TLongShortProcedure.java TObjectByteHashMap.java TObjectByteIterator.java TObjectByteProcedure.java TObjectShortHashMap.java TObjectShortIterator.java TObjectShortProcedure.java TShortArrayList.java TShortByteHashMap.java TShortByteIterator.java TShortByteProcedure.java TShortDoubleHashMap.java TShortDoubleIterator.java TShortDoubleProcedure.java TShortFloatHashMap.java TShortFloatIterator.java TShortFloatProcedure.java TShortFunction.java TShortHash.java TShortHashSet.java TShortHashingStrategy.java TShortIntHashMap.java TShortIntIterator.java TShortIntProcedure.java TShortIterator.java TShortLongHashMap.java TShortLongIterator.java TShortLongProcedure.java TShortObjectHashMap.java TShortObjectIterator.java TShortObjectProcedure.java TShortProcedure.java TShortShortHashMap.java TShortShortIterator.java TShortShortProcedure.java Log Message: feature request 926921: null keys, byte/short collections --- NEW FILE: TByteArrayList.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2001, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove; import java.io.Serializable; import java.util.Arrays; import java.util.Random; /** * A resizable, array-backed list of byte primitives. * * Created: Sat Dec 29 14:21:12 2001 * * @author Eric D. Friedman * @version $Id: TByteArrayList.java,v 1.1 2004/11/09 15:48:45 ericdf Exp $ */ public class TByteArrayList implements Serializable, Cloneable { /** the data of the list */ protected byte[] _data; /** the index after the last entry in the list */ protected int _pos; /** the default capacity for new lists */ protected static final int DEFAULT_CAPACITY = 10; /** * Creates a new <code>TByteArrayList</code> instance with the * default capacity. */ public TByteArrayList() { this(DEFAULT_CAPACITY); } /** * Creates a new <code>TByteArrayList</code> instance with the * specified capacity. * * @param capacity an <code>int</code> value */ public TByteArrayList(int capacity) { _data = new byte[capacity]; _pos = 0; } /** * Creates a new <code>TByteArrayList</code> instance whose * capacity is the greater of the length of <tt>values</tt> and * DEFAULT_CAPACITY and whose initial contents are the specified * values. * * @param values an <code>byte[]</code> value */ public TByteArrayList(byte[] values) { this(Math.max(values.length, DEFAULT_CAPACITY)); add(values); } // sizing /** * Grow the internal array as needed to accomodate the specified * number of elements. The size of the array doubles on each * resize unless <tt>capacity</tt> requires more than twice the * current capacity. * * @param capacity an <code>int</code> value */ public void ensureCapacity(int capacity) { if (capacity > _data.length) { int newCap = Math.max(_data.length << 1, capacity); byte[] tmp = new byte[newCap]; System.arraycopy(_data, 0, tmp, 0, _data.length); _data = tmp; } } /** * Returns the number of values in the list. * * @return the number of values in the list. */ public int size() { return _pos; } /** * Tests whether this list contains any values. * * @return true if the list is empty. */ public boolean isEmpty() { return _pos == 0; } /** * Sheds any excess capacity above and beyond the current size of * the list. */ public void trimToSize() { if (_data.length > size()) { byte[] tmp = new byte[size()]; toNativeArray(tmp, 0, tmp.length); _data = tmp; } } // modifying /** * Adds <tt>val</tt> to the end of the list, growing as needed. * * @param val an <code>byte</code> value */ public void add(byte val) { ensureCapacity(_pos + 1); _data[_pos++] = val; } /** * Adds the values in the array <tt>vals</tt> to the end of the * list, in order. * * @param vals an <code>byte[]</code> value */ public void add(byte[] vals) { add(vals, 0, vals.length); } /** * Adds a subset of the values in the array <tt>vals</tt> to the * end of the list, in order. * * @param vals an <code>byte[]</code> value * @param offset the offset at which to start copying * @param length the number of values to copy. */ public void add(byte[] vals, int offset, int length) { ensureCapacity(_pos + length); System.arraycopy(vals, offset, _data, _pos, length); _pos += length; } /** * Inserts <tt>value</tt> into the list at <tt>offset</tt>. All * values including and to the right of <tt>offset</tt> are shifted * to the right. * * @param offset an <code>int</code> value * @param value an <code>byte</code> value */ public void insert(int offset, byte value) { if (offset == _pos) { add(value); return; } ensureCapacity(_pos + 1); // shift right System.arraycopy(_data, offset, _data, offset + 1, _pos - offset); // insert _data[offset] = value; _pos++; } /** * Inserts the array of <tt>values</tt> into the list at * <tt>offset</tt>. All values including and to the right of * <tt>offset</tt> are shifted to the right. * * @param offset an <code>int</code> value * @param values an <code>byte[]</code> value */ public void insert(int offset, byte[] values) { insert(offset, values, 0, values.length); } /** * Inserts a slice of the array of <tt>values</tt> into the list * at <tt>offset</tt>. All values including and to the right of * <tt>offset</tt> are shifted to the right. * * @param offset an <code>int</code> value * @param values an <code>byte[]</code> value * @param valOffset the offset in the values array at which to * start copying. * @param len the number of values to copy from the values array */ public void insert(int offset, byte[] values, int valOffset, int len) { if (offset == _pos) { add(values, valOffset, len); return; } ensureCapacity(_pos + len); // shift right System.arraycopy(_data, offset, _data, offset + len, _pos - offset); // insert System.arraycopy(values, valOffset, _data, offset, len); _pos += len; } /** * Returns the value at the specified offset. * * @param offset an <code>int</code> value * @return an <code>byte</code> value */ public byte get(int offset) { if (offset >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } return _data[offset]; } /** * Returns the value at the specified offset without doing any * bounds checking. * * @param offset an <code>int</code> value * @return an <code>byte</code> value */ public byte getQuick(int offset) { return _data[offset]; } /** * Sets the value at the specified offset. * * @param offset an <code>int</code> value * @param val an <code>byte</code> value */ public void set(int offset, byte val) { if (offset >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } _data[offset] = val; } /** * Sets the value at the specified offset and returns the * previously stored value. * * @param offset an <code>int</code> value * @param val an <code>byte</code> value * @return the value previously stored at offset. */ public byte getSet(int offset, byte val) { if (offset >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } byte old = _data[offset]; _data[offset] = val; return old; } /** * Replace the values in the list starting at <tt>offset</tt> with * the contents of the <tt>values</tt> array. * * @param offset the first offset to replace * @param values the source of the new values */ public void set(int offset, byte[] values) { set(offset, values, 0, values.length); } /** * Replace the values in the list starting at <tt>offset</tt> with * <tt>length</tt> values from the <tt>values</tt> array, starting * at valOffset. * * @param offset the first offset to replace * @param values the source of the new values * @param valOffset the first value to copy from the values array * @param length the number of values to copy */ public void set(int offset, byte[] values, int valOffset, int length) { if (offset < 0 || offset + length >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } System.arraycopy(values, valOffset, _data, offset, length); } /** * Sets the value at the specified offset without doing any bounds * checking. * * @param offset an <code>int</code> value * @param val an <code>byte</code> value */ public void setQuick(int offset, byte val) { _data[offset] = val; } /** * Flushes the internal state of the list, resetting the capacity * to the default. */ public void clear() { clear(DEFAULT_CAPACITY); } /** * Flushes the internal state of the list, setting the capacity of * the empty list to <tt>capacity</tt>. * * @param capacity an <code>int</code> value */ public void clear(int capacity) { _data = new byte[capacity]; _pos = 0; } /** * 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 clear} method if you want to recyle a list without * allocating new backing arrays. * * @see #clear */ public void reset() { _pos = 0; fill((byte)0); } /** * 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 clear} method if you want to recyle a list * without allocating new backing arrays. This method differs * from {@link #reset reset} in that it does not clear the old * values in the backing array. Thus, it is possible for {@link * #getQuick getQuick} to return stale data if this method is used * and the caller is careless about bounds checking. * * @see #reset * @see #clear * @see #getQuick */ public void resetQuick() { _pos = 0; } /** * Removes the value at <tt>offset</tt> from the list. * * @param offset an <code>int</code> value * @return the value previously stored at offset. */ public byte remove(int offset) { byte old = get(offset); remove(offset, 1); return old; } /** * Removes <tt>length</tt> values from the list, starting at * <tt>offset</tt> * * @param offset an <code>int</code> value * @param length an <code>int</code> value */ public void remove(int offset, int length) { if (offset < 0 || offset >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } if (offset == 0) { // data at the front System.arraycopy(_data, length, _data, 0, _pos - length); } else if (_pos - length == offset) { // no copy to make, decrementing pos "deletes" values at // the end } else { // data in the middle System.arraycopy(_data, offset + length, _data, offset, _pos - (offset + length)); } _pos -= length; // no need to clear old values beyond _pos, because this is a // primitive collection and 0 takes as much room as any other // value } /** * Transform each value in the list using the specified function. * * @param function a <code>TByteFunction</code> value */ public void transformValues(TByteFunction function) { for (int i = _pos; i-- > 0;) { _data[i] = function.execute(_data[i]); } } /** * Reverse the order of the elements in the list. */ public void reverse() { reverse(0, _pos); } /** * Reverse the order of the elements in the range of the list. * * @param from the inclusive index at which to start reversing * @param to the exclusive index at which to stop reversing */ public void reverse(int from, int to) { if (from == to) { return; // nothing to do } if (from > to) { throw new IllegalArgumentException("from cannot be greater than to"); } for (int i = from, j = to - 1; i < j; i++, j--) { swap(i, j); } } /** * Shuffle the elements of the list using the specified random * number generator. * * @param rand a <code>Random</code> value */ public void shuffle(Random rand) { for (int i = _pos; i-- > 1;) { swap(i, rand.nextInt(i)); } } /** * Swap the values at offsets <tt>i</tt> and <tt>j</tt>. * * @param i an offset into the data array * @param j an offset into the data array */ private final void swap(int i, int j) { byte tmp = _data[i]; _data[i] = _data[j]; _data[j] = tmp; } // copying /** * Returns a clone of this list. Since this is a primitive * collection, this will be a deep clone. * * @return a deep clone of the list. */ public Object clone() { Object o = null; try { o = super.clone(); } catch (CloneNotSupportedException e) { // it's supported } // end of try-catch return o; } /** * Copies the contents of the list into a native array. * * @return an <code>byte[]</code> value */ public byte[] toNativeArray() { return toNativeArray(0, _pos); } /** * Copies a slice of the list into a native array. * * @param offset the offset at which to start copying * @param len the number of values to copy. * @return an <code>byte[]</code> value */ public byte[] toNativeArray(int offset, int len) { byte[] rv = new byte[len]; toNativeArray(rv, offset, len); return rv; } /** * Copies a slice of the list into a native array. * * @param dest the array to copy into. * @param offset the offset of the first value to copy * @param len the number of values to copy. */ public void toNativeArray(byte[] dest, int offset, int len) { if (len == 0) { return; // nothing to copy } if (offset < 0 || offset >= _pos) { throw new ArrayIndexOutOfBoundsException(offset); } System.arraycopy(_data, 0, dest, offset, len); } // comparing /** * Compares this list to another list, value by value. * * @param other the object to compare against * @return true if other is a TByteArrayList and has exactly the * same values. */ public boolean equals(Object other) { if (other == this) { return true; } else if (other instanceof TByteArrayList) { TByteArrayList that = (TByteArrayList)other; if (that.size() != this.size()) { return false; } else { for (int i = _pos; i-- > 0;) { if (this._data[i] != that._data[i]) { return false; } } return true; } } else { return false; } } public int hashCode() { int h = 0; for (int i = _pos; i-- > 0;) { h += HashFunctions.hash(_data[i]); } return h; } // procedures /** * Applies the procedure to each value in the list in ascending * (front to back) order. * * @param procedure a <code>TByteProcedure</code> value * @return true if the procedure did not terminate prematurely. */ public boolean forEach(TByteProcedure procedure) { for (int i = 0; i < _pos; i++) { if (! procedure.execute(_data[i])) { return false; } } return true; } /** * Applies the procedure to each value in the list in descending * (back to front) order. * * @param procedure a <code>TByteProcedure</code> value * @return true if the procedure did not terminate prematurely. */ public boolean forEachDescending(TByteProcedure procedure) { for (int i = _pos; i-- > 0;) { if (! procedure.execute(_data[i])) { return false; } } return true; } // sorting /** * Sort the values in the list (ascending) using the Sun quicksort * implementation. * * @see java.util.Arrays#sort */ public void sort() { Arrays.sort(_data, 0, _pos); } /** * Sort a slice of the list (ascending) using the Sun quicksort * implementation. * * @param fromIndex the index at which to start sorting (inclusive) * @param toIndex the index at which to stop sorting (exclusive) * @see java.util.Arrays#sort */ public void sort(int fromIndex, int toIndex) { Arrays.sort(_data, fromIndex, toIndex); } // filling /** * Fills every slot in the list with the specified value. * * @param val the value to use when filling */ public void fill(byte val) { Arrays.fill(_data, 0, _pos, val); } /** * Fills a range in the list with the specified value. * * @param fromIndex the offset at which to start filling (inclusive) * @param toIndex the offset at which to stop filling (exclusive) * @param val the value to use when filling */ public void fill(int fromIndex, int toIndex, byte val) { if (toIndex > _pos) { ensureCapacity(toIndex); _pos = toIndex; } Arrays.fill(_data, fromIndex, toIndex, val); } // searching /** * Performs a binary search for <tt>value</tt> in the entire list. * Note that you <b>must</b> @{link #sort sort} the list before * doing a search. * * @param value the value to search for * @return the absolute offset in the list of the value, or its * negative insertion point into the sorted list. */ public int binarySearch(byte value) { return binarySearch(value, 0, _pos); } /** * Performs a binary search for <tt>value</tt> in the specified * range. Note that you <b>must</b> @{link #sort sort} the list * or the range before doing a search. * * @param value the value to search for * @param fromIndex the lower boundary of the range (inclusive) * @param toIndex the upper boundary of the range (exclusive) * @return the absolute offset in the list of the value, or its * negative insertion point into the sorted list. */ public int binarySearch(byte value, int fromIndex, int toIndex) { if (fromIndex < 0) { throw new ArrayIndexOutOfBoundsException(fromIndex); } if (toIndex > _pos) { throw new ArrayIndexOutOfBoundsException(toIndex); } int low = fromIndex; int high = toIndex - 1; while (low <= high) { int mid = (low + high) >> 1; byte midVal = _data[mid]; if (midVal < value) { low = mid + 1; } else if (midVal > value) { high = mid - 1; } else { return mid; // value found } } return -(low + 1); // value not found. } /** * Searches the list front to back for the index of * <tt>value</tt>. * * @param value an <code>byte</code> value * @return the first offset of the value, or -1 if it is not in * the list. * @see #binarySearch for faster searches on sorted lists */ public int indexOf(byte value) { return indexOf(0, value); } /** * Searches the list front to back for the index of * <tt>value</tt>, starting at <tt>offset</tt>. * * @param offset the offset at which to start the linear search * (inclusive) * @param value an <code>byte</code> value * @return the first offset of the value, or -1 if it is not in * the list. * @see #binarySearch for faster searches on sorted lists */ public int indexOf(int offset, byte value) { for (int i = offset; i < _pos; i++) { if (_data[i] == value) { return i; } } return -1; } /** * Searches the list back to front for the last index of * <tt>value</tt>. * * @param value an <code>byte</code> value * @return the last offset of the value, or -1 if it is not in * the list. * @see #binarySearch for faster searches on sorted lists */ public int lastIndexOf(byte value) { return lastIndexOf(_pos, value); } /** * Searches the list back to front for the last index of * <tt>value</tt>, starting at <tt>offset</tt>. * * @param offset the offset at which to start the linear search * (exclusive) * @param value an <code>byte</code> value * @return the last offset of the value, or -1 if it is not in * the list. * @see #binarySearch for faster searches on sorted lists */ public int lastIndexOf(int offset, byte value) { for (int i = offset; i-- > 0;) { if (_data[i] == value) { return i; } } return -1; } /** * Searches the list for <tt>value</tt> * * @param value an <code>byte</code> value * @return true if value is in the list. */ public boolean contains(byte value) { return lastIndexOf(value) >= 0; } /** * Searches the list for values satisfying <tt>condition</tt> in * the manner of the *nix <tt>grep</tt> utility. * * @param condition a condition to apply to each element in the list * @return a list of values which match the condition. */ public TByteArrayList grep(TByteProcedure condition) { TByteArrayList list = new TByteArrayList(); for (int i = 0; i < _pos; i++) { if (condition.execute(_data[i])) { list.add(_data[i]); } } return list; } /** * Searches the list for values which do <b>not</b> satisfy * <tt>condition</tt>. This is akin to *nix <code>grep -v</code>. * * @param condition a condition to apply to each element in the list * @return a list of values which do not match the condition. */ public TByteArrayList inverseGrep(TByteProcedure condition) { TByteArrayList list = new TByteArrayList(); for (int i = 0; i < _pos; i++) { if (! condition.execute(_data[i])) { list.add(_data[i]); } } return list; } /** * Finds the maximum value in the list. * * @return the largest value in the list. * @exception IllegalStateException if the list is empty */ public byte max() { if (size() == 0) { throw new IllegalStateException("cannot find maximum of an empty list"); } byte max = _data[_pos - 1]; for (int i = _pos - 1; i-- > 0;) { if (_data[i] > max) { max = _data[i]; } } return max; } /** * Finds the minimum value in the list. * * @return the smallest value in the list. * @exception IllegalStateException if the list is empty */ public byte min() { if (size() == 0) { throw new IllegalStateException("cannot find minimum of an empty list"); } byte min = _data[_pos - 1]; for (int i = _pos - 1; i-- > 0;) { if (_data[i] < min) { min = _data[i]; } } return min; } // stringification /** * Returns a String representation of the list, front to back. * * @return a <code>String</code> value */ public String toString() { StringBuffer buf = new StringBuffer("{"); for (int i = 0, end = _pos - 1; i < end; i++) { buf.append(_data[i]); buf.append(", "); } if (size() > 0) { buf.append(_data[_pos - 1]); } buf.append("}"); return buf.toString(); } } // TByteArrayList --- NEW FILE: TByteByteHashMap.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2001, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; /** * An open addressed Map implementation for byte keys and byte values. * * Created: Sun Nov 4 08:52:45 2001 * * @author Eric D. Friedman * @version $Id: TByteByteHashMap.java,v 1.1 2004/11/09 15:48:46 ericdf Exp $ */ public class TByteByteHashMap extends TByteHash implements Serializable { /** the values of the map */ protected transient byte[] _values; /** * Creates a new <code>TByteByteHashMap</code> instance with the default * capacity and load factor. */ public TByteByteHashMap() { super(); } /** * Creates a new <code>TByteByteHashMap</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 TByteByteHashMap(int initialCapacity) { super(initialCapacity); } /** * Creates a new <code>TByteByteHashMap</code> instance with a prime * capacity equal to or greater than <tt>initialCapacity</tt> and * with the specified load factor. * * @param initialCapacity an <code>int</code> value * @param loadFactor a <code>float</code> value */ public TByteByteHashMap(int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); } /** * Creates a new <code>TByteByteHashMap</code> instance with the default * capacity and load factor. * @param strategy used to compute hash codes and to compare keys. */ public TByteByteHashMap(TByteHashingStrategy strategy) { super(strategy); } /** * Creates a new <code>TByteByteHashMap</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 * @param strategy used to compute hash codes and to compare keys. */ public TByteByteHashMap(int initialCapacity, TByteHashingStrategy strategy) { super(initialCapacity, strategy); } /** * Creates a new <code>TByteByteHashMap</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 strategy used to compute hash codes and to compare keys. */ public TByteByteHashMap(int initialCapacity, float loadFactor, TByteHashingStrategy strategy) { super(initialCapacity, loadFactor, strategy); } /** * @return a deep clone of this collection */ public Object clone() { TByteByteHashMap m = (TByteByteHashMap)super.clone(); m._values = (byte[])this._values.clone(); return m; } /** * @return a TByteByteIterator with access to this map's keys and values */ public TByteByteIterator iterator() { return new TByteByteIterator(this); } /** * initializes the hashtable to a prime capacity which is at least * <tt>initialCapacity + 1</tt>. * * @param initialCapacity an <code>int</code> value * @return the actual capacity chosen */ protected int setUp(int initialCapacity) { int capacity; capacity = super.setUp(initialCapacity); _values = new byte[capacity]; return capacity; } /** * Inserts a key/value pair into the map. * * @param key an <code>byte</code> value * @param value an <code>byte</code> value * @return the previous value associated with <tt>key</tt>, * or (byte)0 if none was found. */ public byte put(byte key, byte value) { byte previousState; byte previous = (byte)0; int index = insertionIndex(key); boolean isNewMapping = true; if (index < 0) { index = -index -1; previous = _values[index]; isNewMapping = false; } previousState = _states[index]; _set[index] = key; _states[index] = FULL; _values[index] = value; if (isNewMapping) { postInsertHook(previousState == FREE); } return previous; } /** * rehashes the map to the new capacity. * * @param newCapacity an <code>int</code> value */ protected void rehash(int newCapacity) { int oldCapacity = _set.length; byte oldKeys[] = _set; byte oldVals[] = _values; byte oldStates[] = _states; _set = new byte[newCapacity]; _values = new byte[newCapacity]; _states = new byte[newCapacity]; for (int i = oldCapacity; i-- > 0;) { if(oldStates[i] == FULL) { byte o = oldKeys[i]; int index = insertionIndex(o); _set[index] = o; _values[index] = oldVals[i]; _states[index] = FULL; } } } /** * retrieves the value for <tt>key</tt> * * @param key an <code>byte</code> value * @return the value of <tt>key</tt> or (byte)0 if no such mapping exists. */ public byte get(byte key) { int index = index(key); return index < 0 ? (byte)0 : _values[index]; } /** * Empties the map. * */ public void clear() { super.clear(); byte[] keys = _set; byte[] vals = _values; byte[] states = _states; for (int i = keys.length; i-- > 0;) { keys[i] = (byte)0; vals[i] = (byte)0; states[i] = FREE; } } /** * Deletes a key/value pair from the map. * * @param key an <code>byte</code> value * @return an <code>byte</code> value, or (byte)0 if no mapping for key exists */ public byte remove(byte key) { byte prev = (byte)0; int index = index(key); if (index >= 0) { prev = _values[index]; removeAt(index); // clear key,state; adjust size } return prev; } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean equals(Object other) { if (! (other instanceof TByteByteHashMap)) { return false; } TByteByteHashMap that = (TByteByteHashMap)other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); } public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); } private final class HashProcedure implements TByteByteProcedure { private int h = 0; public int getHashCode() { return h; } public final boolean execute(byte key, byte value) { h += (_hashingStrategy.computeHashCode(key) ^ HashFunctions.hash(value)); return true; } } private static final class EqProcedure implements TByteByteProcedure { private final TByteByteHashMap _otherMap; EqProcedure(TByteByteHashMap otherMap) { _otherMap = otherMap; } public final boolean execute(byte key, byte value) { int index = _otherMap.index(key); if (index >= 0 && eq(value, _otherMap.get(key))) { return true; } return false; } /** * Compare two bytes for equality. */ private final boolean eq(byte v1, byte v2) { return v1 == v2; } } /** * removes the mapping at <tt>index</tt> from the map. * * @param index an <code>int</code> value */ protected void removeAt(int index) { super.removeAt(index); // clear key, state; adjust size _values[index] = (byte)0; } /** * Returns the values of the map. * * @return a <code>Collection</code> value */ public byte[] getValues() { byte[] vals = new byte[size()]; byte[] v = _values; byte[] states = _states; for (int i = v.length, j = 0; i-- > 0;) { if (states[i] == FULL) { vals[j++] = v[i]; } } return vals; } /** * returns the keys of the map. * * @return a <code>Set</code> value */ public byte[] keys() { byte[] keys = new byte[size()]; byte[] k = _set; byte[] states = _states; for (int i = k.length, j = 0; i-- > 0;) { if (states[i] == FULL) { keys[j++] = k[i]; } } return keys; } /** * checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>byte</code> value * @return a <code>boolean</code> value */ public boolean containsValue(byte val) { byte[] states = _states; byte[] vals = _values; for (int i = vals.length; i-- > 0;) { if (states[i] == FULL && val == vals[i]) { return true; } } return false; } /** * checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>byte</code> value * @return a <code>boolean</code> value */ public boolean containsKey(byte key) { return contains(key); } /** * Executes <tt>procedure</tt> for each key in the map. * * @param procedure a <code>TByteProcedure</code> value * @return false if the loop over the keys terminated because * the procedure returned false for some key. */ public boolean forEachKey(TByteProcedure procedure) { return forEach(procedure); } /** * Executes <tt>procedure</tt> for each value in the map. * * @param procedure a <code>TByteProcedure</code> value * @return false if the loop over the values terminated because * the procedure returned false for some value. */ public boolean forEachValue(TByteProcedure procedure) { byte[] states = _states; byte[] values = _values; for (int i = values.length; i-- > 0;) { if (states[i] == FULL && ! procedure.execute(values[i])) { return false; } } return true; } /** * Executes <tt>procedure</tt> for each key/value entry in the * map. * * @param procedure a <code>TOByteByteProcedure</code> value * @return false if the loop over the entries terminated because * the procedure returned false for some entry. */ public boolean forEachEntry(TByteByteProcedure procedure) { byte[] states = _states; byte[] keys = _set; byte[] values = _values; for (int i = keys.length; i-- > 0;) { if (states[i] == FULL && ! procedure.execute(keys[i],values[i])) { return false; } } return true; } /** * Retains only those entries in the map for which the procedure * returns a true value. * * @param procedure determines which entries to keep * @return true if the map was modified. */ public boolean retainEntries(TByteByteProcedure procedure) { boolean modified = false; byte[] states = _states; byte[] keys = _set; byte[] values = _values; for (int i = keys.length; i-- > 0;) { if (states[i] == FULL && ! procedure.execute(keys[i],values[i])) { removeAt(i); modified = true; } } return modified; } /** * Transform the values in this map using <tt>function</tt>. * * @param function a <code>TByteFunction</code> value */ public void transformValues(TByteFunction function) { byte[] states = _states; byte[] values = _values; for (int i = values.length; i-- > 0;) { if (states[i] == FULL) { values[i] = function.execute(values[i]); } } } /** * Increments the primitive value mapped to key by 1 * * @param key the key of the value to increment * @return true if a mapping was found and modified. */ public boolean increment(byte key) { return adjustValue(key, (byte)1); } /** * Adjusts the primitive value mapped to key. * * @param key the key of the value to increment * @param amount the amount to adjust the value by. * @return true if a mapping was found and modified. */ public boolean adjustValue(byte key, byte amount) { int index = index(key); if (index < 0) { return false; } else { _values[index] += amount; return true; } } private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); // number of entries stream.writeInt(_size); SerializationProcedure writeProcedure = new SerializationProcedure(stream); if (! forEachEntry(writeProcedure)) { throw writeProcedure.exception; } } private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int size = stream.readInt(); setUp(size); while (size-- > 0) { byte key = stream.readByte(); byte val = stream.readByte(); put(key, val); } } } // TByteByteHashMap --- NEW FILE: TByteByteIterator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2001, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove; /** * Iterator for maps of type byte and byte. * * <p>The iterator semantics for Trove's primitive maps is slightly different * from those defined in <tt>java.util.Iterator</tt>, but still well within * the scope of the pattern, as defined by Gamma, et al.</p> * * <p>This iterator does <b>not</b> implicitly advance to the next entry when * the value at the current position is retrieved. Rather, you must explicitly * ask the iterator to <tt>advance()</tt> and then retrieve either the <tt>key()</tt>, * the <tt>value()</tt> or both. This is done so that you have the option, but not * the obligation, to retrieve keys and/or values as your application requires, and * without introducing wrapper objects that would carry both. As the iteration is * stateful, access to the key/value parts of the current map entry happens in * constant time.</p> * * <p>In practice, the iterator is akin to a "search finger" that you move from * position to position. Read or write operations affect the current entry only and * do not assume responsibility for moving the finger.</p> * * <p>Here are some sample scenarios for this class of iterator:</p> * * <pre> * // accessing keys/values through an iterator: * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { * it.forward(); * if (satisfiesCondition(it.key()) { * doSomethingWithValue(it.value()); * } * } * </pre> * * <pre> * // modifying values in-place through iteration: * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { * it.forward(); * if (satisfiesCondition(it.key()) { * it.setValue(newValueForKey(it.key())); * } * } * </pre> * * <pre> * // deleting entries during iteration: * for (TByteByteIterator it = map.iterator(); * it.hasNext();) { * it.forward(); * if (satisfiesCondition(it.key()) { * it.remove(); * } * } * </pre> * * <pre> * // faster iteration by avoiding hasNext(): * TByteByteIterator iterator = map.iterator(); * for (int i = map.size(); i-- > 0;) { * iterator.advance(); * doSomethingWithKeyAndValue(iterator.key(), iterator.value()); * } * </pre> * * @author Eric D. Friedman * @version $Id: TByteByteIterator.java,v 1.1 2004/11/09 15:48:46 ericdf Exp $ */ public class TByteByteIterator extends TPrimitiveIterator { /** the collection being iterated over */ private final TByteByteHashMap _map; /** * Creates an iterator over the specified map */ public TByteByteIterator(TByteByteHashMap map) { super(map); this._map = map; } /** * Moves the iterator forward to the next entry in the underlying map. * * @exception NoSuchElementException if the iterator is already exhausted */ public void advance() { moveToNextIndex(); } /** * Provides access to the key of the mapping at the iterator's position. * Note that you must <tt>advance()</tt> the iterator at least once * before invoking this method. * * @return the key of the entry at the iterator's current position. */ public byte key() { return _map._set[_index]; } /** * Provides access to the value of the mapping at the iterator's position. * Note that you must <tt>advance()</tt> the iterator at least once * before invoking this method. * * @return the value of the entry at the iterator's current position. */ public byte value() { return _map._values[_index]; } /** * Replace the value of the mapping at the iterator's position with the * specified value. Note that you must <tt>advance()</tt> the iterator at * least once before invoking this method. * * @param val the value to set in the current entry * @return the old value of the entry. */ public byte setValue(byte val) { byte old = value(); _map._values[_index] = val; return old; } }// TByteByteIterator --- NEW FILE: TByteByteProcedure.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2001, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove; /** * Interface for procedures that take two parameters of type byte and byte. * * Created: Mon Nov 5 22:03:30 2001 * * @author Eric D. Friedman * @version $Id: TByteByteProcedure.java,v 1.1 2004/11/09 15:48:46 ericdf Exp $ */ public interface TByteByteProcedure { /** * Executes this procedure. A false return value indicates that * the application executing this procedure should not invoke this * procedure again. * * @param a an <code>byte</code> value * @param b an <code>byte</code> value * @return true if additional invocations of the procedure are * allowed. */ public boolean execute(byte a, byte b); }// TByteByteProcedure --- NEW FILE: TByteDoubleHashMap.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2001, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; /** * An open addressed Map implementation for byte keys and double values. * * Created: Sun Nov 4 08:52:45 2001 * * @author Eric D. Friedman * @version $Id: TByteDoubleHashMap.java,v 1.1 2004/11/09 15:48:46 ericdf Exp $ */ public class TByteDoubleHashMap extends TByteHash implements Serializable { /** the values of the map */ protected transient double[] _values; /** * Creates a new <code>TByteDoubleHashMap</code> instance with the default * capacity and load factor. */ public TByteDoubleHashMap() { super(); } /** * Creates a new <code>TByteDoubleHashMap</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 TByteDoubleHashMap(int initialCapacity) { super(initialCapacity); } /** * Creates a new <code>TByteDoubleHashMap</code> instance with a prime * capacity equal to or greater than <tt>initialCapacity</tt> and * with the specified load factor. * * @param initialCapacity an <code>int</code> value * @param loadFactor a <code>float</code> value */ public TByteDoubleHashMap(int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); } /** * Creates a new <code>TByteDoubleHashMap</code> instance with the default * capacity and load factor. * @param strategy used to compute hash codes and to compare keys. */ public TByteDoubleHashMap(TByteHashingStrategy strategy) { super(strategy); } /** * Creates a new <code>TByteDoubleHashMap</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 * @param strategy used to compute hash codes and to compare keys. */ public TByteDoubleHashMap(int initialCapacity, TByteHashingStrategy strategy) { super(initialCapacity, strategy); } /** * Creates a new <code>TByteDoubleHashMap</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 strategy used to compute hash codes and to compare keys. */ public TByteDoubleHashMap(int initialCapacity, float loadFactor, TByteHashingStrategy strategy) { super(initialCapacity, loadFactor, strategy); } /** * @return a deep clone of this collection */ public Object clone() { TByteDoubleHashMap m = (TByteDoubleHashMap)super.clone(); m._values = (double[])this._values.clone(); return m; } /** * @return a TByteDoubleIterator with access to this map's keys and values */ public TByteDoubleIterator iterator() { return new TByteDoubleIterator(this); } /** * initializes the hashtable to a prime capacity which is at least * <tt>initialCapacity + 1</tt>. * * @param initialCapacity an <code>int</code> value * @return the actual capacity chosen */ protected int setUp(int initialCapacity) { int capacity; capacity = super.setUp(initialCapacity); _values = new double[capacity]; return capacity; } /** * Inserts a key/value pair into the map. * * @param key an <code>byte</code> value * @param value an <code>double</code> value * @return the previous value associated with <tt>key</tt>, * or (double)0 if none was found. */ public double put(byte key, double value) { byte previousState; double previous = (double)0; int index = insertionIndex(key); boolean isNewMapping = true; if (index < 0) { index = -index -1; previous = _values[index]; isNewMapping = false; } previousState = _states[index]; _set[index] = key; _states[index] = FULL; _values[index] = value; if (isNewMapping) { postInsertHook(previousState == FREE); } return previous; } /** * rehashes the map to the new capacity. * * @param newCapacity an <code>int</code> value */ protected void rehash(int newCapacity) { int oldCapacity = _set.length; byte oldKeys[] = _set; double oldVals[] = _values; byte oldStates[] = _states; _set = new byte[newCapacity]; _values = new double[newCapacity]; _states = new byte[newCapacity]; for (int i = oldCapacity; i-- > 0;) { if(oldStates[i] == FULL) { byte o = oldKeys[i]; int index = insertionIndex(o); _set[index] = o; _values[index] = oldVals[i]; _states[index] = FULL; } } } /** * retrieves the value for <tt>key</tt> * * @param key an <code>byte</code> value * @return the value of <tt>key</tt> or (double)0 if no such mapping exists. */ public double get(byte key) { int index = index(key); return index < 0 ? (double)0 : _values[index]; } /** * Empties the map. * */ public void clear() { super.clear(); byte[] keys = _set; double[] vals = _values; byte[] states = _states; for (int i = keys.length; i-- > 0;) { keys[i] = (byte)0; vals[i] = (double)0; states[i] = FREE; } } /** * Deletes a key/value pair from the map. * * @param key an <code>byte</code> value * @return an <code>double</code> value, or (double)0 if no mapping for key exists */ public double remove(byte key) { double prev = (double)0; int index = index(key); if (index >= 0) { prev = _values[index]; removeAt(index); // clear key,state; adjust size } return prev; } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean equals(Object other) { if (! (other instanceof TByteDoubleHashMap)) { return false; } TByteDoubleHashMap that = (TByteDoubleHashMap)other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); } public int hashCode() { HashProcedure p = new HashProcedure(); forEachEntry(p); return p.getHashCode(); } private final class HashProcedure implements TByteDoubleProcedure { private int h = 0; public int getHashCode() { return h; } public final boolean execute(byte key, double value) { h += (_hashingStrategy.computeHashCode(key) ^ HashFunctions.hash(value)); return true; } }... [truncated message content] |
From: Eric F. <er...@us...> - 2004-11-09 15:49:25
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29171 Modified Files: ChangeLog build.xml Log Message: feature request 926921: null keys, byte/short collections Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ChangeLog 18 Mar 2004 15:30:34 -0000 1.26 --- ChangeLog 9 Nov 2004 15:48:45 -0000 1.27 *************** *** 1,2 **** --- 1,10 ---- + v 1.1b4 + + Accepted patch for feature request 926921 - adds support for short, + byte collections. Also adds support for null object keys. THIS + WILL BREAK SERIALIZATION. + + A big thanks to Steven Lunt for putting this patch together. + v 1.1b3 Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** build.xml 18 Mar 2004 15:30:34 -0000 1.32 --- build.xml 9 Nov 2004 15:48:45 -0000 1.33 *************** *** 10,15 **** <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="1.1b3"/> ! <property name="year" value="2001-2003"/> <echo message="----------- ${Name} ${version} [${year}] ------------"/> --- 10,15 ---- <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="1.1b4"/> ! <property name="year" value="2001-2004"/> <echo message="----------- ${Name} ${version} [${year}] ------------"/> |
Update of /cvsroot/trove4j/trove/src/gnu/trove/decorator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29171/src/gnu/trove/decorator Modified Files: TDoubleDoubleHashMapDecorator.java TDoubleFloatHashMapDecorator.java TDoubleHashSetDecorator.java TDoubleIntHashMapDecorator.java TDoubleLongHashMapDecorator.java TDoubleObjectHashMapDecorator.java TFloatDoubleHashMapDecorator.java TFloatFloatHashMapDecorator.java TFloatHashSetDecorator.java TFloatIntHashMapDecorator.java TFloatLongHashMapDecorator.java TFloatObjectHashMapDecorator.java TIntDoubleHashMapDecorator.java TIntFloatHashMapDecorator.java TIntHashSetDecorator.java TIntIntHashMapDecorator.java TIntLongHashMapDecorator.java TIntObjectHashMapDecorator.java TLongDoubleHashMapDecorator.java TLongFloatHashMapDecorator.java TLongHashSetDecorator.java TLongIntHashMapDecorator.java TLongLongHashMapDecorator.java TLongObjectHashMapDecorator.java TObjectDoubleHashMapDecorator.java TObjectFloatHashMapDecorator.java TObjectIntHashMapDecorator.java TObjectLongHashMapDecorator.java gen_map_decorators.pl gen_set_decorators.pl Added Files: TByteByteHashMapDecorator.java TByteDoubleHashMapDecorator.java TByteFloatHashMapDecorator.java TByteHashSetDecorator.java TByteIntHashMapDecorator.java TByteLongHashMapDecorator.java TByteObjectHashMapDecorator.java TByteShortHashMapDecorator.java TDoubleByteHashMapDecorator.java TDoubleShortHashMapDecorator.java TFloatByteHashMapDecorator.java TFloatShortHashMapDecorator.java TIntByteHashMapDecorator.java TIntShortHashMapDecorator.java TLongByteHashMapDecorator.java TLongShortHashMapDecorator.java TObjectByteHashMapDecorator.java TObjectShortHashMapDecorator.java TShortByteHashMapDecorator.java TShortDoubleHashMapDecorator.java TShortFloatHashMapDecorator.java TShortHashSetDecorator.java TShortIntHashMapDecorator.java TShortLongHashMapDecorator.java TShortObjectHashMapDecorator.java TShortShortHashMapDecorator.java Log Message: feature request 926921: null keys, byte/short collections --- NEW FILE: TByteByteHashMapDecorator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove.decorator; import gnu.trove.TByteByteHashMap; import gnu.trove.TByteByteIterator; import java.util.AbstractMap; import java.util.AbstractSet; import java.util.Collection; import java.util.Iterator; import java.util.Map.Entry; import java.util.Map; import java.util.Set; /** * Wrapper class to make a TByteByteHashMap conform to the <tt>java.util.Map</tt> API. * This class simply decorates an underlying TByteByteHashMap and translates the Object-based * APIs into their Trove primitive analogs. * * <p> * Note that wrapping and unwrapping primitive values is extremely inefficient. If * possible, users of this class should override the appropriate methods in this class * and use a table of canonical values. * </p> * * Created: Mon Sep 23 22:07:40 PDT 2002 * * @author Eric D. Friedman * @version $Id: TByteByteHashMapDecorator.java,v 1.1 2004/11/09 15:48:50 ericdf Exp $ * @since trove 0.1.8 */ public class TByteByteHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ protected TByteByteHashMap _map; /** * Creates a wrapper that decorates the specified primitive map. */ public TByteByteHashMapDecorator(TByteByteHashMap map) { super(); this._map = map; } /** * Clones the underlying trove collection and returns the clone wrapped in a new * decorator instance. This is a shallow clone except where primitives are * concerned. * * @return a copy of the receiver */ public Object clone() { try { TByteByteHashMapDecorator copy = (TByteByteHashMapDecorator) super.clone(); copy._map = (TByteByteHashMap)_map.clone(); return copy; } catch (CloneNotSupportedException e) { // assert(false); throw new InternalError(); // we are cloneable, so this does not happen } } /** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return true if the maps are identical */ public boolean equals(Object other) { if (_map.equals(other)) { return true; // comparing two trove maps } else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way Iterator it = that.entrySet().iterator(); for (int i = that.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); Object key = e.getKey(); Object val = e.getValue(); if (key instanceof Byte && val instanceof Byte) { byte k = unwrapKey(key); byte v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) { // match, ok to continue } else { return false; // no match: we're done } } else { return false; // different type in other map } } return true; // all entries match } } else { return false; } } /** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Object get(Object key) { byte k = unwrapKey(key); byte v = _map.get(k); // 0 may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if (v == 0) { return _map.containsKey(k) ? wrapValue(v) : null; } else { return wrapValue(v); } } /** * Empties the map. */ public void clear() { this._map.clear(); } /** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or Integer(0) if it was not found in the map */ public Object remove(Object key) { return wrapValue(_map.remove(unwrapKey(key))); } /** * Returns a Set view on the entries of the map. * * @return a <code>Set</code> value */ public Set entrySet() { return new AbstractSet() { public int size() { return _map.size(); } public boolean isEmpty() { return TByteByteHashMapDecorator.this.isEmpty(); } public boolean contains(Object o) { if (o instanceof Map.Entry) { Object k = ((Map.Entry)o).getKey(); Object v = ((Map.Entry)o).getValue(); return (TByteByteHashMapDecorator.this.containsKey(k) && TByteByteHashMapDecorator.this.get(k).equals(v)); } else { return false; } } public Iterator iterator() { return new Iterator() { private final TByteByteIterator it = _map.iterator(); public Object next() { it.advance(); final Object key = wrapKey(it.key()); final Object v = wrapValue(it.value()); return new Map.Entry() { private Object val = v; public boolean equals(Object o) { return ((o instanceof Map.Entry) && ((Map.Entry)o).getKey().equals(key) && ((Map.Entry)o).getValue().equals(val)); } public Object getKey() { return key; } public Object getValue() { return val; } public int hashCode() { return key.hashCode() + val.hashCode(); } public Object setValue(Object value) { val = value; return put(key, value); } }; } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; } public boolean add(Object o) { throw new UnsupportedOperationException(); } public boolean remove(Object o) { throw new UnsupportedOperationException(); } public boolean addAll(Collection c) { throw new UnsupportedOperationException(); } public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); } public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); } public void clear() { TByteByteHashMapDecorator.this.clear(); } }; } /** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { return _map.containsValue(unwrapValue(val)); } /** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey(Object key) { return _map.containsKey(unwrapKey(key)); } /** * Returns the number of entries in the map. * @return the map's size. */ public int size() { return this._map.size(); } /** * Indicates whether map has any entries. * @return true if the map is empty */ public boolean isEmpty() { return (size() == 0); } /** * Copies the key/value mappings in <tt>map</tt> into this map. * Note that this will be a <b>deep</b> copy, as storage is by * primitive value. * * @param map a <code>Map</code> value */ public void putAll(Map map) { Iterator it = map.entrySet().iterator(); for (int i = map.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); this.put(e.getKey(), e.getValue()); } } /** * Wraps a key * * @param a key in the underlying map * @return an Object representation of the key */ protected Byte wrapKey(byte k) { return new Byte(k); } /** * Unwraps a key * * @param a wrapped key * @return an unwrapped representation of the key */ protected byte unwrapKey(Object key) { return ((Byte)key).byteValue(); } /** * Wraps a value * * @param a value in the underlying map * @return an Object representation of the value */ protected Byte wrapValue(byte k) { return new Byte(k); } /** * Unwraps a value * * @param a wrapped value * @return an unwrapped representation of the value */ protected byte unwrapValue(Object value) { return ((Byte)value).byteValue(); } } // TByteByteHashMapDecorator --- NEW FILE: TByteDoubleHashMapDecorator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove.decorator; import gnu.trove.TByteDoubleHashMap; import gnu.trove.TByteDoubleIterator; import java.util.AbstractMap; import java.util.AbstractSet; import java.util.Collection; import java.util.Iterator; import java.util.Map.Entry; import java.util.Map; import java.util.Set; /** * Wrapper class to make a TByteDoubleHashMap conform to the <tt>java.util.Map</tt> API. * This class simply decorates an underlying TByteDoubleHashMap and translates the Object-based * APIs into their Trove primitive analogs. * * <p> * Note that wrapping and unwrapping primitive values is extremely inefficient. If * possible, users of this class should override the appropriate methods in this class * and use a table of canonical values. * </p> * * Created: Mon Sep 23 22:07:40 PDT 2002 * * @author Eric D. Friedman * @version $Id: TByteDoubleHashMapDecorator.java,v 1.1 2004/11/09 15:48:50 ericdf Exp $ * @since trove 0.1.8 */ public class TByteDoubleHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ protected TByteDoubleHashMap _map; /** * Creates a wrapper that decorates the specified primitive map. */ public TByteDoubleHashMapDecorator(TByteDoubleHashMap map) { super(); this._map = map; } /** * Clones the underlying trove collection and returns the clone wrapped in a new * decorator instance. This is a shallow clone except where primitives are * concerned. * * @return a copy of the receiver */ public Object clone() { try { TByteDoubleHashMapDecorator copy = (TByteDoubleHashMapDecorator) super.clone(); copy._map = (TByteDoubleHashMap)_map.clone(); return copy; } catch (CloneNotSupportedException e) { // assert(false); throw new InternalError(); // we are cloneable, so this does not happen } } /** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return true if the maps are identical */ public boolean equals(Object other) { if (_map.equals(other)) { return true; // comparing two trove maps } else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way Iterator it = that.entrySet().iterator(); for (int i = that.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); Object key = e.getKey(); Object val = e.getValue(); if (key instanceof Byte && val instanceof Double) { byte k = unwrapKey(key); double v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) { // match, ok to continue } else { return false; // no match: we're done } } else { return false; // different type in other map } } return true; // all entries match } } else { return false; } } /** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Object get(Object key) { byte k = unwrapKey(key); double v = _map.get(k); // 0 may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if (v == 0) { return _map.containsKey(k) ? wrapValue(v) : null; } else { return wrapValue(v); } } /** * Empties the map. */ public void clear() { this._map.clear(); } /** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or Integer(0) if it was not found in the map */ public Object remove(Object key) { return wrapValue(_map.remove(unwrapKey(key))); } /** * Returns a Set view on the entries of the map. * * @return a <code>Set</code> value */ public Set entrySet() { return new AbstractSet() { public int size() { return _map.size(); } public boolean isEmpty() { return TByteDoubleHashMapDecorator.this.isEmpty(); } public boolean contains(Object o) { if (o instanceof Map.Entry) { Object k = ((Map.Entry)o).getKey(); Object v = ((Map.Entry)o).getValue(); return (TByteDoubleHashMapDecorator.this.containsKey(k) && TByteDoubleHashMapDecorator.this.get(k).equals(v)); } else { return false; } } public Iterator iterator() { return new Iterator() { private final TByteDoubleIterator it = _map.iterator(); public Object next() { it.advance(); final Object key = wrapKey(it.key()); final Object v = wrapValue(it.value()); return new Map.Entry() { private Object val = v; public boolean equals(Object o) { return ((o instanceof Map.Entry) && ((Map.Entry)o).getKey().equals(key) && ((Map.Entry)o).getValue().equals(val)); } public Object getKey() { return key; } public Object getValue() { return val; } public int hashCode() { return key.hashCode() + val.hashCode(); } public Object setValue(Object value) { val = value; return put(key, value); } }; } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; } public boolean add(Object o) { throw new UnsupportedOperationException(); } public boolean remove(Object o) { throw new UnsupportedOperationException(); } public boolean addAll(Collection c) { throw new UnsupportedOperationException(); } public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); } public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); } public void clear() { TByteDoubleHashMapDecorator.this.clear(); } }; } /** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { return _map.containsValue(unwrapValue(val)); } /** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey(Object key) { return _map.containsKey(unwrapKey(key)); } /** * Returns the number of entries in the map. * @return the map's size. */ public int size() { return this._map.size(); } /** * Indicates whether map has any entries. * @return true if the map is empty */ public boolean isEmpty() { return (size() == 0); } /** * Copies the key/value mappings in <tt>map</tt> into this map. * Note that this will be a <b>deep</b> copy, as storage is by * primitive value. * * @param map a <code>Map</code> value */ public void putAll(Map map) { Iterator it = map.entrySet().iterator(); for (int i = map.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); this.put(e.getKey(), e.getValue()); } } /** * Wraps a key * * @param a key in the underlying map * @return an Object representation of the key */ protected Byte wrapKey(byte k) { return new Byte(k); } /** * Unwraps a key * * @param a wrapped key * @return an unwrapped representation of the key */ protected byte unwrapKey(Object key) { return ((Byte)key).byteValue(); } /** * Wraps a value * * @param a value in the underlying map * @return an Object representation of the value */ protected Double wrapValue(double k) { return new Double(k); } /** * Unwraps a value * * @param a wrapped value * @return an unwrapped representation of the value */ protected double unwrapValue(Object value) { return ((Double)value).doubleValue(); } } // TByteDoubleHashMapDecorator --- NEW FILE: TByteFloatHashMapDecorator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove.decorator; import gnu.trove.TByteFloatHashMap; import gnu.trove.TByteFloatIterator; import java.util.AbstractMap; import java.util.AbstractSet; import java.util.Collection; import java.util.Iterator; import java.util.Map.Entry; import java.util.Map; import java.util.Set; /** * Wrapper class to make a TByteFloatHashMap conform to the <tt>java.util.Map</tt> API. * This class simply decorates an underlying TByteFloatHashMap and translates the Object-based * APIs into their Trove primitive analogs. * * <p> * Note that wrapping and unwrapping primitive values is extremely inefficient. If * possible, users of this class should override the appropriate methods in this class * and use a table of canonical values. * </p> * * Created: Mon Sep 23 22:07:40 PDT 2002 * * @author Eric D. Friedman * @version $Id: TByteFloatHashMapDecorator.java,v 1.1 2004/11/09 15:48:50 ericdf Exp $ * @since trove 0.1.8 */ public class TByteFloatHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ protected TByteFloatHashMap _map; /** * Creates a wrapper that decorates the specified primitive map. */ public TByteFloatHashMapDecorator(TByteFloatHashMap map) { super(); this._map = map; } /** * Clones the underlying trove collection and returns the clone wrapped in a new * decorator instance. This is a shallow clone except where primitives are * concerned. * * @return a copy of the receiver */ public Object clone() { try { TByteFloatHashMapDecorator copy = (TByteFloatHashMapDecorator) super.clone(); copy._map = (TByteFloatHashMap)_map.clone(); return copy; } catch (CloneNotSupportedException e) { // assert(false); throw new InternalError(); // we are cloneable, so this does not happen } } /** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return true if the maps are identical */ public boolean equals(Object other) { if (_map.equals(other)) { return true; // comparing two trove maps } else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way Iterator it = that.entrySet().iterator(); for (int i = that.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); Object key = e.getKey(); Object val = e.getValue(); if (key instanceof Byte && val instanceof Float) { byte k = unwrapKey(key); float v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) { // match, ok to continue } else { return false; // no match: we're done } } else { return false; // different type in other map } } return true; // all entries match } } else { return false; } } /** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Object get(Object key) { byte k = unwrapKey(key); float v = _map.get(k); // 0 may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if (v == 0) { return _map.containsKey(k) ? wrapValue(v) : null; } else { return wrapValue(v); } } /** * Empties the map. */ public void clear() { this._map.clear(); } /** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or Integer(0) if it was not found in the map */ public Object remove(Object key) { return wrapValue(_map.remove(unwrapKey(key))); } /** * Returns a Set view on the entries of the map. * * @return a <code>Set</code> value */ public Set entrySet() { return new AbstractSet() { public int size() { return _map.size(); } public boolean isEmpty() { return TByteFloatHashMapDecorator.this.isEmpty(); } public boolean contains(Object o) { if (o instanceof Map.Entry) { Object k = ((Map.Entry)o).getKey(); Object v = ((Map.Entry)o).getValue(); return (TByteFloatHashMapDecorator.this.containsKey(k) && TByteFloatHashMapDecorator.this.get(k).equals(v)); } else { return false; } } public Iterator iterator() { return new Iterator() { private final TByteFloatIterator it = _map.iterator(); public Object next() { it.advance(); final Object key = wrapKey(it.key()); final Object v = wrapValue(it.value()); return new Map.Entry() { private Object val = v; public boolean equals(Object o) { return ((o instanceof Map.Entry) && ((Map.Entry)o).getKey().equals(key) && ((Map.Entry)o).getValue().equals(val)); } public Object getKey() { return key; } public Object getValue() { return val; } public int hashCode() { return key.hashCode() + val.hashCode(); } public Object setValue(Object value) { val = value; return put(key, value); } }; } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; } public boolean add(Object o) { throw new UnsupportedOperationException(); } public boolean remove(Object o) { throw new UnsupportedOperationException(); } public boolean addAll(Collection c) { throw new UnsupportedOperationException(); } public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); } public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); } public void clear() { TByteFloatHashMapDecorator.this.clear(); } }; } /** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { return _map.containsValue(unwrapValue(val)); } /** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey(Object key) { return _map.containsKey(unwrapKey(key)); } /** * Returns the number of entries in the map. * @return the map's size. */ public int size() { return this._map.size(); } /** * Indicates whether map has any entries. * @return true if the map is empty */ public boolean isEmpty() { return (size() == 0); } /** * Copies the key/value mappings in <tt>map</tt> into this map. * Note that this will be a <b>deep</b> copy, as storage is by * primitive value. * * @param map a <code>Map</code> value */ public void putAll(Map map) { Iterator it = map.entrySet().iterator(); for (int i = map.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); this.put(e.getKey(), e.getValue()); } } /** * Wraps a key * * @param a key in the underlying map * @return an Object representation of the key */ protected Byte wrapKey(byte k) { return new Byte(k); } /** * Unwraps a key * * @param a wrapped key * @return an unwrapped representation of the key */ protected byte unwrapKey(Object key) { return ((Byte)key).byteValue(); } /** * Wraps a value * * @param a value in the underlying map * @return an Object representation of the value */ protected Float wrapValue(float k) { return new Float(k); } /** * Unwraps a value * * @param a wrapped value * @return an unwrapped representation of the value */ protected float unwrapValue(Object value) { return ((Float)value).floatValue(); } } // TByteFloatHashMapDecorator --- NEW FILE: TByteHashSetDecorator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove.decorator; import gnu.trove.TByteHashSet; import gnu.trove.TByteIterator; import java.util.AbstractSet; import java.util.Collection; import java.util.Iterator; import java.util.Set; /** * Wrapper class to make a TByteHashSet conform to the <tt>java.util.Set</tt> API. * This class simply decorates an underlying TByteHashSet and translates the Object-based * APIs into their Trove primitive analogs. * * <p> * Note that wrapping and unwrapping primitive values is extremely inefficient. If * possible, users of this class should override the appropriate methods in this class * and use a table of canonical values. * </p> * * Created: Tue Sep 24 22:08:17 PDT 2002 * * @author Eric D. Friedman * @version $Id: TByteHashSetDecorator.java,v 1.1 2004/11/09 15:48:50 ericdf Exp $ * @since trove 0.1.8 */ public class TByteHashSetDecorator extends AbstractSet implements Set, Cloneable { /** the wrapped primitive set */ protected TByteHashSet _set; /** * Creates a wrapper that decorates the specified primitive set. */ public TByteHashSetDecorator(TByteHashSet set) { super(); this._set = set; } /** * Clones the underlying trove collection and returns the clone wrapped in a new * decorator instance. This is a shallow clone except where primitives are * concerned. * * @return a copy of the receiver */ public Object clone() { try { TByteHashSetDecorator copy = (TByteHashSetDecorator) super.clone(); copy._set = (TByteHashSet) _set.clone(); return copy; } catch (CloneNotSupportedException e) { // assert(false); throw new InternalError(); // we are cloneable } } /** * Inserts a value into the set. * * @param true if the set was modified by the insertion */ public boolean add(Object value) { return _set.add(unwrap(value)); } /** * Compares this set with another set for equality of their stored * entries. * * @param other an <code>Object</code> value * @return true if the sets are identical */ public boolean equals(Object other) { if (_set.equals(other)) { return true; // comparing two trove sets } else if (other instanceof Set) { Set that = (Set)other; if (that.size() != _set.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way Iterator it = that.iterator(); for (int i = that.size(); i-- > 0;) { Object val = it.next(); if (val instanceof Byte) { byte v = unwrap(val); if (_set.contains(v)) { // match, ok to continue } else { return false; // no match: we're done } } else { return false; // different type in other set } } return true; // all entries match } } else { return false; } } /** * Empties the set. */ public void clear() { this._set.clear(); } /** * Deletes a value from the set. * * @param value an <code>Object</code> value * @return true if the set was modified */ public boolean remove(Object value) { return _set.remove(unwrap(value)); } /** * Creates an iterator over the values of the set. * * @return an iterator with support for removals in the underlying set */ public Iterator iterator() { return new Iterator() { private final TByteIterator it = _set.iterator(); public Object next() { return wrap(it.next()); } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; } /** * Returns the number of entries in the set. * @return the set's size. */ public int size() { return this._set.size(); } /** * Indicates whether set has any entries. * @return true if the set is empty */ public boolean isEmpty() { return (size() == 0); } /** * Wraps a value * * @param a value in the underlying set * @return an Object representation of the value */ protected Byte wrap(byte k) { return new Byte(k); } /** * Unwraps a value * * @param a wrapped value * @return an unwrapped representation of the value */ protected byte unwrap(Object value) { return ((Byte)value).byteValue(); } } // TByteHashSetDecorator --- NEW FILE: TByteIntHashMapDecorator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove.decorator; import gnu.trove.TByteIntHashMap; import gnu.trove.TByteIntIterator; import java.util.AbstractMap; import java.util.AbstractSet; import java.util.Collection; import java.util.Iterator; import java.util.Map.Entry; import java.util.Map; import java.util.Set; /** * Wrapper class to make a TByteIntHashMap conform to the <tt>java.util.Map</tt> API. * This class simply decorates an underlying TByteIntHashMap and translates the Object-based * APIs into their Trove primitive analogs. * * <p> * Note that wrapping and unwrapping primitive values is extremely inefficient. If * possible, users of this class should override the appropriate methods in this class * and use a table of canonical values. * </p> * * Created: Mon Sep 23 22:07:40 PDT 2002 * * @author Eric D. Friedman * @version $Id: TByteIntHashMapDecorator.java,v 1.1 2004/11/09 15:48:50 ericdf Exp $ * @since trove 0.1.8 */ public class TByteIntHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ protected TByteIntHashMap _map; /** * Creates a wrapper that decorates the specified primitive map. */ public TByteIntHashMapDecorator(TByteIntHashMap map) { super(); this._map = map; } /** * Clones the underlying trove collection and returns the clone wrapped in a new * decorator instance. This is a shallow clone except where primitives are * concerned. * * @return a copy of the receiver */ public Object clone() { try { TByteIntHashMapDecorator copy = (TByteIntHashMapDecorator) super.clone(); copy._map = (TByteIntHashMap)_map.clone(); return copy; } catch (CloneNotSupportedException e) { // assert(false); throw new InternalError(); // we are cloneable, so this does not happen } } /** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return true if the maps are identical */ public boolean equals(Object other) { if (_map.equals(other)) { return true; // comparing two trove maps } else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way Iterator it = that.entrySet().iterator(); for (int i = that.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); Object key = e.getKey(); Object val = e.getValue(); if (key instanceof Byte && val instanceof Integer) { byte k = unwrapKey(key); int v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) { // match, ok to continue } else { return false; // no match: we're done } } else { return false; // different type in other map } } return true; // all entries match } } else { return false; } } /** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Object get(Object key) { byte k = unwrapKey(key); int v = _map.get(k); // 0 may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if (v == 0) { return _map.containsKey(k) ? wrapValue(v) : null; } else { return wrapValue(v); } } /** * Empties the map. */ public void clear() { this._map.clear(); } /** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or Integer(0) if it was not found in the map */ public Object remove(Object key) { return wrapValue(_map.remove(unwrapKey(key))); } /** * Returns a Set view on the entries of the map. * * @return a <code>Set</code> value */ public Set entrySet() { return new AbstractSet() { public int size() { return _map.size(); } public boolean isEmpty() { return TByteIntHashMapDecorator.this.isEmpty(); } public boolean contains(Object o) { if (o instanceof Map.Entry) { Object k = ((Map.Entry)o).getKey(); Object v = ((Map.Entry)o).getValue(); return (TByteIntHashMapDecorator.this.containsKey(k) && TByteIntHashMapDecorator.this.get(k).equals(v)); } else { return false; } } public Iterator iterator() { return new Iterator() { private final TByteIntIterator it = _map.iterator(); public Object next() { it.advance(); final Object key = wrapKey(it.key()); final Object v = wrapValue(it.value()); return new Map.Entry() { private Object val = v; public boolean equals(Object o) { return ((o instanceof Map.Entry) && ((Map.Entry)o).getKey().equals(key) && ((Map.Entry)o).getValue().equals(val)); } public Object getKey() { return key; } public Object getValue() { return val; } public int hashCode() { return key.hashCode() + val.hashCode(); } public Object setValue(Object value) { val = value; return put(key, value); } }; } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; } public boolean add(Object o) { throw new UnsupportedOperationException(); } public boolean remove(Object o) { throw new UnsupportedOperationException(); } public boolean addAll(Collection c) { throw new UnsupportedOperationException(); } public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); } public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); } public void clear() { TByteIntHashMapDecorator.this.clear(); } }; } /** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { return _map.containsValue(unwrapValue(val)); } /** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey(Object key) { return _map.containsKey(unwrapKey(key)); } /** * Returns the number of entries in the map. * @return the map's size. */ public int size() { return this._map.size(); } /** * Indicates whether map has any entries. * @return true if the map is empty */ public boolean isEmpty() { return (size() == 0); } /** * Copies the key/value mappings in <tt>map</tt> into this map. * Note that this will be a <b>deep</b> copy, as storage is by * primitive value. * * @param map a <code>Map</code> value */ public void putAll(Map map) { Iterator it = map.entrySet().iterator(); for (int i = map.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); this.put(e.getKey(), e.getValue()); } } /** * Wraps a key * * @param a key in the underlying map * @return an Object representation of the key */ protected Byte wrapKey(byte k) { return new Byte(k); } /** * Unwraps a key * * @param a wrapped key * @return an unwrapped representation of the key */ protected byte unwrapKey(Object key) { return ((Byte)key).byteValue(); } /** * Wraps a value * * @param a value in the underlying map * @return an Object representation of the value */ protected Integer wrapValue(int k) { return new Integer(k); } /** * Unwraps a value * * @param a wrapped value * @return an unwrapped representation of the value */ protected int unwrapValue(Object value) { return ((Integer)value).intValue(); } } // TByteIntHashMapDecorator --- NEW FILE: TByteLongHashMapDecorator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove.decorator; import gnu.trove.TByteLongHashMap; import gnu.trove.TByteLongIterator; import java.util.AbstractMap; import java.util.AbstractSet; import java.util.Collection; import java.util.Iterator; import java.util.Map.Entry; import java.util.Map; import java.util.Set; /** * Wrapper class to make a TByteLongHashMap conform to the <tt>java.util.Map</tt> API. * This class simply decorates an underlying TByteLongHashMap and translates the Object-based * APIs into their Trove primitive analogs. * * <p> * Note that wrapping and unwrapping primitive values is extremely inefficient. If * possible, users of this class should override the appropriate methods in this class * and use a table of canonical values. * </p> * * Created: Mon Sep 23 22:07:40 PDT 2002 * * @author Eric D. Friedman * @version $Id: TByteLongHashMapDecorator.java,v 1.1 2004/11/09 15:48:50 ericdf Exp $ * @since trove 0.1.8 */ public class TByteLongHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ protected TByteLongHashMap _map; /** * Creates a wrapper that decorates the specified primitive map. */ public TByteLongHashMapDecorator(TByteLongHashMap map) { super(); this._map = map; } /** * Clones the underlying trove collection and returns the clone wrapped in a new * decorator instance. This is a shallow clone except where primitives are * concerned. * * @return a copy of the receiver */ public Object clone() { try { TByteLongHashMapDecorator copy = (TByteLongHashMapDecorator) super.clone(); copy._map = (TByteLongHashMap)_map.clone(); return copy; } catch (CloneNotSupportedException e) { // assert(false); throw new InternalError(); // we are cloneable, so this does not happen } } /** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return true if the maps are identical */ public boolean equals(Object other) { if (_map.equals(other)) { return true; // comparing two trove maps } else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way Iterator it = that.entrySet().iterator(); for (int i = that.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); Object key = e.getKey(); Object val = e.getValue(); if (key instanceof Byte && val instanceof Long) { byte k = unwrapKey(key); long v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) { // match, ok to continue } else { return false; // no match: we're done } } else { return false; // different type in other map } } return true; // all entries match } } else { return false; } } /** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Object get(Object key) { byte k = unwrapKey(key); long v = _map.get(k); // 0 may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if (v == 0) { return _map.containsKey(k) ? wrapValue(v) : null; } else { return wrapValue(v); } } /** * Empties the map. */ public void clear() { this._map.clear(); } /** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or Integer(0) if it was not found in the map */ public Object remove(Object key) { return wrapValue(_map.remove(unwrapKey(key))); } /** * Returns a Set view on the entries of the map. * * @return a <code>Set</code> value */ public Set entrySet() { return new AbstractSet() { public int size() { return _map.size(); } public boolean isEmpty() { return TByteLongHashMapDecorator.this.isEmpty(); } public boolean contains(Object o) { if (o instanceof Map.Entry) { Object k = ((Map.Entry)o).getKey(); Object v = ((Map.Entry)o).getValue(); return (TByteLongHashMapDecorator.this.containsKey(k) && TByteLongHashMapDecorator.this.get(k).equals(v)); } else { return false; } } public Iterator iterator() { return new Iterator() { private final TByteLongIterator it = _map.iterator(); public Object next() { it.advance(); final Object key = wrapKey(it.key()); final Object v = wrapValue(it.value()); return new Map.Entry() { private Object val = v; public boolean equals(Object o) { return ((o instanceof Map.Entry) && ((Map.Entry)o).getKey().equals(key) && ((Map.Entry)o).getValue().equals(val)); } public Object getKey() { return key; } public Object getValue() { return val; } public int hashCode() { return key.hashCode() + val.hashCode(); } public Object setValue(Object value) { val = value; return put(key, value); } }; } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; } public boolean add(Object o) { throw new UnsupportedOperationException(); } public boolean remove(Object o) { throw new UnsupportedOperationException(); } public boolean addAll(Collection c) { throw new UnsupportedOperationException(); } public boolean retainAll(Collection c) { throw new UnsupportedOperationException(); } public boolean removeAll(Collection c) { throw new UnsupportedOperationException(); } public void clear() { TByteLongHashMapDecorator.this.clear(); } }; } /** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { return _map.containsValue(unwrapValue(val)); } /** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey(Object key) { return _map.containsKey(unwrapKey(key)); } /** * Returns the number of entries in the map. * @return the map's size. */ public int size() { return this._map.size(); } /** * Indicates whether map has any entries. * @return true if the map is empty */ public boolean isEmpty() { return (size() == 0); } /** * Copies the key/value mappings in <tt>map</tt> into this map. * Note that this will be a <b>deep</b> copy, as storage is by * primitive value. * * @param map a <code>Map</code> value */ public void putAll(Map map) { Iterator it = map.entrySet().iterator(); for (int i = map.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); this.put(e.getKey(), e.getValue()); } } /** * Wraps a key * * @param a key in the underlying map * @return an Object representation of the key */ protected Byte wrapKey(byte k) { return new Byte(k); } /** * Unwraps a key * * @param a wrapped key * @return an unwrapped representation of the key */ protected byte unwrapKey(Object key) { return ((Byte)key).byteValue(); } /** * Wraps a value * * @param a value in the underlying map * @return an Object representation of the value */ protected Long wrapValue(long k) { return new Long(k); } /** * Unwraps a value * * @param a wrapped value * @return an unwrapped representation of the value */ protected long unwrapValue(Object value) { return ((Long)value).longValue(); } } // TByteLongHashMapDecorator --- NEW FILE: TByteObjectHashMapDecorator.java --- /////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2002, Eric D. Friedman All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////// package gnu.trove.decorator; import gnu.trove.TByteObjectHashMap; import gnu.trove.TByteObjectIterator; import java.util.AbstractMap; import java.util.AbstractSet; import java.util.Collection; import java.util.Iterator; import java.util.Map.Entry; import java.util.Map; import java.util.Set; /** * Wrapper class to make a TByteObjectHashMap conform to the <tt>java.util.Map</tt> API. * This class simply decorates an underlying TByteObjectHashMap and translates the Object-based * APIs into their Trove primitive analogs. * * <p> * Note that wrapping and unwrapping primitive values is extremely inefficient. If * possible, users of this class should override the appropriate methods in this class * and use a table of canonical values. * </p> * * Created: Mon Sep 23 22:07:40 PDT 2002 * * @author Eric D. Friedman * @version $Id: TByteObjectHashMapDecorator.java,v 1.1 2004/11/09 15:48:50 ericdf Exp $ * @since trove 0.1.8 */ public class TByteObjectHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ protected TByteObjectHashMap _map; /** * Creates a wrapper that decorates the specified primitive map. */ public TByteObjectHashMapDecorator(TByteObjectHashMap map) { super(); this._map = map; } /** * Clones the underlying trove collection and returns the clone wrapped in a new * decorator instance. This is a shallow clone except where primitives are * concerned. * * @return a copy of the receiver */ public Object clone() { try { TByteObjectHashMapDecorator copy = (TByteObjectHashMapDecorator) super.clone(); copy._map = (TByteObjectHashMap)_map.clone(); return copy; } catch (CloneNotSupportedException e) { // assert(false); throw new InternalError(); // we are cloneable, so this does not happen } } /** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); } /** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return true if the maps are identical */ public boolean equals(Object other) { if (_map.equals(other)) { return true; // comparing two trove maps } else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way Iterator it = that.entrySet().iterator(); for (int i = that.size(); i-- > 0;) { Map.Entry e = (Map.Entry)it.next(); Object key = e.getKey(); Object val = e.getValue(); if (key instanceof Byte && val instanceof Object) { byte k = unwrapKey(key); Object v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) { // match, ok to continue } else { return false; // no match: we're done } } else { return false; // different type in other map } } return true; // all entries match } } else { return false; } } /** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. ... [truncated message content] |
Update of /cvsroot/trove4j/trove/src/gnu/trove/decorator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27731/src/gnu/trove/decorator Modified Files: TDoubleDoubleHashMapDecorator.java TDoubleFloatHashMapDecorator.java TDoubleHashSetDecorator.java TDoubleIntHashMapDecorator.java TDoubleLongHashMapDecorator.java TDoubleObjectHashMapDecorator.java TFloatDoubleHashMapDecorator.java TFloatFloatHashMapDecorator.java TFloatHashSetDecorator.java TFloatIntHashMapDecorator.java TFloatLongHashMapDecorator.java TFloatObjectHashMapDecorator.java TIntDoubleHashMapDecorator.java TIntFloatHashMapDecorator.java TIntHashSetDecorator.java TIntHashSetDecoratorTests.java TIntIntHashMapDecorator.java TIntLongHashMapDecorator.java TIntObjectHashMapDecorator.java TLongDoubleHashMapDecorator.java TLongFloatHashMapDecorator.java TLongHashSetDecorator.java TLongIntHashMapDecorator.java TLongLongHashMapDecorator.java TLongObjectHashMapDecorator.java TObjectDoubleHashMapDecorator.java TObjectFloatHashMapDecorator.java TObjectIntHashMapDecorator.java TObjectLongHashMapDecorator.java gen_map_decorators.pl gen_set_decorators.pl Log Message: beta 3 Index: TDoubleDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleDoubleHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TDoubleDoubleHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TDoubleDoubleHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TDoubleDoubleHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TDoubleDoubleHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TDoubleDoubleHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TDoubleDoubleHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TDoubleDoubleHashMap copy = (TDoubleDoubleHashMap) _map.clone(); ! return new TDoubleDoubleHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TDoubleDoubleHashMapDecorator copy = (TDoubleDoubleHashMapDecorator) super.clone(); ! copy._map = (TDoubleDoubleHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TDoubleFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleFloatHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TDoubleFloatHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TDoubleFloatHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TDoubleFloatHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TDoubleFloatHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TDoubleFloatHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TDoubleFloatHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TDoubleFloatHashMap copy = (TDoubleFloatHashMap) _map.clone(); ! return new TDoubleFloatHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TDoubleFloatHashMapDecorator copy = (TDoubleFloatHashMapDecorator) super.clone(); ! copy._map = (TDoubleFloatHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TDoubleHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleHashSetDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TDoubleHashSetDecorator.java 28 Jul 2003 13:50:56 -0000 1.3 --- TDoubleHashSetDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 43,49 **** * @since trove 0.1.8 */ ! public class TDoubleHashSetDecorator extends AbstractSet implements Set { /** the wrapped primitive set */ ! protected final TDoubleHashSet _set; /** --- 43,49 ---- * @since trove 0.1.8 */ ! public class TDoubleHashSetDecorator extends AbstractSet implements Set, Cloneable { /** the wrapped primitive set */ ! protected TDoubleHashSet _set; /** *************** *** 63,68 **** */ public Object clone() { ! TDoubleHashSet copy = (TDoubleHashSet) _set.clone(); ! return new TDoubleHashSetDecorator(copy); } --- 63,74 ---- */ public Object clone() { ! try { ! TDoubleHashSetDecorator copy = (TDoubleHashSetDecorator) super.clone(); ! copy._set = (TDoubleHashSet) _set.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable ! } } Index: TDoubleIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleIntHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TDoubleIntHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TDoubleIntHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TDoubleIntHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TDoubleIntHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TDoubleIntHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TDoubleIntHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TDoubleIntHashMap copy = (TDoubleIntHashMap) _map.clone(); ! return new TDoubleIntHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TDoubleIntHashMapDecorator copy = (TDoubleIntHashMapDecorator) super.clone(); ! copy._map = (TDoubleIntHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TDoubleLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleLongHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TDoubleLongHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TDoubleLongHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TDoubleLongHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TDoubleLongHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TDoubleLongHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TDoubleLongHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TDoubleLongHashMap copy = (TDoubleLongHashMap) _map.clone(); ! return new TDoubleLongHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TDoubleLongHashMapDecorator copy = (TDoubleLongHashMapDecorator) super.clone(); ! copy._map = (TDoubleLongHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TDoubleObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleObjectHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TDoubleObjectHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TDoubleObjectHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TDoubleObjectHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TDoubleObjectHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TDoubleObjectHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TDoubleObjectHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TDoubleObjectHashMap copy = (TDoubleObjectHashMap) _map.clone(); ! return new TDoubleObjectHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TDoubleObjectHashMapDecorator copy = (TDoubleObjectHashMapDecorator) super.clone(); ! copy._map = (TDoubleObjectHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TFloatDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatDoubleHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TFloatDoubleHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TFloatDoubleHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TFloatDoubleHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TFloatDoubleHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TFloatDoubleHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TFloatDoubleHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TFloatDoubleHashMap copy = (TFloatDoubleHashMap) _map.clone(); ! return new TFloatDoubleHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TFloatDoubleHashMapDecorator copy = (TFloatDoubleHashMapDecorator) super.clone(); ! copy._map = (TFloatDoubleHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TFloatFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatFloatHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TFloatFloatHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TFloatFloatHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TFloatFloatHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TFloatFloatHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TFloatFloatHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TFloatFloatHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TFloatFloatHashMap copy = (TFloatFloatHashMap) _map.clone(); ! return new TFloatFloatHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TFloatFloatHashMapDecorator copy = (TFloatFloatHashMapDecorator) super.clone(); ! copy._map = (TFloatFloatHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TFloatHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatHashSetDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TFloatHashSetDecorator.java 28 Jul 2003 13:50:57 -0000 1.3 --- TFloatHashSetDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 43,49 **** * @since trove 0.1.8 */ ! public class TFloatHashSetDecorator extends AbstractSet implements Set { /** the wrapped primitive set */ ! protected final TFloatHashSet _set; /** --- 43,49 ---- * @since trove 0.1.8 */ ! public class TFloatHashSetDecorator extends AbstractSet implements Set, Cloneable { /** the wrapped primitive set */ ! protected TFloatHashSet _set; /** *************** *** 63,68 **** */ public Object clone() { ! TFloatHashSet copy = (TFloatHashSet) _set.clone(); ! return new TFloatHashSetDecorator(copy); } --- 63,74 ---- */ public Object clone() { ! try { ! TFloatHashSetDecorator copy = (TFloatHashSetDecorator) super.clone(); ! copy._set = (TFloatHashSet) _set.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable ! } } Index: TFloatIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatIntHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TFloatIntHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TFloatIntHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TFloatIntHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TFloatIntHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TFloatIntHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TFloatIntHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TFloatIntHashMap copy = (TFloatIntHashMap) _map.clone(); ! return new TFloatIntHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TFloatIntHashMapDecorator copy = (TFloatIntHashMapDecorator) super.clone(); ! copy._map = (TFloatIntHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TFloatLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatLongHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TFloatLongHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TFloatLongHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TFloatLongHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TFloatLongHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TFloatLongHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TFloatLongHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TFloatLongHashMap copy = (TFloatLongHashMap) _map.clone(); ! return new TFloatLongHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TFloatLongHashMapDecorator copy = (TFloatLongHashMapDecorator) super.clone(); ! copy._map = (TFloatLongHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TFloatObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatObjectHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TFloatObjectHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TFloatObjectHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TFloatObjectHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TFloatObjectHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TFloatObjectHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TFloatObjectHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TFloatObjectHashMap copy = (TFloatObjectHashMap) _map.clone(); ! return new TFloatObjectHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TFloatObjectHashMapDecorator copy = (TFloatObjectHashMapDecorator) super.clone(); ! copy._map = (TFloatObjectHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TIntDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntDoubleHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TIntDoubleHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TIntDoubleHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TIntDoubleHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TIntDoubleHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TIntDoubleHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TIntDoubleHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TIntDoubleHashMap copy = (TIntDoubleHashMap) _map.clone(); ! return new TIntDoubleHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TIntDoubleHashMapDecorator copy = (TIntDoubleHashMapDecorator) super.clone(); ! copy._map = (TIntDoubleHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TIntFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntFloatHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TIntFloatHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TIntFloatHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TIntFloatHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TIntFloatHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TIntFloatHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TIntFloatHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TIntFloatHashMap copy = (TIntFloatHashMap) _map.clone(); ! return new TIntFloatHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TIntFloatHashMapDecorator copy = (TIntFloatHashMapDecorator) super.clone(); ! copy._map = (TIntFloatHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TIntHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntHashSetDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TIntHashSetDecorator.java 28 Jul 2003 13:50:57 -0000 1.3 --- TIntHashSetDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 43,49 **** * @since trove 0.1.8 */ ! public class TIntHashSetDecorator extends AbstractSet implements Set { /** the wrapped primitive set */ ! protected final TIntHashSet _set; /** --- 43,49 ---- * @since trove 0.1.8 */ ! public class TIntHashSetDecorator extends AbstractSet implements Set, Cloneable { /** the wrapped primitive set */ ! protected TIntHashSet _set; /** *************** *** 63,68 **** */ public Object clone() { ! TIntHashSet copy = (TIntHashSet) _set.clone(); ! return new TIntHashSetDecorator(copy); } --- 63,74 ---- */ public Object clone() { ! try { ! TIntHashSetDecorator copy = (TIntHashSetDecorator) super.clone(); ! copy._set = (TIntHashSet) _set.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable ! } } Index: TIntHashSetDecoratorTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntHashSetDecoratorTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TIntHashSetDecoratorTests.java 28 Jul 2003 13:50:57 -0000 1.2 --- TIntHashSetDecoratorTests.java 18 Mar 2004 15:30:34 -0000 1.3 *************** *** 62,65 **** --- 62,77 ---- } + public void testCloneSubclass() throws Exception { + TIntHashSetDecorator s = new TIntHashSetDecorator(set) { }; + set.add(1); + set.add(2); + Set s2 = (Set) s.clone(); + assertEquals(s, s2); + set.add(3); + assertTrue( ! s.equals(s2)); + s2.add(new Integer(3)); + assertEquals(s, s2); + } + public void testWrap() throws Exception { Set s = new TIntHashSetDecorator(set); Index: TIntIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntIntHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TIntIntHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TIntIntHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TIntIntHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TIntIntHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TIntIntHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TIntIntHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TIntIntHashMap copy = (TIntIntHashMap) _map.clone(); ! return new TIntIntHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TIntIntHashMapDecorator copy = (TIntIntHashMapDecorator) super.clone(); ! copy._map = (TIntIntHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TIntLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntLongHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TIntLongHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TIntLongHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TIntLongHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TIntLongHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TIntLongHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TIntLongHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TIntLongHashMap copy = (TIntLongHashMap) _map.clone(); ! return new TIntLongHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TIntLongHashMapDecorator copy = (TIntLongHashMapDecorator) super.clone(); ! copy._map = (TIntLongHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TIntObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntObjectHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TIntObjectHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TIntObjectHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TIntObjectHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TIntObjectHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TIntObjectHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TIntObjectHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TIntObjectHashMap copy = (TIntObjectHashMap) _map.clone(); ! return new TIntObjectHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TIntObjectHashMapDecorator copy = (TIntObjectHashMapDecorator) super.clone(); ! copy._map = (TIntObjectHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TLongDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongDoubleHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TLongDoubleHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TLongDoubleHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TLongDoubleHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TLongDoubleHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TLongDoubleHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TLongDoubleHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TLongDoubleHashMap copy = (TLongDoubleHashMap) _map.clone(); ! return new TLongDoubleHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TLongDoubleHashMapDecorator copy = (TLongDoubleHashMapDecorator) super.clone(); ! copy._map = (TLongDoubleHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TLongFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongFloatHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TLongFloatHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TLongFloatHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TLongFloatHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TLongFloatHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TLongFloatHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TLongFloatHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TLongFloatHashMap copy = (TLongFloatHashMap) _map.clone(); ! return new TLongFloatHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TLongFloatHashMapDecorator copy = (TLongFloatHashMapDecorator) super.clone(); ! copy._map = (TLongFloatHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TLongHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongHashSetDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TLongHashSetDecorator.java 28 Jul 2003 13:50:57 -0000 1.3 --- TLongHashSetDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 43,49 **** * @since trove 0.1.8 */ ! public class TLongHashSetDecorator extends AbstractSet implements Set { /** the wrapped primitive set */ ! protected final TLongHashSet _set; /** --- 43,49 ---- * @since trove 0.1.8 */ ! public class TLongHashSetDecorator extends AbstractSet implements Set, Cloneable { /** the wrapped primitive set */ ! protected TLongHashSet _set; /** *************** *** 63,68 **** */ public Object clone() { ! TLongHashSet copy = (TLongHashSet) _set.clone(); ! return new TLongHashSetDecorator(copy); } --- 63,74 ---- */ public Object clone() { ! try { ! TLongHashSetDecorator copy = (TLongHashSetDecorator) super.clone(); ! copy._set = (TLongHashSet) _set.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable ! } } Index: TLongIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongIntHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TLongIntHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TLongIntHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TLongIntHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TLongIntHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TLongIntHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TLongIntHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TLongIntHashMap copy = (TLongIntHashMap) _map.clone(); ! return new TLongIntHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TLongIntHashMapDecorator copy = (TLongIntHashMapDecorator) super.clone(); ! copy._map = (TLongIntHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TLongLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongLongHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TLongLongHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TLongLongHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TLongLongHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TLongLongHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TLongLongHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TLongLongHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TLongLongHashMap copy = (TLongLongHashMap) _map.clone(); ! return new TLongLongHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TLongLongHashMapDecorator copy = (TLongLongHashMapDecorator) super.clone(); ! copy._map = (TLongLongHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TLongObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongObjectHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TLongObjectHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TLongObjectHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TLongObjectHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TLongObjectHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TLongObjectHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TLongObjectHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TLongObjectHashMap copy = (TLongObjectHashMap) _map.clone(); ! return new TLongObjectHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TLongObjectHashMapDecorator copy = (TLongObjectHashMapDecorator) super.clone(); ! copy._map = (TLongObjectHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TObjectDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectDoubleHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TObjectDoubleHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TObjectDoubleHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TObjectDoubleHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TObjectDoubleHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TObjectDoubleHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TObjectDoubleHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TObjectDoubleHashMap copy = (TObjectDoubleHashMap) _map.clone(); ! return new TObjectDoubleHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TObjectDoubleHashMapDecorator copy = (TObjectDoubleHashMapDecorator) super.clone(); ! copy._map = (TObjectDoubleHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TObjectFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectFloatHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TObjectFloatHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TObjectFloatHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TObjectFloatHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TObjectFloatHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TObjectFloatHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TObjectFloatHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TObjectFloatHashMap copy = (TObjectFloatHashMap) _map.clone(); ! return new TObjectFloatHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TObjectFloatHashMapDecorator copy = (TObjectFloatHashMapDecorator) super.clone(); ! copy._map = (TObjectFloatHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TObjectIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectIntHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TObjectIntHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TObjectIntHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TObjectIntHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TObjectIntHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TObjectIntHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TObjectIntHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TObjectIntHashMap copy = (TObjectIntHashMap) _map.clone(); ! return new TObjectIntHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TObjectIntHashMapDecorator copy = (TObjectIntHashMapDecorator) super.clone(); ! copy._map = (TObjectIntHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: TObjectLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectLongHashMapDecorator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TObjectLongHashMapDecorator.java 21 Nov 2003 17:22:22 -0000 1.3 --- TObjectLongHashMapDecorator.java 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 46,52 **** * @since trove 0.1.8 */ ! public class TObjectLongHashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final TObjectLongHashMap _map; /** --- 46,52 ---- * @since trove 0.1.8 */ ! public class TObjectLongHashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected TObjectLongHashMap _map; /** *************** *** 66,71 **** */ public Object clone() { ! TObjectLongHashMap copy = (TObjectLongHashMap) _map.clone(); ! return new TObjectLongHashMapDecorator(copy); } --- 66,77 ---- */ public Object clone() { ! try { ! TObjectLongHashMapDecorator copy = (TObjectLongHashMapDecorator) super.clone(); ! copy._map = (TObjectLongHashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: gen_map_decorators.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/gen_map_decorators.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gen_map_decorators.pl 21 Nov 2003 17:22:22 -0000 1.3 --- gen_map_decorators.pl 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 101,107 **** * @since trove 0.1.8 */ ! public class T<KeyType><ValueType>HashMapDecorator extends AbstractMap implements Map { /** the wrapped primitive map */ ! protected final T<KeyType><ValueType>HashMap _map; /** --- 101,107 ---- * @since trove 0.1.8 */ ! public class T<KeyType><ValueType>HashMapDecorator extends AbstractMap implements Map, Cloneable { /** the wrapped primitive map */ ! protected T<KeyType><ValueType>HashMap _map; /** *************** *** 121,126 **** */ public Object clone() { ! T<KeyType><ValueType>HashMap copy = (T<KeyType><ValueType>HashMap) _map.clone(); ! return new T<KeyType><ValueType>HashMapDecorator(copy); } --- 121,132 ---- */ public Object clone() { ! try { ! T<KeyType><ValueType>HashMapDecorator copy = (T<KeyType><ValueType>HashMapDecorator) super.clone(); ! copy._map = (T<KeyType><ValueType>HashMap)_map.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable, so this does not happen ! } } Index: gen_set_decorators.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/gen_set_decorators.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gen_set_decorators.pl 28 Jul 2003 13:50:57 -0000 1.3 --- gen_set_decorators.pl 18 Mar 2004 15:30:34 -0000 1.4 *************** *** 72,78 **** * @since trove 0.1.8 */ ! public class T<Type>HashSetDecorator extends AbstractSet implements Set { /** the wrapped primitive set */ ! protected final T<Type>HashSet _set; /** --- 72,78 ---- * @since trove 0.1.8 */ ! public class T<Type>HashSetDecorator extends AbstractSet implements Set, Cloneable { /** the wrapped primitive set */ ! protected T<Type>HashSet _set; /** *************** *** 92,97 **** */ public Object clone() { ! T<Type>HashSet copy = (T<Type>HashSet) _set.clone(); ! return new T<Type>HashSetDecorator(copy); } --- 92,103 ---- */ public Object clone() { ! try { ! T<Type>HashSetDecorator copy = (T<Type>HashSetDecorator) super.clone(); ! copy._set = (T<Type>HashSet) _set.clone(); ! return copy; ! } catch (CloneNotSupportedException e) { ! // assert(false); ! throw new InternalError(); // we are cloneable ! } } |
From: Eric F. <er...@us...> - 2004-03-18 15:40:12
|
Update of /cvsroot/trove4j/trove In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27731 Modified Files: ChangeLog build.xml Log Message: beta 3 Index: ChangeLog =================================================================== RCS file: /cvsroot/trove4j/trove/ChangeLog,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ChangeLog 25 Feb 2004 14:05:28 -0000 1.25 --- ChangeLog 18 Mar 2004 15:30:34 -0000 1.26 *************** *** 1,2 **** --- 1,8 ---- + v 1.1b3 + + Fixed 918045 -- bug in *Decorator classes made it impossible to subclass + the decorators and make those subclasses cloneable. Thanks to Steve + Lunt for the bug report. + v 1.1b2 Index: build.xml =================================================================== RCS file: /cvsroot/trove4j/trove/build.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** build.xml 25 Feb 2004 14:07:12 -0000 1.31 --- build.xml 18 Mar 2004 15:30:34 -0000 1.32 *************** *** 10,14 **** <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="1.1b2"/> <property name="year" value="2001-2003"/> --- 10,14 ---- <property name="Name" value="GNU Trove for Java"/> <property name="name" value="trove"/> ! <property name="version" value="1.1b3"/> <property name="year" value="2001-2003"/> |