1 33 34 package edu.rice.cs.drjava.model.definitions.reducedmodel; 35 36 39 class Gap extends ReducedToken { 40 private int _size; 41 42 46 Gap(int size, ReducedModelState state) { 47 super(state); 48 _size = size; 49 } 50 51 54 public int getSize() { return _size; } 55 56 59 public String getType() { return ""; } 60 61 65 public void setType(String type) { 66 throw new RuntimeException ("Can't set type on Gap!"); 67 } 68 69 72 public void flip() { 73 throw new RuntimeException ("Can't flip a Gap!"); 74 } 75 76 79 public void grow(int delta) { 80 if (delta >= 0) 81 _size += delta; 82 } 83 84 87 public void shrink(int delta) { 88 if ((delta <= _size) && (delta >= 0)) _size -= delta; 89 } 90 91 94 public String toString() { 95 final StringBuilder val = new StringBuilder (); 97 int i; 98 for (i = 0; i < _size; i++) val.append(" _"); 99 return val.toString(); 100 } 101 102 105 public boolean isMultipleCharBrace() { return false; } 106 107 110 public boolean isGap() { return true; } 111 112 115 public boolean isLineComment() { return false; } 116 117 120 public boolean isBlockCommentStart() { return false; } 121 122 125 public boolean isBlockCommentEnd() { return false; } 126 127 130 public boolean isNewline() { return false; } 131 132 135 public boolean isSlash() { return false; } 136 137 140 public boolean isStar() { return false; } 141 142 145 public boolean isDoubleQuote() { return false; } 146 147 150 public boolean isSingleQuote() { return false; } 151 152 155 public boolean isDoubleEscapeSequence() { return false; } 156 157 160 public boolean isDoubleEscape() { return false; } 161 162 165 public boolean isEscapedSingleQuote() { return false; } 166 167 170 public boolean isEscapedDoubleQuote() { return false; } 171 172 175 public boolean isOpen() { return false; } 176 177 180 public boolean isClosed() { return false; } 181 182 186 public boolean isMatch(ReducedToken other) { return false; } 187 188 191 public boolean isOpenBrace() { return false; } 192 193 196 public boolean isClosedBrace() { return false; } 197 } 198 | Popular Tags |