chrriis.dj.swingsuite
Class TextEntryMask

java.lang.Object
  extended by chrriis.dj.swingsuite.TextEntryMask

public abstract class TextEntryMask
extends Object

The superclass of all masks.

Author:
Christopher Deckers

Constructor Summary
TextEntryMask()
           
 
Method Summary
protected abstract  Integer getCodePoint(String text, int codePoint, int position)
          Considering some text and a code point that is being inserted at a given position, return the code point to actually insert or null if the insertion is not allowed.
protected abstract  int getDefaultCodePoint(int position)
          Get the code point to use at a specific position when there is no user input.
protected abstract  int getLength()
          Get the length of this mask.
protected abstract  int getNextValidInputPosition(int position)
          Get the next valid input position that is the same or after the specified postion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextEntryMask

public TextEntryMask()
Method Detail

getCodePoint

protected abstract Integer getCodePoint(String text,
                                        int codePoint,
                                        int position)
Considering some text and a code point that is being inserted at a given position, return the code point to actually insert or null if the insertion is not allowed.

Parameters:
text - the text in which the insertion will occur.
codePoint - the code point that is being inserted.
position - the position at which the code point is inserted.
Returns:
the actual code point to insert, or null if this insertion is not allowed.

getLength

protected abstract int getLength()
Get the length of this mask.

Returns:
the length of this mask.

getDefaultCodePoint

protected abstract int getDefaultCodePoint(int position)
Get the code point to use at a specific position when there is no user input.

Parameters:
position - the position for which to get the code point.
Returns:
the default code point.

getNextValidInputPosition

protected abstract int getNextValidInputPosition(int position)
Get the next valid input position that is the same or after the specified postion.

Parameters:
position - the reference position to get the next valid one.