1 19 20 package org.netbeans.editor; 21 22 30 31 public interface TokenItem { 32 33 34 public TokenID getTokenID(); 35 36 37 public TokenContextPath getTokenContextPath(); 38 39 40 public int getOffset(); 41 42 43 public String getImage(); 44 45 50 public TokenItem getNext(); 51 52 57 public TokenItem getPrevious(); 58 59 60 public static abstract class AbstractItem implements TokenItem { 61 62 private TokenID tokenID; 63 64 private TokenContextPath tokenContextPath; 65 66 private String image; 67 68 private int offset; 69 70 public AbstractItem(TokenID tokenID, TokenContextPath tokenContextPath, 71 int offset, String image) { 72 this.tokenID = tokenID; 73 this.tokenContextPath = tokenContextPath; 74 this.offset = offset; 75 this.image = image; 76 } 77 78 public TokenID getTokenID() { 79 return tokenID; 80 } 81 82 public TokenContextPath getTokenContextPath() { 83 return tokenContextPath; 84 } 85 86 public int getOffset() { 87 return offset; 88 } 89 90 public String getImage() { 91 return image; 92 } 93 94 public String toString() { 95 return "'" + org.netbeans.editor.EditorDebug.debugString(getImage()) + "', tokenID=" + getTokenID() + ", tcp=" + getTokenContextPath() + ", offset=" + getOffset(); } 99 100 } 101 102 103 public static class FilterItem implements TokenItem { 104 105 protected TokenItem delegate; 106 107 public FilterItem(TokenItem delegate) { 108 this.delegate = delegate; 109 } 110 111 public TokenID getTokenID() { 112 return delegate.getTokenID(); 113 } 114 115 public TokenContextPath getTokenContextPath() { 116 return delegate.getTokenContextPath(); 117 } 118 119 public int getOffset() { 120 return delegate.getOffset(); 121 } 122 123 public String getImage() { 124 return delegate.getImage(); 125 } 126 127 public TokenItem getNext() { 128 return delegate.getNext(); 129 } 130 131 public TokenItem getPrevious() { 132 return delegate.getPrevious(); 133 } 134 135 public String toString() { 136 return delegate.toString(); 137 } 138 139 } 140 141 } 142 | Popular Tags |