1 21 22 package org.armedbear.j; 23 24 public final class FileLine extends TextLine 25 { 26 private boolean visited; 27 28 public FileLine(File file, boolean listEachOccurrence) 29 { 30 super(listEachOccurrence ? "File: " + file.canonicalPath() : file.canonicalPath()); 31 } 32 33 public FileLine(String fileName) 34 { 35 super("File: " + fileName); 36 } 37 38 public final String getCanonicalPath() 39 { 40 String text = getText(); 41 if (text.startsWith("File: ")) 42 return text.substring(6); 43 else 44 return text; 45 } 46 47 public final void markVisited() 48 { 49 visited = true; 50 } 51 52 public final boolean visited() 53 { 54 return visited; 55 } 56 } 57 | Popular Tags |