java.lang .Object edu.rice.cs.drjava.model.definitions.reducedmodel .ReducedToken edu.rice.cs.drjava.model.definitions.reducedmodel .Brace Brace class Brace extends ReducedToken implements ReducedModelStates (Code) This class acts as the representation of a brace in the reduced view. It also includes information about the gap
of plaintext preceding the actual brace before the previous brace or the start of the file.
WARNING: the code in this class critically depends on the fact that literal strings are interned.
version: $Id: Brace.java 4255 2007-08-28 19:17:37Z mgricken $
BLK_CMT_BEG_TYPE final public static int BLK_CMT_BEG_TYPE (Code)
BLK_CMT_END_TYPE final public static int BLK_CMT_END_TYPE (Code)
BRACES_LENGTH final public static int BRACES_LENGTH (Code)
DOUBLE_ESCAPE_TYPE final public static int DOUBLE_ESCAPE_TYPE (Code)
DOUBLE_QUOTE_TYPE final public static int DOUBLE_QUOTE_TYPE (Code)
EOLN_TYPE final public static int EOLN_TYPE (Code)
ESCAPED_DOUBLE_QUOTE_TYPE final public static int ESCAPED_DOUBLE_QUOTE_TYPE (Code)
ESCAPED_SINGLE_QUOTE_TYPE final public static int ESCAPED_SINGLE_QUOTE_TYPE (Code)
LAST_BRACE_INDEX final public static int LAST_BRACE_INDEX (Code)
LINE_CMT_TYPE final public static int LINE_CMT_TYPE (Code)
SINGLE_QUOTE_TYPE final public static int SINGLE_QUOTE_TYPE (Code)
SLASH_TYPE final public static int SLASH_TYPE (Code)
STAR_TYPE final public static int STAR_TYPE (Code)
braces final public static String [] braces (Code) An array of the special characters that signify areas of text other than gaps. NOTE: this data structure is NOT
simply a flat array. Matching characters are placed next to each other (except for the trailing elements,
which have no matches). Notice that single and double quotes match themselves.
See Also: String
MakeBrace public static Brace MakeBrace(String type, ReducedModelState state)(Code) Virtual constructor.
Parameters: type - the brace textParameters: state - whether the brace is shadwowed by a comment, quote etc a new Brace if type is valid, otherwise nullthrows: BraceException - if the given type is not a valid brace type.
flip public void flip()(Code) Flips the orientation of the brace. Useful for updating quote information.
getSize public int getSize()(Code) the size of the brace and its preceding gap.
getType public String getType()(Code) Get the text of the brace.
the text of the Brace
isBlockCommentEnd public boolean isBlockCommentEnd()(Code) true if this is a block comment close delimiter
isBlockCommentStart public boolean isBlockCommentStart()(Code) true if this is a block comment open delimiter
isClosed public boolean isClosed()(Code) Indicates whether this is a closing brace.
true if the brace is a closing brace.
isClosedBrace public boolean isClosedBrace()(Code) true if this is }|)|]
isDoubleEscape public boolean isDoubleEscape()(Code) true if this is \\
isDoubleEscapeSequence public boolean isDoubleEscapeSequence()(Code) true if this is \\ or \"
isDoubleQuote public boolean isDoubleQuote()(Code) true if this is a double quote
isEscapedDoubleQuote public boolean isEscapedDoubleQuote()(Code) true if this is \"
isEscapedSingleQuote public boolean isEscapedSingleQuote()(Code) true if this is \'
isGap public boolean isGap()(Code) Implementation of abstract function. Braces, of course, are never Gaps.
isLineComment public boolean isLineComment()(Code) true if this is a line comment delimiter
isMatch public boolean isMatch(Brace other)(Code) Check if two braces match.
Parameters: other - the brace to compare true if this is a match for other.
isMatchable public boolean isMatchable()(Code) Determines if this Brace is matchable (one of "{", "}", "(", ")", "[", "]").
isMultipleCharBrace public boolean isMultipleCharBrace()(Code) true if this is a multiple character brace
isNewline public boolean isNewline()(Code) true if this is a newline delimiter
isOpen public boolean isOpen()(Code) Indicates whether this is an opening brace.
true if the brace is an opening brace.
isOpenBrace public boolean isOpenBrace()(Code) true if this is {|(|[
isSingleQuote public boolean isSingleQuote()(Code) true if this is a single quote
isSlash public boolean isSlash()(Code) true if this is /
isStar public boolean isStar()(Code) true if this is *
setType public void setType(String type)(Code) Reset the type of this brace.
Parameters: type - the new String type for the brace
toString public String toString()(Code) Converts a Brace to a String.
Used for debugging.
the string representation of the Brace.