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