xv.text
Class CharSequenceSubSequence

java.lang.Object
  extended by xv.text.CharSequenceSubSequence
All Implemented Interfaces:
CharSequence

public class CharSequenceSubSequence
extends Object
implements CharSequence

Utility class for creating subsequences of CharSequence objects, mainly intended for implementing CharSequence.subSequence(int, int) and something that I think Sun should include on their own, but that's beside the point.

Author:
xv

Constructor Summary
CharSequenceSubSequence(CharSequence base, int start, int end)
           
 
Method Summary
 char charAt(int index)
          Gets the character at the given index.
 boolean equals(Object obj)
          Checks if this CharSequenceSubSequence is equal to another
 int hashCode()
          Generates a hashcode.
 int length()
          The length of the character sequence.
 CharSequence subSequence(int start, int end)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharSequenceSubSequence

public CharSequenceSubSequence(CharSequence base,
                               int start,
                               int end)
Method Detail

charAt

public char charAt(int index)
Gets the character at the given index.

Specified by:
charAt in interface CharSequence

length

public int length()
The length of the character sequence.

Specified by:
length in interface CharSequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Specified by:
subSequence in interface CharSequence

hashCode

public int hashCode()
Generates a hashcode. This will generate a hashcode based on the original object and the current offset and length. Note that CharSequence does not define the meaning of the hashcode, and the return value is entirely dependent on the original CharSequence given.

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Checks if this CharSequenceSubSequence is equal to another

Overrides:
equals in class Object

toString

public String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class Object


Copyright © 2008-2011. All Rights Reserved.