@Test public void testGetHighestRanked() { 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( Integer.valueOf( 10 ), f.getHighestRanked() ); }
public TYPE getHighestRanked() { TYPE result = null; Long rank = null; for ( final Map.Entry<TYPE, Long> entry : this.distribution.entrySet() ) { if ( ( rank == null ) || ( rank.compareTo( entry.getValue() ) < 0 ) ) { rank = entry.getValue(); result = entry.getKey(); } } return result; }
Frequency { public TYPE getHighestRanked() { TYPE result = null; Long rank = null; for ( final Map.Entry<TYPE, Long> entry : this.distribution.entrySet() ) { if ( ( rank == null ) || ( rank.compareTo( entry.getValue() ) < 0 ) ) { rank = entry.getValue(); result = entry.getKey(); } } return result; } }
Frequency { public TYPE getHighestRanked() { TYPE result = null; Long rank = null; for ( final Map.Entry<TYPE, Long> entry : this.distribution.entrySet() ) { if ( ( rank == null ) || ( rank.compareTo( entry.getValue() ) < 0 ) ) { rank = entry.getValue(); result = entry.getKey(); } } return result; } Frequency();  Frequency( final Comparator<TYPE> aComparator ); }
Frequency { public TYPE getHighestRanked() { TYPE result = null; Long rank = null; for ( final Map.Entry<TYPE, Long> entry : this.distribution.entrySet() ) { if ( ( rank == null ) || ( rank.compareTo( entry.getValue() ) < 0 ) ) { rank = entry.getValue(); result = entry.getKey(); } } 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 TYPE getHighestRanked() { TYPE result = null; Long rank = null; for ( final Map.Entry<TYPE, Long> entry : this.distribution.entrySet() ) { if ( ( rank == null ) || ( rank.compareTo( entry.getValue() ) < 0 ) ) { rank = entry.getValue(); result = entry.getKey(); } } 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();  }