net.sourceforge.chaperon.model.pattern
Class CharacterClass

java.lang.Object
  extended bynet.sourceforge.chaperon.model.pattern.Pattern
      extended bynet.sourceforge.chaperon.model.pattern.CharacterClass
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class CharacterClass
extends Pattern

This class describes a pattern for a character class, which means the a character matches against a element of this class.

Version:
CVS $Id: CharacterClass.java,v 1.9 2004/01/15 20:13:35 benedikta Exp $
Author:
Stephan Michels
See Also:
Serialized Form

Constructor Summary
CharacterClass()
          Creates a pattern for a character class.
 
Method Summary
 void addCharacterClassElement(CharacterClassElement element)
          Add a character class element
 void addCharacterClassElement(CharacterClassElement[] elements)
           
 java.lang.Object clone()
          Create a clone of this pattern.
 CharacterClassElement[] getCharacterClassElement()
           
 CharacterClassElement getCharacterClassElement(int index)
          Returns a character class element
 int getCharacterClassElementCount()
          Returns the count of character class elements
 boolean isExclusive()
          If this character class is exclusive
 void setExclusive(boolean exclusive)
          If the comparing character must match to the elements, or should not match to the elements.
 java.lang.String toString()
          Create a clone of this pattern.
 Violations validate()
          Validates this pattern.
 
Methods inherited from class net.sourceforge.chaperon.model.pattern.Pattern
getLocation, getMaxOccurs, getMaxOccursAsString, getMinOccurs, getMinOccursAsString, setLocation, setMaxOccurs, setMaxOccursAsString, setMinOccurs, setMinOccursAsString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharacterClass

public CharacterClass()
Creates a pattern for a character class.

Method Detail

addCharacterClassElement

public void addCharacterClassElement(CharacterClassElement element)
Add a character class element

Parameters:
element - Element, which should be added

addCharacterClassElement

public void addCharacterClassElement(CharacterClassElement[] elements)

getCharacterClassElement

public CharacterClassElement getCharacterClassElement(int index)
Returns a character class element

Parameters:
index - Index of the character class element
Returns:
Character class element

getCharacterClassElement

public CharacterClassElement[] getCharacterClassElement()

getCharacterClassElementCount

public int getCharacterClassElementCount()
Returns the count of character class elements

Returns:
Count of character class elements

setExclusive

public void setExclusive(boolean exclusive)
If the comparing character must match to the elements, or should not match to the elements.

Parameters:
exclusive - If the character class should be exclusive.

isExclusive

public boolean isExclusive()
If this character class is exclusive

Returns:
If the character class should be exclusive.

toString

public java.lang.String toString()
Create a clone of this pattern.

Returns:
Clone of this pattern.
Throws:
java.lang.CloneNotSupportedException - If an exception occurs during the cloning.

clone

public java.lang.Object clone()
Create a clone of this pattern.

Specified by:
clone in class Pattern
Returns:
Clone of this pattern.
Throws:
java.lang.CloneNotSupportedException - If an exception occurs during the cloning.

validate

public Violations validate()
Validates this pattern.

Specified by:
validate in class Pattern
Returns:
Return a list of violations, if this pattern isn't valid.


Copyright ? 2003 Chaperon project. All Rights Reserved.