org.skunk.swing.text
Class PositiveIntegerEntryFilter
java.lang.Object
|
+--org.skunk.swing.text.PositiveIntegerEntryFilter
- All Implemented Interfaces:
- EntryFilter
- public class PositiveIntegerEntryFilter
- extends java.lang.Object
- implements EntryFilter
an EntryFilter that accepts only positive integers within the given range
Method Summary |
boolean |
accepts(int offs,
java.lang.String str,
javax.swing.text.AttributeSet a,
java.lang.String wholeString)
should return whether the filter accepts the insertion of the given str into the document text. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PositiveIntegerEntryFilter
public PositiveIntegerEntryFilter(int min,
int max)
- constructs a filter with the given minimum and maximum values.
- Parameters:
min
- the minimum accepted valuemax
- the maximum accepted value
accepts
public boolean accepts(int offs,
java.lang.String str,
javax.swing.text.AttributeSet a,
java.lang.String wholeString)
- Description copied from interface:
EntryFilter
- should return whether the filter accepts the insertion of the given str into the document text.
- Specified by:
accepts
in interface EntryFilter
- Following copied from interface:
org.skunk.swing.text.EntryFilter
- Parameters:
offs
- the offset into the documentstr
- the string being inserteda
- the attributes of the insertwholeString
- the whole text of the document