1 package com.nwalsh.saxon; 2 3 import org.w3c.dom.*; 4 5 15 public class Callout implements Comparable { 16 17 private int callout = 0; 18 19 private Element area = null; 20 21 private int line = 0; 22 23 private int col = 0; 24 25 26 public Callout(int callout, Element area, int line, int col) { 27 this.callout = callout; 28 this.area = area; 29 this.line = line; 30 this.col = col; 31 } 32 33 45 public int compareTo (Object o) { 46 Callout c = (Callout) o; 47 48 if (line == c.getLine()) { 49 if (col > c.getColumn()) { 50 return 1; 51 } else if (col < c.getColumn()) { 52 return -1; 53 } else { 54 if (callout < c.getCallout()) { 55 return -1; 56 } else if (callout > c.getCallout()) { 57 return 1; 58 } else { 59 return 0; 60 } 61 } 62 } else { 63 if (line > c.getLine()) { 64 return 1; 65 } else { 66 return -1; 67 } 68 } 69 } 70 71 72 public Element getArea() { 73 return area; 74 } 75 76 77 public int getLine() { 78 return line; 79 } 80 81 82 public int getColumn() { 83 return col; 84 } 85 86 87 public int getCallout() { 88 return callout; 89 } 90 } 91 | Popular Tags |