Name

javax.microedition.rms.RecordComparator

Synopsis

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 int EQUIVALENT = 0;
   public static final int FOLLOWS = 1;
   public static final int PRECEDES = -1;
   // public instance methods
   public int compare(byte rec1[], byte rec2[]);
}

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.