1 24 25 package org.aspectj.tools.ide; 26 import java.io.Serializable ; 27 import java.io.File ; 28 29 public class SourceLine implements Serializable { 30 public int line; 31 public String filename; 32 34 public SourceLine(String filename, int line) { 35 this.line = line; 36 this.filename = filename; 37 } 38 39 public String getDirectory() { 40 return new File (filename).getParent(); 41 } 42 43 public int hashCode() { 44 return filename.hashCode() ^ line; 45 } 46 47 public boolean equals(Object other) { 48 if (!(other instanceof SourceLine)) return false; 49 50 SourceLine otherLine = (SourceLine)other; 51 52 return otherLine.line == line && otherLine.filename.equals(filename); 53 } 54 55 public String toString() { 56 return filename + "::" + line; 57 } 58 59 63 } 65 | Popular Tags |