gov.sandia.cognition.math.matrix
Interface EntryIndexComparator<EntryType>

Type Parameters:
EntryType - Entry that this Comparator function upon
All Known Implementing Classes:
MatrixEntryIndexComparatorMTJ, VectorEntryIndexComparator

public interface EntryIndexComparator<EntryType>

The EntryIndexComparator interface defines the functionality of a comparator for index entries. It is not a standard Comparator because it handles null entries in a graceful manner by having the return type indicate which parameter is null.

Since:
1.0
Author:
Justin Basilico

Nested Class Summary
static class EntryIndexComparator.Compare
          Indicates which of two iterators has the lowest index
 
Method Summary
 EntryIndexComparator.Compare lowestIndex(EntryType firstEntry, EntryType secondEntry)
          Determines which iterator has the lowest index
 

Method Detail

lowestIndex

EntryIndexComparator.Compare lowestIndex(EntryType firstEntry,
                                         EntryType secondEntry)
Determines which iterator has the lowest index

Parameters:
firstEntry - first entry to consider
secondEntry - second entry to consider
Returns:
FIRST_LOWEST if firstIterator has lowest index, SECOND_LOWEST if secondIterator has lowest index, ENTRIES_EQUAL if both are equal BOTH_ENTRIES_NULL if both are null FIRST_ENTRY_NULL if first entry is null SECOND_ENTRY_NULL if second entryis null