Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ITypeNeighbor.java

00001 package gov.nasa.arc.ase.util.graph;
00002 
00003 import java.io.*;
00004 
00005 public class ITypeNeighbor extends Pair implements Comparable {
00006 
00007   public ITypeNeighbor(int colorIn, String transitionIn) {
00008     super(colorIn, transitionIn);
00009   }  
00010   // Priority of comparison is made on the string 
00011   public int compareTo(Object o) {
00012     ITypeNeighbor other = (ITypeNeighbor)o;
00013     int comparison = getTransition().compareTo(other.getTransition());
00014     if (comparison == 0) {
00015       if (getColor() < other.getColor())
00016     return -1;
00017       if (getColor() == other.getColor())
00018     return 0;
00019       if (getColor() > other.getColor())
00020     return 1;
00021     }
00022     return comparison;
00023   }  
00024   public int getColor() {
00025     return super.getValue();
00026   }  
00027   public String getTransition() {
00028     return (String)super.getElement();
00029   }  
00030   public void setColor(int colorIn) {
00031     super.setValue(colorIn);
00032   }  
00033   public void setTransition(String transitionIn) {
00034     super.setElement(transitionIn);
00035   }  
00036 }

Generated at Thu Feb 7 06:48:03 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001