gov.sandia.cognition.math.matrix
Class VectorEntryIndexComparator

java.lang.Object
  extended by gov.sandia.cognition.math.matrix.VectorEntryIndexComparator
All Implemented Interfaces:
EntryIndexComparator<VectorEntry>

public class VectorEntryIndexComparator
extends Object
implements EntryIndexComparator<VectorEntry>

An index comparator for VectorEntry objects.

Since:
1.0
Author:
Justin Basilico

Nested Class Summary
 
Nested classes/interfaces inherited from interface gov.sandia.cognition.math.matrix.EntryIndexComparator
EntryIndexComparator.Compare
 
Field Summary
static VectorEntryIndexComparator INSTANCE
          A single instance of this class to use because it has no internal memory.
 
Constructor Summary
VectorEntryIndexComparator()
          Creates a new instance of VectorEntryIndexComparator
 
Method Summary
 EntryIndexComparator.Compare lowestIndex(VectorEntry firstEntry, VectorEntry secondEntry)
          Determines which iterator has the lowest index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final VectorEntryIndexComparator INSTANCE
A single instance of this class to use because it has no internal memory.

Constructor Detail

VectorEntryIndexComparator

public VectorEntryIndexComparator()
Creates a new instance of VectorEntryIndexComparator

Method Detail

lowestIndex

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

Specified by:
lowestIndex in interface EntryIndexComparator<VectorEntry>
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