com.apamax.containers
Event HeapIntegerFieldComparator


A comparator for a heap containing events, given a field name which will be an integer to order the heap.
Member summary
 stringfieldName

The field of the event to use for the comparison. Must be an integer.
 booleanincreasing

True for a min-heap, false for a max-heap.
 
Action summary
 integercompare(any a, any b)

Compare two events.
 
Member detail

fieldName

string fieldName
The field of the event to use for the comparison. Must be an integer.

increasing

boolean increasing
True for a min-heap, false for a max-heap.
Action detail

compare

integer compare(any a, any b)
Compare two events.
Parameters:
a - The first event to compare.
b - The second event to compare.
Returns:
Positive if increasing and a > b, or not increasing and a < b, 0 if equal and negative otherwise.