Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.util
Class RSDateComparator

java.lang.Object
  extended by oracle.adfnmc.util.RSDateComparator
All Implemented Interfaces:
javax.microedition.rms.RecordComparator

public class RSDateComparator
extends java.lang.Object
implements javax.microedition.rms.RecordComparator

This class can be used to return RecordStore records sorted in increasing order by a Long. This of course assumes that the first 8 bytes of each record constitute a valid Long. One use of this is to sort records by date via System.currentTimeMillis(); hence the name of this class.

Author:
PARACHAN

Field Summary
static java.lang.Class CLASS_INSTANCE
           
 
Fields inherited from interface javax.microedition.rms.RecordComparator
EQUIVALENT, FOLLOWS, PRECEDES
 
Constructor Summary
RSDateComparator()
           
 
Method Summary
 int compare(byte[] rec1, byte[] rec2)
          Read the timestamps out of each record and compare them to see which one should come first.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE
Constructor Detail

RSDateComparator

public RSDateComparator()
Method Detail

compare

public int compare(byte[] rec1,
                   byte[] rec2)
Read the timestamps out of each record and compare them to see which one should come first.

Specified by:
compare in interface javax.microedition.rms.RecordComparator

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.