@Test public void testGetCount() { final Frequency<Integer> f = new Frequency<Integer>(); for ( int i = 0; i <= 10; i++ ) { for ( int j = 0; j < i; j++ ) { f.addValue( Integer.valueOf( i ) ); } } assertEquals( 0, f.getCount( 0 ) ); assertEquals( 1, f.getCount( 1 ) ); assertEquals( 2, f.getCount( 2 ) ); assertEquals( 3, f.getCount( 3 ) ); assertEquals( 4, f.getCount( 4 ) ); assertEquals( 5, f.getCount( 5 ) ); assertEquals( 6, f.getCount( 6 ) ); assertEquals( 7, f.getCount( 7 ) ); assertEquals( 8, f.getCount( 8 ) ); assertEquals( 9, f.getCount( 9 ) ); assertEquals( 10, f.getCount( 10 ) ); assertEquals( 0, f.getCount( 11 ) ); }
public long getCount( final TYPE aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Value cannot be null!" ); } long result = 0L; Long count = this.distribution.get( aValue ); if ( count != null ) { result = count.longValue(); } return result; }
Frequency { public long getCount( final TYPE aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Value cannot be null!" ); } long result = 0L; Long count = this.distribution.get( aValue ); if ( count != null ) { result = count.longValue(); } return result; } }
Frequency { public long getCount( final TYPE aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Value cannot be null!" ); } long result = 0L; Long count = this.distribution.get( aValue ); if ( count != null ) { result = count.longValue(); } return result; } Frequency();  Frequency( final Comparator<TYPE> aComparator ); }
Frequency { public long getCount( final TYPE aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Value cannot be null!" ); } long result = 0L; Long count = this.distribution.get( aValue ); if ( count != null ) { result = count.longValue(); } return result; } Frequency();  Frequency( final Comparator<TYPE> aComparator ); void addValue( final TYPE aValue ); void clear(); long getCount( final TYPE aValue ); TYPE getHighestRanked(); TYPE getLowestRanked(); long getTotalCount(); int getUniqueValueCount(); Iterable<TYPE> values(); }
Frequency { public long getCount( final TYPE aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Value cannot be null!" ); } long result = 0L; Long count = this.distribution.get( aValue ); if ( count != null ) { result = count.longValue(); } return result; } Frequency();  Frequency( final Comparator<TYPE> aComparator ); void addValue( final TYPE aValue ); void clear(); long getCount( final TYPE aValue ); TYPE getHighestRanked(); TYPE getLowestRanked(); long getTotalCount(); int getUniqueValueCount(); Iterable<TYPE> values();  }