Update of /cvsroot/trove4j/trove/src/gnu/trove/decorator In directory sc8-pr-cvs1:/tmp/cvs-serv11665/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 TIntIntHashMapDecoratorTests.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: fix for [ 778904 ] clone broken on decorator classes Added clone method to decorator classes along with appropriate unit tests. Index: TDoubleDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleDoubleHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleDoubleHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TDoubleDoubleHashMapDecorator.java 28 Jul 2003 13:50:56 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TDoubleDoubleHashMap copy = (TDoubleDoubleHashMap) _map.clone(); + return new TDoubleDoubleHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TDoubleFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleFloatHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleFloatHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TDoubleFloatHashMapDecorator.java 28 Jul 2003 13:50:56 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TDoubleFloatHashMap copy = (TDoubleFloatHashMap) _map.clone(); + return new TDoubleFloatHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TDoubleHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleHashSetDecorator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TDoubleHashSetDecorator.java 25 Sep 2002 05:14:38 -0000 1.2 --- TDoubleHashSetDecorator.java 28 Jul 2003 13:50:56 -0000 1.3 *************** *** 55,58 **** --- 55,70 ---- } + /** + * 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() { + TDoubleHashSet copy = (TDoubleHashSet) _set.clone(); + return new TDoubleHashSetDecorator(copy); + } + /** * Inserts a value into the set. Index: TDoubleIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleIntHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleIntHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TDoubleIntHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TDoubleIntHashMap copy = (TDoubleIntHashMap) _map.clone(); + return new TDoubleIntHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TDoubleLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleLongHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleLongHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TDoubleLongHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TDoubleLongHashMap copy = (TDoubleLongHashMap) _map.clone(); + return new TDoubleLongHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TDoubleObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TDoubleObjectHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TDoubleObjectHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TDoubleObjectHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TDoubleObjectHashMap copy = (TDoubleObjectHashMap) _map.clone(); + return new TDoubleObjectHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TFloatDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatDoubleHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatDoubleHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TFloatDoubleHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TFloatDoubleHashMap copy = (TFloatDoubleHashMap) _map.clone(); + return new TFloatDoubleHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TFloatFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatFloatHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatFloatHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TFloatFloatHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TFloatFloatHashMap copy = (TFloatFloatHashMap) _map.clone(); + return new TFloatFloatHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TFloatHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatHashSetDecorator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TFloatHashSetDecorator.java 25 Sep 2002 05:14:38 -0000 1.2 --- TFloatHashSetDecorator.java 28 Jul 2003 13:50:57 -0000 1.3 *************** *** 55,58 **** --- 55,70 ---- } + /** + * 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() { + TFloatHashSet copy = (TFloatHashSet) _set.clone(); + return new TFloatHashSetDecorator(copy); + } + /** * Inserts a value into the set. Index: TFloatIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatIntHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatIntHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TFloatIntHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TFloatIntHashMap copy = (TFloatIntHashMap) _map.clone(); + return new TFloatIntHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TFloatLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatLongHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatLongHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TFloatLongHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TFloatLongHashMap copy = (TFloatLongHashMap) _map.clone(); + return new TFloatLongHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TFloatObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TFloatObjectHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TFloatObjectHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TFloatObjectHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TFloatObjectHashMap copy = (TFloatObjectHashMap) _map.clone(); + return new TFloatObjectHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TIntDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntDoubleHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntDoubleHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TIntDoubleHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TIntDoubleHashMap copy = (TIntDoubleHashMap) _map.clone(); + return new TIntDoubleHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TIntFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntFloatHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntFloatHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TIntFloatHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TIntFloatHashMap copy = (TIntFloatHashMap) _map.clone(); + return new TIntFloatHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TIntHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntHashSetDecorator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TIntHashSetDecorator.java 25 Sep 2002 05:14:38 -0000 1.2 --- TIntHashSetDecorator.java 28 Jul 2003 13:50:57 -0000 1.3 *************** *** 55,58 **** --- 55,70 ---- } + /** + * 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() { + TIntHashSet copy = (TIntHashSet) _set.clone(); + return new TIntHashSetDecorator(copy); + } + /** * Inserts a value into the set. Index: TIntHashSetDecoratorTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntHashSetDecoratorTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntHashSetDecoratorTests.java 25 Sep 2002 05:10:08 -0000 1.1 --- TIntHashSetDecoratorTests.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 50,53 **** --- 50,65 ---- } + public void testClone() 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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntIntHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TIntIntHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TIntIntHashMap copy = (TIntIntHashMap) _map.clone(); + return new TIntIntHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TIntIntHashMapDecoratorTests.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntIntHashMapDecoratorTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntIntHashMapDecoratorTests.java 25 Sep 2002 05:10:08 -0000 1.1 --- TIntIntHashMapDecoratorTests.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + public void testClone() throws Exception { + TIntIntHashMapDecorator m = new TIntIntHashMapDecorator(map); + map.put(1,1); + map.put(2,2); + Map m2 = (Map)m.clone(); + assertEquals(m, m2); + map.put(3,3); + assertTrue(! m.equals(m2)); + assertEquals(2, m2.size()); + assertEquals(3, m.size()); + } + public void testIterators() throws Exception { Map m = new TIntIntHashMapDecorator(map); Index: TIntLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntLongHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntLongHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TIntLongHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TIntLongHashMap copy = (TIntLongHashMap) _map.clone(); + return new TIntLongHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TIntObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TIntObjectHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TIntObjectHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TIntObjectHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TIntObjectHashMap copy = (TIntObjectHashMap) _map.clone(); + return new TIntObjectHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TLongDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongDoubleHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongDoubleHashMapDecorator.java 25 Sep 2002 05:10:08 -0000 1.1 --- TLongDoubleHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TLongDoubleHashMap copy = (TLongDoubleHashMap) _map.clone(); + return new TLongDoubleHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TLongFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongFloatHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongFloatHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TLongFloatHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TLongFloatHashMap copy = (TLongFloatHashMap) _map.clone(); + return new TLongFloatHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TLongHashSetDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongHashSetDecorator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TLongHashSetDecorator.java 25 Sep 2002 05:14:38 -0000 1.2 --- TLongHashSetDecorator.java 28 Jul 2003 13:50:57 -0000 1.3 *************** *** 55,58 **** --- 55,70 ---- } + /** + * 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() { + TLongHashSet copy = (TLongHashSet) _set.clone(); + return new TLongHashSetDecorator(copy); + } + /** * Inserts a value into the set. Index: TLongIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongIntHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongIntHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TLongIntHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TLongIntHashMap copy = (TLongIntHashMap) _map.clone(); + return new TLongIntHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TLongLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongLongHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongLongHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TLongLongHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TLongLongHashMap copy = (TLongLongHashMap) _map.clone(); + return new TLongLongHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TLongObjectHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TLongObjectHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TLongObjectHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TLongObjectHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TLongObjectHashMap copy = (TLongObjectHashMap) _map.clone(); + return new TLongObjectHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TObjectDoubleHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectDoubleHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TObjectDoubleHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TObjectDoubleHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TObjectDoubleHashMap copy = (TObjectDoubleHashMap) _map.clone(); + return new TObjectDoubleHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TObjectFloatHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectFloatHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TObjectFloatHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TObjectFloatHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TObjectFloatHashMap copy = (TObjectFloatHashMap) _map.clone(); + return new TObjectFloatHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TObjectIntHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectIntHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TObjectIntHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TObjectIntHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TObjectIntHashMap copy = (TObjectIntHashMap) _map.clone(); + return new TObjectIntHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: TObjectLongHashMapDecorator.java =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/TObjectLongHashMapDecorator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TObjectLongHashMapDecorator.java 25 Sep 2002 05:10:09 -0000 1.1 --- TObjectLongHashMapDecorator.java 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 58,61 **** --- 58,73 ---- } + /** + * 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() { + TObjectLongHashMap copy = (TObjectLongHashMap) _map.clone(); + return new TObjectLongHashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: gen_map_decorators.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/gen_map_decorators.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gen_map_decorators.pl 25 Sep 2002 05:10:09 -0000 1.1 --- gen_map_decorators.pl 28 Jul 2003 13:50:57 -0000 1.2 *************** *** 96,99 **** --- 96,111 ---- } + /** + * 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() { + T<KeyType><ValueType>HashMap copy = (T<KeyType><ValueType>HashMap) _map.clone(); + return new T<KeyType><ValueType>HashMapDecorator(copy); + } + /** * Inserts a key/value pair into the map. Index: gen_set_decorators.pl =================================================================== RCS file: /cvsroot/trove4j/trove/src/gnu/trove/decorator/gen_set_decorators.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gen_set_decorators.pl 25 Sep 2002 05:14:38 -0000 1.2 --- gen_set_decorators.pl 28 Jul 2003 13:50:57 -0000 1.3 *************** *** 84,87 **** --- 84,99 ---- } + /** + * 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() { + T<Type>HashSet copy = (T<Type>HashSet) _set.clone(); + return new T<Type>HashSetDecorator(copy); + } + /** * Inserts a value into the set. |