站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

TokenHierarchyEvent (Lexer) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.lexer/2 1.19.0 1

org.netbeans.api.lexer
Class TokenHierarchyEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.netbeans.api.lexer.TokenHierarchyEvent
All Implemented Interfaces:
Serializable

public final class TokenHierarchyEvent
extends EventObject

Description of the changes made in a token hierarchy.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 int affectedEndOffset()
          Get end offset of the area that was affected by the attached token change(s).
 int affectedStartOffset()
          Get start offset of the area that was affected by the attached token change(s).
 int insertedLength()
          Get number of characters inserted by the text modification that caused this token change.
 int modificationOffset()
          Get offset in the input source where the modification occurred.
 int removedLength()
          Get number of characters removed by the text modification that caused this token change.
 TokenChange<? extends TokenId> tokenChange()
          Get the token change that occurred in the tokens at the top-level of the token hierarchy.
<T extends TokenId>
TokenChange<T>
tokenChange(Language<T> language)
          Get the token change if the top level of the token hierarchy contains tokens of the given language.
 TokenHierarchy<?> tokenHierarchy()
          Get source of this event as a token hierarchy instance.
 TokenHierarchyEventType type()
          Get reason why a token hierarchy event was fired.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

tokenHierarchy

public TokenHierarchy<?> tokenHierarchy()
Get source of this event as a token hierarchy instance.


type

public TokenHierarchyEventType type()
Get reason why a token hierarchy event was fired.


tokenChange

public TokenChange<? extends TokenId> tokenChange()
Get the token change that occurred in the tokens at the top-level of the token hierarchy.


tokenChange

public <T extends TokenId> TokenChange<T> tokenChange(Language<T> language)
Get the token change if the top level of the token hierarchy contains tokens of the given language.

Parameters:
language - non-null language.
Returns:
non-null token change if the language at the top level of the token hierarchy equals to the given language. Returns null otherwise.

affectedStartOffset

public int affectedStartOffset()
Get start offset of the area that was affected by the attached token change(s).


affectedEndOffset

public int affectedEndOffset()
Get end offset of the area that was affected by the attached token change(s).
If there was a text modification the offsets are related to the state after the modification.


modificationOffset

public int modificationOffset()
Get offset in the input source where the modification occurred.

Returns:
modification offset or -1 if this event's type is not TokenHierarchyEventType.MODIFICATION.

insertedLength

public int insertedLength()
Get number of characters inserted by the text modification that caused this token change.

Returns:
number of inserted characters by the modification.
Returns 0 if this event's type is not TokenHierarchyEventType.MODIFICATION.

removedLength

public int removedLength()
Get number of characters removed by the text modification that caused this token change.

Returns:
number of inserted characters by the modification.
Returns 0 if this event's type is not TokenHierarchyEventType.MODIFICATION.

org.netbeans.modules.lexer/2 1.19.0 1

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.