Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.util.Counted< E > Class Reference

List of all members.

Public Member Functions

 Counted (E element, int count)
int getCount ()
getElement ()
int compareTo (Counted< E > o)

Static Public Member Functions

static< E > Comparator
< Counted< E > > 
getDescendingComparator ()

Private Attributes

final E element
final Integer count

Detailed Description

Represents an object being counted, with the associated count.

Author:
Lane Schwartz

Constructor & Destructor Documentation

joshua.util.Counted< E >.Counted ( element,
int  count 
)

Constructs an object wrapping an element and its associated count.

Parameters:
elementAn element being counted
countThe count associated with the element

Member Function Documentation

int joshua.util.Counted< E >.compareTo ( Counted< E >  o)

Compares this object to another counted object, according to the natural order of the counts associated with each object.

Parameters:
oAnother counted object
Returns:
-1 if the count of this object is less than the count of the other object, 0 if the counts are equal, or 1 if the count of this object is greater than the count of the other object
int joshua.util.Counted< E >.getCount ( )

Gets the count associated with this object's element.

Returns:
The count associated with this object's element
static <E> Comparator<Counted<E> > joshua.util.Counted< E >.getDescendingComparator ( ) [static]

Gets a comparator that compares two counted objects based on the reverse of the natural order of the counts associated with each object.

Parameters:
<E>
Returns:
A comparator that compares two counted objects based on the reverse of the natural order of the counts associated with each object
E joshua.util.Counted< E >.getElement ( )

Gets the element associated with this object.

Returns:
The element associated with this object

Member Data Documentation

final Integer joshua.util.Counted< E >.count [private]

The count associated with the element.

final E joshua.util.Counted< E >.element [private]

The element being counted.