Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.io
Class ObjectInputStream.ValidatorAndPriority  view ObjectInputStream.ValidatorAndPriority download ObjectInputStream.ValidatorAndPriority.java

java.lang.Object
  extended byjava.io.ObjectInputStream.ValidatorAndPriority
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
ObjectInputStream

private static final class ObjectInputStream.ValidatorAndPriority
extends java.lang.Object
implements java.lang.Comparable


Field Summary
(package private)  int priority
           
(package private)  ObjectInputValidation validator
           
 
Constructor Summary
(package private) ObjectInputStream.ValidatorAndPriority(ObjectInputValidation validator, int priority)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with another, and returns a numerical result based on the comparison.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

priority

int priority

validator

ObjectInputValidation validator
Constructor Detail

ObjectInputStream.ValidatorAndPriority

ObjectInputStream.ValidatorAndPriority(ObjectInputValidation validator,
                                       int priority)
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Description copied from interface: java.lang.Comparable
Compares this object with another, and returns a numerical result based on the comparison. If the result is negative, this object sorts less than the other; if 0, the two are equal, and if positive, this object sorts greater than the other. To translate this into boolean, simply perform o1.compareTo(o2) <op> 0, where op is one of <, <=, =, !=, >, or >=.

You must make sure that the comparison is mutual, ie. sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) (where sgn() is defined as -1, 0, or 1 based on the sign). This includes throwing an exception in either direction if the two are not comparable; hence, compareTo(null) should always throw an Exception.

You should also ensure transitivity, in two forms: x.compareTo(y) > 0 && y.compareTo(z) > 0 implies x.compareTo(z) > 0; and x.compareTo(y) == 0 implies x.compareTo(z) == y.compareTo(z).

Specified by:
compareTo in interface java.lang.Comparable