January 2002
Intermediate to advanced
264 pages
8h 3m
English
javax.microedition.rms.RecordComparator
This interface defines several constants and the compare( ) method that can be used to compare two records to check
if they match, or what their relative sort order is. A class that
needs to compare two candidate records should implement this
interface by providing an implementation for the compare( ) method. The constants defined in this interface have the
following meaning in terms of sort order:
EQUIVALENT
The two records are the same but not necessarily identical.
FOLLOWS
Rec1 follows rec2.
PRECEDES
Rec1 precedes rec2.
The compare( ) method returns
EQUIVALENT if rec1 and rec2 are equivalent in
terms of sort order, PRECEDES if rec1 precedes
rec2, or FOLLOWS if rec1 follows rec2.
public interfaceRecordComparator{ // public class fields public static final intEQUIVALENT= 0; public static final intFOLLOWS= 1; public static final intPRECEDES= -1; // public instance methods public intcompare(byte rec1[], byte rec2[]); }
Read now
Unlock full access