org.openide.util 8.6.1

org.openide.util
Class CharSequences

java.lang.Object
  extended by org.openide.util.CharSequences

public final class CharSequences
extends Object

Useful static methods to provide and work with memory efficient CharSequence implementations for ASCII strings.

Since:
8.3

Method Summary
static Comparator<CharSequence> comparator()
          Provides optimized char sequences comparator
static CharSequence create(char[] buf, int start, int count)
          Provides compact char sequence object like String.String(char[], int, int)
static CharSequence create(CharSequence s)
          Provides compact char sequence object like String.String(String)
static CharSequence empty()
          Returns object to represent empty sequence ""
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 boolean isCompact(CharSequence cs)
          Predicate to check if provides char sequence is based on compact implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static CharSequence create(char[] buf,
                                  int start,
                                  int count)
Provides compact char sequence object like String.String(char[], int, int)


create

public static CharSequence create(CharSequence s)
Provides compact char sequence object like String.String(String)


comparator

public static Comparator<CharSequence> comparator()
Provides optimized char sequences comparator

Returns:
comparator

empty

public static CharSequence empty()
Returns object to represent empty sequence ""

Returns:
char sequence to represent empty sequence

isCompact

public static boolean isCompact(CharSequence cs)
Predicate to check if provides char sequence is based on compact implementation

Parameters:
cs - char sequence object to check
Returns:
true if compact implementation, false otherwise

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.


org.openide.util 8.6.1

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