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


Constructor Summary
PositiveIntegerEntryFilter(int min, int max)
          constructs a filter with the given minimum and maximum values.
 
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
 

Constructor Detail

PositiveIntegerEntryFilter

public PositiveIntegerEntryFilter(int min,
                                  int max)
constructs a filter with the given minimum and maximum values.
Parameters:
min - the minimum accepted value
max - the maximum accepted value
Method Detail

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 document
str - the string being inserted
a - the attributes of the insert
wholeString - the whole text of the document