org.zaval.lw.mask
Class MaskElement

java.lang.Object
  |
  +--org.zaval.lw.mask.MaskElement

public class MaskElement
extends java.lang.Object

This class describes mask element. The mask element is bound with one or several mask tags and represents some logical mask element, for example date. Any mask element has a type that is defined by MaskValidator. The masked text field stores string mask as a set of mask elements.


Field Summary
protected  int size
           
protected  char[] tags
           
protected  int type
           
protected  char[] value
           
 
Constructor Summary
MaskElement()
           
 
Method Summary
 int getSize()
          Gets the mask element size.
 char getTagAt(int index)
          Gets the tag at the specified index.
 java.lang.String getTags()
          Gets the tags string.
 int getType()
          Gets the mask element type.
 java.lang.String getValue()
          Gets the mask element value.
 java.lang.String getValueByTag(int index, char tag)
          Gets the value for the specified tag name starting at the specified index.
static java.lang.String getValueByTag(MaskElement e, int index, char tag, java.lang.String value)
          Fetches mask element value from the specified value string for the specified mask element, the given tag at the specified index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected char[] value

tags

protected char[] tags

size

protected int size

type

protected int type
Constructor Detail

MaskElement

public MaskElement()
Method Detail

getValue

public java.lang.String getValue()
Gets the mask element value.
Returns:
a mask element value.

getValueByTag

public java.lang.String getValueByTag(int index,
                                      char tag)
Gets the value for the specified tag name starting at the specified index.
Parameters:
index - the index.
tag - the tag name.
Returns:
a value.

getTags

public java.lang.String getTags()
Gets the tags string. The string represents all tags for the mask element.
Returns:
a tags string.

getTagAt

public char getTagAt(int index)
Gets the tag at the specified index.
Parameters:
index - the specified index.
Returns:
a tag.

getType

public int getType()
Gets the mask element type.
Returns:
a mask element type.

getSize

public int getSize()
Gets the mask element size.
Returns:
a mask element size.

getValueByTag

public static java.lang.String getValueByTag(MaskElement e,
                                             int index,
                                             char tag,
                                             java.lang.String value)
Fetches mask element value from the specified value string for the specified mask element, the given tag at the specified index.
Parameters:
e - the specified mask element.
index - the specified index.
tag - the specified tag.
value - the specified value.
Returns:
a value.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org