From: Jeff R. <uph...@us...> - 2009-09-08 16:26:51
|
Update of /cvsroot/trove4j/trove/templates/gnu/trove/map In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13460/templates/gnu/trove/map Modified Files: Tag: TROVE_3_WORKING _K__V_Map.template Log Message: TPrimitivePrimitiveHashMap implementation and partial tests, changes required to implement it. Index: _K__V_Map.template =================================================================== RCS file: /cvsroot/trove4j/trove/templates/gnu/trove/map/Attic/_K__V_Map.template,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** _K__V_Map.template 14 Aug 2009 21:20:57 -0000 1.1.2.1 --- _K__V_Map.template 8 Sep 2009 16:26:40 -0000 1.1.2.2 *************** *** 27,31 **** --- 27,33 ---- import gnu.trove.iterator.*; import gnu.trove.procedure.*; + import gnu.trove.set.*; + import java.util.Map; import java.io.Serializable; *************** *** 35,38 **** --- 37,48 ---- */ public interface T#K##V#Map extends Serializable { + + /** + * Returns the value that will be returned from {@link #get} or {@link #put} if no + * entry exists for a given key. The default value is generally zero, but can be + * changed during construction of the collection. + */ + public #k# getNoEntryKey(); + /** * Returns the value that will be returned from {@link #get} or {@link #put} if no *************** *** 54,57 **** --- 64,68 ---- public #v# put( #k# key, #v# value ); + /** * Inserts a key/value pair into the map if the specified key is not already *************** *** 66,69 **** --- 77,89 ---- public #v# putIfAbsent( #k# key, #v# value ); + + /** + * Put all the entries from the given Map into this map. + * + * @param map The Map from which entries will be obtained to put into this map. + */ + public void putAll( Map<#KT#, #VT#> map ); + + /** * Put all the entries from the given map into this map. *************** *** 73,76 **** --- 93,97 ---- public void putAll( T#K##V#Map map ); + /** * Retrieves the value for <tt>key</tt> *************** *** 83,86 **** --- 104,108 ---- public #v# get( #k# key ); + /** * Empties the map. *************** *** 89,92 **** --- 111,123 ---- public void clear(); + + /** + * Returns <tt>true</tt> if this map contains no key-value mappings. + * + * @returns <tt>true</tt> if this map contains no key-value mappings + */ + public boolean isEmpty(); + + /** * Deletes a key/value pair from the map. *************** *** 101,110 **** /** ! * Returns the values of the map. */ ! public #v#[] values(); /** ! * Returns the values of the map using an existing array. * * @param array the array into which the elements of the list are to be stored, --- 132,154 ---- /** ! * Returns an <tt>int</tt> value that is the number of elements in the map. */ ! public int size(); ! /** ! * Returns the keys of the map as a <tt>T#K#Set</tt> ! */ ! public T#K#Set keys(); ! ! ! /** ! * Returns the keys of the map. ! */ ! public #k#[] keysAsArray(); ! ! ! /** ! * Returns the keys of the map. * * @param array the array into which the elements of the list are to be stored, *************** *** 112,124 **** * allocated for this purpose. */ ! public #v#[] values( #v#[] array ); /** ! * Returns the keys of the map. */ ! public #k#[] keys(); /** ! * Returns the keys of the map. * * @param array the array into which the elements of the list are to be stored, --- 156,176 ---- * allocated for this purpose. */ ! public #k#[] keysAsArray( #k#[] array ); ! /** ! * Returns the values of the map as a <tt>T#V#Set</tt> */ ! public T#V#Set values(); ! /** ! * Returns the values of the map. ! */ ! public #v#[] valuesAsArray(); ! ! ! /** ! * Returns the values of the map using an existing array. * * @param array the array into which the elements of the list are to be stored, *************** *** 126,130 **** * allocated for this purpose. */ ! public #k#[] keys( #k#[] array ); --- 178,182 ---- * allocated for this purpose. */ ! public #v#[] valuesAsArray( #v#[] array ); *************** *** 137,140 **** --- 189,193 ---- public boolean containsValue( #v# val ); + /** * Checks for the present of <tt>key</tt> in the keys of the map. *************** *** 151,154 **** --- 204,208 ---- public T#K##V#Iterator iterator(); + /** * Executes <tt>procedure</tt> for each key in the map. *************** *** 160,167 **** public boolean forEachKey( T#K#Procedure procedure ); /** * Executes <tt>procedure</tt> for each value in the map. * ! * @param procedure a <code>T#V#Procedure</code> value * @return false if the loop over the values terminated because * the procedure returned false for some value. --- 214,222 ---- public boolean forEachKey( T#K#Procedure procedure ); + /** * Executes <tt>procedure</tt> for each value in the map. * ! * @param procedure a <code>T#F#Procedure</code> value * @return false if the loop over the values terminated because * the procedure returned false for some value. *************** *** 169,172 **** --- 224,228 ---- public boolean forEachValue( T#V#Procedure procedure ); + /** * Executes <tt>procedure</tt> for each key/value entry in the *************** *** 179,182 **** --- 235,239 ---- public boolean forEachEntry( T#K##V#Procedure procedure ); + /** * Transform the values in this map using <tt>function</tt>. *************** *** 196,199 **** --- 253,257 ---- public boolean retainEntries( T#K##V#Procedure procedure ); + /** * Increments the primitive value mapped to key by 1 *************** *** 204,207 **** --- 262,266 ---- public boolean increment( #k# key ); + /** * Adjusts the primitive value mapped to key. *************** *** 213,216 **** --- 272,276 ---- public boolean adjustValue( #k# key, #v# amount ); + /** * Adjusts the primitive value mapped to the key if the key is present in the map. |