home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / awt / geom / Edge.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.6 KB  |  84 lines

  1. package sun.awt.geom;
  2.  
  3. final class Edge {
  4.    static final int INIT_PARTS = 4;
  5.    static final int GROW_PARTS = 10;
  6.    Curve curve;
  7.    int ctag;
  8.    int etag;
  9.    double activey;
  10.    int equivalence;
  11.    private Edge lastEdge;
  12.    private int lastResult;
  13.    private double lastLimit;
  14.  
  15.    public Edge(Curve var1, int var2) {
  16.       this(var1, var2, 0);
  17.    }
  18.  
  19.    public Edge(Curve var1, int var2, int var3) {
  20.       this.curve = var1;
  21.       this.ctag = var2;
  22.       this.etag = var3;
  23.    }
  24.  
  25.    public Curve getCurve() {
  26.       return this.curve;
  27.    }
  28.  
  29.    public int getCurveTag() {
  30.       return this.ctag;
  31.    }
  32.  
  33.    public int getEdgeTag() {
  34.       return this.etag;
  35.    }
  36.  
  37.    public void setEdgeTag(int var1) {
  38.       this.etag = var1;
  39.    }
  40.  
  41.    public int getEquivalence() {
  42.       return this.equivalence;
  43.    }
  44.  
  45.    public void setEquivalence(int var1) {
  46.       this.equivalence = var1;
  47.    }
  48.  
  49.    public int compareTo(Edge var1, double[] var2) {
  50.       if (var1 == this.lastEdge && var2[0] < this.lastLimit) {
  51.          if (var2[1] > this.lastLimit) {
  52.             var2[1] = this.lastLimit;
  53.          }
  54.  
  55.          return this.lastResult;
  56.       } else if (this == var1.lastEdge && var2[0] < var1.lastLimit) {
  57.          if (var2[1] > var1.lastLimit) {
  58.             var2[1] = var1.lastLimit;
  59.          }
  60.  
  61.          return 0 - var1.lastResult;
  62.       } else {
  63.          int var3 = this.curve.compareTo(var1.curve, var2);
  64.          this.lastEdge = var1;
  65.          this.lastLimit = var2[1];
  66.          this.lastResult = var3;
  67.          return var3;
  68.       }
  69.    }
  70.  
  71.    public void record(double var1, int var3) {
  72.       this.activey = var1;
  73.       this.etag = var3;
  74.    }
  75.  
  76.    public boolean isActiveFor(double var1, int var3) {
  77.       return this.etag == var3 && this.activey >= var1;
  78.    }
  79.  
  80.    public String toString() {
  81.       return "Edge[" + this.curve + ", " + (this.ctag == 0 ? "L" : "R") + ", " + (this.etag == 1 ? "I" : (this.etag == -1 ? "O" : "N")) + "]";
  82.    }
  83. }
  84.