|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedToken | +--edu.rice.cs.drjava.model.definitions.reducedmodel.Brace
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.
Field Summary | |
protected int |
_type
the type of the brace |
static String |
BLK_CMT_BEG
|
static String |
BLK_CMT_END
|
static String[] |
braces
An array of the special characters that signify areas of text other than gaps. |
static String |
DOUBLE_QUOTE
|
static String |
EOLN
|
static String |
LINE_CMT
|
static String |
SINGLE_QUOTE
|
static String |
SLASH
|
static String |
STAR
|
Fields inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedToken |
_state |
Fields inherited from interface edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelStates |
FREE, INSIDE_BLOCK_COMMENT, INSIDE_DOUBLE_QUOTE, INSIDE_LINE_COMMENT, INSIDE_SINGLE_QUOTE, STUTTER |
Constructor Summary | |
private |
Brace(int type,
ReducedModelState state)
Constructor. |
Method Summary | |
protected static int |
findBrace(String type)
Determine the brace type of a given String. |
void |
flip()
Flips the orientation of the brace. |
int |
getSize()
Get the size of the token. |
String |
getType()
Get the text of the brace. |
void |
grow(int delta)
Braces can't grow. |
boolean |
isBlockCommentEnd()
7 |
boolean |
isBlockCommentStart()
put your documentation comment here |
boolean |
isClosed()
Indicates whether this is a closing brace. |
boolean |
isClosedBrace()
put your documentation comment here |
boolean |
isDoubleEscape()
put your documentation comment here |
boolean |
isDoubleEscapeSequence()
put your documentation comment here |
boolean |
isDoubleQuote()
put your documentation comment here |
boolean |
isEscapedDoubleQuote()
put your documentation comment here |
boolean |
isEscapedSingleQuote()
put your documentation comment here |
boolean |
isGap()
Implementation of abstract function. |
boolean |
isLineComment()
put your documentation comment here |
boolean |
isMatch(ReducedToken other)
Check if two braces match. |
boolean |
isMultipleCharBrace()
put your documentation comment here |
boolean |
isNewline()
put your documentation comment here |
boolean |
isOpen()
Indicates whether this is an opening brace. |
boolean |
isOpenBrace()
put your documentation comment here |
boolean |
isSingleQuote()
put your documentation comment here |
boolean |
isSlash()
put your documentation comment here |
boolean |
isStar()
put your documentation comment here |
static Brace |
MakeBrace(String type,
ReducedModelState state)
Virtual constructor. |
void |
setType(String type)
Reset the type of this brace. |
void |
shrink(int delta)
Braces can't shrink. |
String |
toString()
Converts a Brace to a String. |
Methods inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedToken |
getHighlightState, getState, isCommented, isInBlockComment, isInLineComment, isQuoted, isShadowed, setState |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final String[] braces
String
public static final String BLK_CMT_BEG
public static final String BLK_CMT_END
public static final String EOLN
public static final String LINE_CMT
public static final String SINGLE_QUOTE
public static final String DOUBLE_QUOTE
public static final String STAR
public static final String SLASH
protected int _type
Constructor Detail |
private Brace(int type, ReducedModelState state)
type
- the brace typewidth
- the size of the brace and its gapMethod Detail |
public static Brace MakeBrace(String type, ReducedModelState state)
type
- the brace textstate
- whether the brace is shadwowed by a comment, quote etcpublic String getType()
getType
in class ReducedToken
public int getSize()
ReducedToken
getSize
in class ReducedToken
public String toString()
toString
in class Object
public void flip()
flip
in class ReducedToken
public boolean isOpen()
isOpen
in class ReducedToken
public boolean isOpenBrace()
ReducedToken
isOpenBrace
in class ReducedToken
public boolean isClosedBrace()
ReducedToken
isClosedBrace
in class ReducedToken
public boolean isClosed()
isClosed
in class ReducedToken
public void setType(String type)
setType
in class ReducedToken
type
- the new String type for the braceprotected static int findBrace(String type)
type
- the text of the bracepublic boolean isMatch(ReducedToken other)
isMatch
in class ReducedToken
other
- the brace to comparepublic boolean isDoubleQuote()
ReducedToken
isDoubleQuote
in class ReducedToken
public boolean isSingleQuote()
ReducedToken
isSingleQuote
in class ReducedToken
edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedToken
public boolean isLineComment()
ReducedToken
isLineComment
in class ReducedToken
public boolean isBlockCommentStart()
ReducedToken
isBlockCommentStart
in class ReducedToken
public boolean isBlockCommentEnd()
isBlockCommentEnd
in class ReducedToken
public boolean isNewline()
ReducedToken
isNewline
in class ReducedToken
public boolean isMultipleCharBrace()
ReducedToken
isMultipleCharBrace
in class ReducedToken
public boolean isDoubleEscapeSequence()
ReducedToken
isDoubleEscapeSequence
in class ReducedToken
public boolean isDoubleEscape()
ReducedToken
isDoubleEscape
in class ReducedToken
public boolean isEscapedDoubleQuote()
ReducedToken
isEscapedDoubleQuote
in class ReducedToken
public boolean isEscapedSingleQuote()
ReducedToken
isEscapedSingleQuote
in class ReducedToken
public boolean isGap()
isGap
in class ReducedToken
public boolean isSlash()
ReducedToken
isSlash
in class ReducedToken
public boolean isStar()
ReducedToken
isStar
in class ReducedToken
public void grow(int delta)
grow
in class ReducedToken
RuntimeException
- public void shrink(int delta)
shrink
in class ReducedToken
RuntimeException
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |