Top Description Fields Constructors Methods
uk.ac.ed.ph.snuggletex

public Class SimpleNumberMatcher

extends Object
implements NumberMatcher
Class Inheritance
All Implemented Interfaces
uk.ac.ed.ph.snuggletex.NumberMatcher
Imports
java.text.DecimalFormatSymbols, java.util.Locale

Very basic but fast implementation of NumberMatcher that handles western-style numeric characters, supporting Locale-specific decimal points.
Author
David McKain
Since
1.3.0
Version
$Revision$
See Also
DecimalFormatNumberMatcher

Field Summary

Modifier and TypeField and Description
private final char

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public int
getNumberEnd(InputContext input, int startIndex)

Implements uk.ac.ed.ph.snuggletex.NumberMatcher.getNumberEnd.

Implementations should analyse the given InputContext starting at the given index to see if it looks like an (unsigned) number.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

decimalCharback to summary
private final char decimalChar

Constructor Detail

SimpleNumberMatcherback to summary
public SimpleNumberMatcher()
SimpleNumberMatcherback to summary
public SimpleNumberMatcher(Locale locale)

Method Detail

getNumberEndback to summary
public int getNumberEnd(InputContext input, int startIndex)

Implements uk.ac.ed.ph.snuggletex.NumberMatcher.getNumberEnd.

Doc from uk.ac.ed.ph.snuggletex.NumberMatcher.getNumberEnd.

Implementations should analyse the given InputContext starting at the given index to see if it looks like an (unsigned) number. If it is a number, return the index of the next non-number character. Otherwise, return -1.