edu.rice.cs.drjava.model.definitions.reducedmodel
Class ReducedToken

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedToken
All Implemented Interfaces:
ReducedModelStates
Direct Known Subclasses:
Brace, Gap

public abstract class ReducedToken
extends Object
implements ReducedModelStates

The representation of document text in the reduced model. It is the core atomic piece.

Version:
$Id: ReducedToken.java,v 1.19 2002/02/08 14:22:21 brianstoler Exp $

Field Summary
private  ReducedModelState _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
ReducedToken(ReducedModelState state)
           
 
Method Summary
abstract  void flip()
          Flip between open and closed.
 int getHighlightState()
          returns whether the current char is highlighted.
abstract  int getSize()
          Get the size of the token.
 ReducedModelState getState()
          Get the shadowing state of the token.
abstract  String getType()
          Get the type of the token.
abstract  void grow(int delta)
          put your documentation comment here
abstract  boolean isBlockCommentEnd()
          put your documentation comment here
abstract  boolean isBlockCommentStart()
          put your documentation comment here
abstract  boolean isClosed()
          put your documentation comment here
abstract  boolean isClosedBrace()
          put your documentation comment here
 boolean isCommented()
          Indicates whether this brace is commented out.
abstract  boolean isDoubleEscape()
          put your documentation comment here
abstract  boolean isDoubleEscapeSequence()
          put your documentation comment here
abstract  boolean isDoubleQuote()
          put your documentation comment here
abstract  boolean isEscapedDoubleQuote()
          put your documentation comment here
abstract  boolean isEscapedSingleQuote()
          put your documentation comment here
abstract  boolean isGap()
          put your documentation comment here
 boolean isInBlockComment()
          put your documentation comment here
 boolean isInLineComment()
          put your documentation comment here
abstract  boolean isLineComment()
          put your documentation comment here
abstract  boolean isMatch(ReducedToken other)
          Determine if the given token is a open/close match with this.
abstract  boolean isMultipleCharBrace()
          put your documentation comment here
abstract  boolean isNewline()
          put your documentation comment here
abstract  boolean isOpen()
          put your documentation comment here
abstract  boolean isOpenBrace()
          put your documentation comment here
 boolean isQuoted()
          Indicates whether this brace is inside quotes.
 boolean isShadowed()
          Indicates whether this brace is shadowed.
abstract  boolean isSingleQuote()
          put your documentation comment here
abstract  boolean isSlash()
          put your documentation comment here
abstract  boolean isStar()
          put your documentation comment here
 void setState(ReducedModelState state)
          put your documentation comment here
abstract  void setType(String type)
          Set the type of the token
abstract  void shrink(int delta)
          put your documentation comment here
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_state

private ReducedModelState _state
Constructor Detail

ReducedToken

public ReducedToken(ReducedModelState state)
Method Detail

getSize

public abstract int getSize()
Get the size of the token.
Returns:
the number of characters represented by the token

getType

public abstract String getType()
Get the type of the token.
Returns:
a String representation of the token type

setType

public abstract void setType(String type)
Set the type of the token
Parameters:
type - a String representation of the new token type

flip

public abstract void flip()
Flip between open and closed. Valid only for braces.

isMatch

public abstract boolean isMatch(ReducedToken other)
Determine if the given token is a open/close match with this.
Parameters:
other - another ReducedToken
Returns:
true if there is a match

getState

public ReducedModelState getState()
Get the shadowing state of the token.
Returns:
FREE|INSIDE_SINGLE_QUOTE|INSIDE_DOUBLE_QUOTE|INSIDE_LINE_COMMENT| INSIDE_BLOCK_COMMENT

getHighlightState

public int getHighlightState()
returns whether the current char is highlighted. / / beginning a comment would be highlighted but free, so its not the same as getState

setState

public void setState(ReducedModelState state)
put your documentation comment here
Parameters:
state -  

isShadowed

public boolean isShadowed()
Indicates whether this brace is shadowed. Shadowing occurs when a brace has been swallowed by a comment or an open quote.
Returns:
true if the brace is shadowed.

isQuoted

public boolean isQuoted()
Indicates whether this brace is inside quotes.
Returns:
true if the brace is inside quotes.

isCommented

public boolean isCommented()
Indicates whether this brace is commented out.
Returns:
true if the brace is hidden by comments.

isInBlockComment

public boolean isInBlockComment()
put your documentation comment here
Returns:
 

isInLineComment

public boolean isInLineComment()
put your documentation comment here
Returns:
 

isMultipleCharBrace

public abstract boolean isMultipleCharBrace()
put your documentation comment here
Returns:
 

isGap

public abstract boolean isGap()
put your documentation comment here
Returns:
 

isLineComment

public abstract boolean isLineComment()
put your documentation comment here
Returns:
 

isBlockCommentStart

public abstract boolean isBlockCommentStart()
put your documentation comment here
Returns:
 

isBlockCommentEnd

public abstract boolean isBlockCommentEnd()
put your documentation comment here
Returns:
 

isNewline

public abstract boolean isNewline()
put your documentation comment here
Returns:
 

isSlash

public abstract boolean isSlash()
put your documentation comment here
Returns:
 

isStar

public abstract boolean isStar()
put your documentation comment here
Returns:
 

isDoubleQuote

public abstract boolean isDoubleQuote()
put your documentation comment here
Returns:
 

isSingleQuote

public abstract boolean isSingleQuote()
put your documentation comment here
Returns:
 

isDoubleEscapeSequence

public abstract boolean isDoubleEscapeSequence()
put your documentation comment here
Returns:
 

isDoubleEscape

public abstract boolean isDoubleEscape()
put your documentation comment here
Returns:
 

isEscapedSingleQuote

public abstract boolean isEscapedSingleQuote()
put your documentation comment here
Returns:
 

isEscapedDoubleQuote

public abstract boolean isEscapedDoubleQuote()
put your documentation comment here
Returns:
 

grow

public abstract void grow(int delta)
put your documentation comment here
Parameters:
delta -  

shrink

public abstract void shrink(int delta)
put your documentation comment here
Parameters:
delta -  

isOpen

public abstract boolean isOpen()
put your documentation comment here
Returns:
 

isClosed

public abstract boolean isClosed()
put your documentation comment here
Returns:
 

isOpenBrace

public abstract boolean isOpenBrace()
put your documentation comment here
Returns:
 

isClosedBrace

public abstract boolean isClosedBrace()
put your documentation comment here
Returns: