Logo Search packages:      
Sourcecode: qdbm version File versions  Download package

static final int qdbm::Villa::objcompare ( byte[]  abuf,
byte[]  bbuf 
) [inline, static, private]

Compare keys of two records as serialized objects implementing `java.util.Comparable'.

Parameters:
abuf serialized data of one object.
bbuf serialized data of the other object.
Returns:
positive if the former is big, negative if the latter is big, 0 if both are equivalent.

Definition at line 738 of file Villa.java.

                                                               {
    Object a = Util.deserialize(abuf);
    Object b = Util.deserialize(bbuf);
    if(a != null && b == null) return 1;
    if(a == null && b != null) return -1;
    if(a == null && b == null) return 0;
    try {
      return ((Comparable)a).compareTo(b);
    } catch(ClassCastException e){
      return 0;
    }
  }


Generated by  Doxygen 1.6.0   Back to index