1 11 package org.eclipse.ant.internal.ui.antsupport.logger.debug; 12 13 import java.io.File ; 14 import org.eclipse.ant.internal.ui.antsupport.logger.util.DebugMessageIds; 15 16 public class RemoteAntBreakpoint { 17 18 private File fFile; 19 private int fLineNumber; 20 private String fFileName; 21 22 public RemoteAntBreakpoint(String breakpointRepresentation) { 23 String [] data= breakpointRepresentation.split(DebugMessageIds.MESSAGE_DELIMITER); 24 String fileName= data[1]; 25 String lineNumber= data[2]; 26 fFileName= fileName; 27 fFile= new File (fileName); 28 fLineNumber= Integer.parseInt(lineNumber); 29 } 30 31 public boolean isAt(String fileName, int lineNumber) { 32 return fLineNumber == lineNumber && fileName != null && fFile.equals(new File (fileName)); 33 } 34 35 public String toMarshallString() { 36 StringBuffer buffer= new StringBuffer (DebugMessageIds.BREAKPOINT); 37 buffer.append(DebugMessageIds.MESSAGE_DELIMITER); 38 buffer.append(fFileName); 39 buffer.append(DebugMessageIds.MESSAGE_DELIMITER); 40 buffer.append(fLineNumber); 41 return buffer.toString(); 42 } 43 44 47 public boolean equals(Object obj) { 48 if (!(obj instanceof RemoteAntBreakpoint)) { 49 return false; 50 } 51 RemoteAntBreakpoint other= (RemoteAntBreakpoint) obj; 52 return other.getLineNumber() == fLineNumber && other.getFile().equals(fFile); 53 } 54 55 58 public int hashCode() { 59 return fFileName.hashCode() + fLineNumber; 60 } 61 62 public int getLineNumber() { 63 return fLineNumber; 64 } 65 66 public String getFileName() { 67 return fFileName; 68 } 69 70 public File getFile() { 71 return fFile; 72 } 73 } 74 | Popular Tags |