UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.satin.util
Class LayerComparator

java.lang.Object
  |
  +--edu.berkeley.guir.lib.satin.util.LayerComparator
All Implemented Interfaces:
Comparator

public class LayerComparator
extends Object
implements Comparator

Compare GraphicalObjects by layers.

This software is distributed under the Berkeley Software License.

 Revisions:  - SATIN-v1.0-1.0.0, Jul 22 1999, JH
               Created class
             - SATIN-v2.1-1.0.0, Aug 11 2000, JH
               Touched for SATIN release
 

Since:
JDK 1.2
Version:
SATIN-v2.1-1.0.0, Aug 11 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )

Constructor Summary
LayerComparator()
           
 
Method Summary
 int compare(Object obj1, Object obj2)
          Compare two Strings representing layers (e.g.
 boolean equals(Object obj)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayerComparator

public LayerComparator()
Method Detail

compare

public int compare(Object obj1,
                   Object obj2)
Compare two Strings representing layers (e.g. "1.2.1" and "2.3") or compare two GraphicalObjects.
Specified by:
compare in interface Comparator
Returns:
-1 if obj1 less-than obj2 (obj1 above obj2), 0 if obj1 equal-to obj2 (same layer), 1 if obj1 greater-than obj2 (obj2 above obj1). Also returns 0 if it cannot compare.

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator
Overrides:
equals in class Object

Copyright Information