org.netbeans.modules.lexer/2 1.39.1 1

org.netbeans.api.lexer
Class TokenUtilities

java.lang.Object
  extended by org.netbeans.api.lexer.TokenUtilities

public final class TokenUtilities
extends Object

Various utility methods related to token text.


Method Summary
static String debugText(CharSequence text)
          Return the given text as String translating the special characters (and '\') into escape sequences.
static boolean endsWith(CharSequence text, CharSequence suffix)
          Implementation of String.endsWith(String) for character sequences.
static boolean equals(CharSequence text, Object o)
          Compare character sequence to another object.
static int indexOf(CharSequence text, CharSequence seq)
          Implementation of String.indexOf(String) for character sequences.
static int indexOf(CharSequence text, CharSequence seq, int fromIndex)
          Implementation of String.indexOf(String,int) for character sequences.
static int indexOf(CharSequence text, int ch)
          Implementation of String.indexOf(int) for character sequences.
static int indexOf(CharSequence text, int ch, int fromIndex)
          Implementation of String.indexOf(int,int) for character sequences.
static int lastIndexOf(CharSequence text, CharSequence seq)
          Implementation of String.lastIndexOf(String) for character sequences.
static int lastIndexOf(CharSequence text, CharSequence seq, int fromIndex)
          Implementation of String.lastIndexOf(String,int) for character sequences.
static int lastIndexOf(CharSequence text, int ch)
          Implementation of String.lastIndexOf(int) for character sequences.
static int lastIndexOf(CharSequence text, int ch, int fromIndex)
          Implementation of String.lastIndexOf(int,int) for character sequences.
static boolean startsWith(CharSequence text, CharSequence prefix)
          Implementation of String.startsWith(String) for character sequences.
static boolean textEquals(CharSequence text1, CharSequence text2)
          Test whether the given character sequences represent the same text content.
static CharSequence trim(CharSequence text)
          Implementation of String.trim() for character sequences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

textEquals

public static boolean textEquals(CharSequence text1,
                                 CharSequence text2)
Test whether the given character sequences represent the same text content.

Parameters:
text1 - non-null text to be compared to the other text parameter.
text2 - non-null text to be compared to the previous text parameter.
Returns:
true if the given character sequences represent the same text content.

equals

public static boolean equals(CharSequence text,
                             Object o)
Compare character sequence to another object. The match is successful if the second object is a character sequence as well and both character sequences contain the same characters (or if both objects are null).

Parameters:
text - character sequence being compared to the given object. It may be null.
o - object to be compared to the character sequence. It may be null.
Returns:
true if both parameters are null or both are non-null and they contain the same text.

indexOf

public static int indexOf(CharSequence text,
                          int ch)
Implementation of String.indexOf(int) for character sequences.


indexOf

public static int indexOf(CharSequence text,
                          int ch,
                          int fromIndex)
Implementation of String.indexOf(int,int) for character sequences.


indexOf

public static int indexOf(CharSequence text,
                          CharSequence seq)
Implementation of String.indexOf(String) for character sequences.


indexOf

public static int indexOf(CharSequence text,
                          CharSequence seq,
                          int fromIndex)
Implementation of String.indexOf(String,int) for character sequences.


lastIndexOf

public static int lastIndexOf(CharSequence text,
                              CharSequence seq)
Implementation of String.lastIndexOf(String) for character sequences.


lastIndexOf

public static int lastIndexOf(CharSequence text,
                              CharSequence seq,
                              int fromIndex)
Implementation of String.lastIndexOf(String,int) for character sequences.


lastIndexOf

public static int lastIndexOf(CharSequence text,
                              int ch)
Implementation of String.lastIndexOf(int) for character sequences.


lastIndexOf

public static int lastIndexOf(CharSequence text,
                              int ch,
                              int fromIndex)
Implementation of String.lastIndexOf(int,int) for character sequences.


startsWith

public static boolean startsWith(CharSequence text,
                                 CharSequence prefix)
Implementation of String.startsWith(String) for character sequences.


endsWith

public static boolean endsWith(CharSequence text,
                               CharSequence suffix)
Implementation of String.endsWith(String) for character sequences.


trim

public static CharSequence trim(CharSequence text)
Implementation of String.trim() for character sequences.


debugText

public static String debugText(CharSequence text)
Return the given text as String translating the special characters (and '\') into escape sequences.

Parameters:
text - non-null text to be debugged.
Returns:
non-null string containing the debug text.

org.netbeans.modules.lexer/2 1.39.1 1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.