org.apache.xalan.templates
Class ElemNumber.NumberFormatStringTokenizer

java.lang.Object
  extended byorg.apache.xalan.templates.ElemNumber.NumberFormatStringTokenizer
Enclosing class:
ElemNumber

class ElemNumber.NumberFormatStringTokenizer
extends Object

This class returns tokens using non-alphanumberic characters as delimiters.


Field Summary
private  int currentPosition
          Current position in the format string
private  int maxPosition
          Index of last character in the format string
private  String str
          Format string to be tokenized
 
Constructor Summary
ElemNumber.NumberFormatStringTokenizer(String str)
          Construct a NumberFormatStringTokenizer.
 
Method Summary
 int countTokens()
          Calculates the number of times that this tokenizer's nextToken method can be called before it generates an exception.
 boolean hasMoreTokens()
          Tells if nextToken will throw an exception if it is called.
 boolean isLetterOrDigitAhead()
          Tells if there is a digit or a letter character ahead.
 boolean nextIsSep()
          Tells if there is a digit or a letter character ahead.
 String nextToken()
          Returns the next token from this string tokenizer.
 void reset()
          Reset tokenizer so that nextToken() starts from the beginning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentPosition

private int currentPosition
Current position in the format string


maxPosition

private int maxPosition
Index of last character in the format string


str

private String str
Format string to be tokenized

Constructor Detail

ElemNumber.NumberFormatStringTokenizer

public ElemNumber.NumberFormatStringTokenizer(String str)
Construct a NumberFormatStringTokenizer.

Parameters:
str - Format string to be tokenized
Method Detail

reset

public void reset()
Reset tokenizer so that nextToken() starts from the beginning.


nextToken

public String nextToken()
Returns the next token from this string tokenizer.

Returns:
the next token from this string tokenizer.
Throws:
NoSuchElementException - if there are no more tokens in this tokenizer's string.

isLetterOrDigitAhead

public boolean isLetterOrDigitAhead()
Tells if there is a digit or a letter character ahead.

Returns:
true if there is a number or character ahead.

nextIsSep

public boolean nextIsSep()
Tells if there is a digit or a letter character ahead.

Returns:
true if there is a number or character ahead.

hasMoreTokens

public boolean hasMoreTokens()
Tells if nextToken will throw an exception if it is called.

Returns:
true if nextToken can be called without throwing an exception.

countTokens

public int countTokens()
Calculates the number of times that this tokenizer's nextToken method can be called before it generates an exception.

Returns:
the number of tokens remaining in the string using the current delimiter set.
See Also:
StringTokenizer.nextToken()