public static < K > NumberMap < K , Short > newShortMap ( ) { return new NumberMap < K , Short > ( ) { @ Override public void add ( K key , Short addend ) { put ( key , containsKey ( key ) ? ( short ) ( get ( key ) + addend ) : addend ) ; } @ Override public void sub ( K key , Short subtrahend ) { put ( key , ( short ) ( ( containsKey ( key ) ? get ( key ) : 0 ) - subtrahend ) ) ; } } ; }
Creates a NumberMap for Shorts .