1 19 package org.netbeans.modules.java.source.builder; 20 21 import org.netbeans.modules.java.source.save.SourceBuffer; 22 23 27 public abstract class BufferRun { 28 29 int start; 30 int end; 31 Kind kind; 32 33 public enum Kind { TOKEN, COMMENT, WHITESPACE, LINE_ENDING } 34 35 39 protected BufferRun(int start, int end, Kind kind) { 40 this.start = start; 41 this.end = end; 42 this.kind = kind; 43 } 44 45 48 public int getStart() { 49 return start; 50 } 51 52 55 public int getEnd() { 56 return end; 57 } 58 59 public Kind getKind() { 60 return kind; 61 } 62 63 66 public String toString() { 67 return "BR(" + start + "," + end + ")"; 68 } 69 70 74 public char[] getChars(CharSequence sb) { 75 return sb.subSequence(getStart(), getEnd()).toString().toCharArray(); 76 } 77 78 82 public String getString(CharSequence sb) { 83 return new String (getChars(sb)); 84 } 85 } 86 | Popular Tags |