FileDocCategorySizeDatePackage
CharSequenceTokenizer.javaAPI DocExample2711Sat Jan 24 10:44:26 GMT 2004je3.classes

CharSequenceTokenizer

public class CharSequenceTokenizer extends AbstractTokenizer
This trivial subclass of AbstractTokenizer is suitable for tokenizing input stored in a String, StringBuffer, CharBuffer, or any other class that implements CharSequence. Because CharSequence instances may be mutable, the construtor makes an internal copy of the character sequence. This means that any subsequent changes to the character sequence will not be seen during tokenizing.
author
David Flanagan

Fields Summary
char[]
buffer
Constructors Summary
public CharSequenceTokenizer(CharSequence sequence)
Construct a new CharSequenceTokenizer to tokenize sequence. This constructor makes an internal copy of the characters in the specified sequence.

param
sequence the character sequence to be tokenized.

	buffer = sequence.toString().toCharArray();
    
Methods Summary
protected voidcreateBuffer(int bufferSize)
Set the inherited {@link #text} and {@link #numChars} fields. This class knows the complete length of the input text, so it ignores the bufferSize argument uses teh complete input sequence.

param
bufferSize ignored in this implementation

	assert text == null;       // verify that we're only called once
	text = buffer;
	numChars = buffer.length;
    
protected booleanfillBuffer()
Return false to indicate no more input is available. {@link #createBuffer} fills the buffer with the complete input sequence, so this method returns false to indicate that no more text is available.

return
always returns false.

 return false;