net.sourceforge.chaperon.model.extended
Class CharacterClass

java.lang.Object
  extended bynet.sourceforge.chaperon.model.extended.Pattern
      extended bynet.sourceforge.chaperon.model.extended.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/10 16:08:15 benedikta Exp $
Author:
Stephan Michels
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.chaperon.model.extended.Pattern
index
 
Constructor Summary
CharacterClass()
          Creates a pattern for a character class.
 
Method Summary
 void addCharacterInterval(CharacterInterval interval)
           
 void addSingleCharacter(SingleCharacter character)
           
 java.lang.Object clone()
          Create a clone of this pattern.
 boolean contains(char c)
           
 boolean contains(char minimum, char maximum)
           
 CharacterInterval getCharacterInterval(int index)
           
 int getCharacterIntervalCount()
           
 CharacterInterval[] getCharacterIntervals()
           
 char[] getLimits()
           
 SingleCharacter getSingleCharacter(int index)
           
 int getSingleCharacterCount()
           
 SingleCharacter[] getSingleCharacters()
           
 java.lang.String getSymbol()
           
 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.
 void update()
           
 Violations validate()
          Validates this pattern.
 
Methods inherited from class net.sourceforge.chaperon.model.extended.Pattern
addAscendingSuccessor, addDescendingSuccessor, addFirstPattern, addLastPattern, addSuccessor, getAllPattern, getAncestors, getAscendingAncestors, getAscendingSuccessors, getDefinition, getDescendingAncestors, getDescendingSuccessors, getFirstPattern, getLastPattern, getLocation, getSuccessors, hasAncestor, hasAscendingAncestor, hasAscendingSuccessor, hasDescendingAncestor, hasDescendingSuccessor, hasSuccessor, isFirstPattern, isLastPattern, isNullable, setDefinition, setLocation, setNullable, toString
 
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

addSingleCharacter

public void addSingleCharacter(SingleCharacter character)

getSingleCharacter

public SingleCharacter getSingleCharacter(int index)

getSingleCharacters

public SingleCharacter[] getSingleCharacters()

getSingleCharacterCount

public int getSingleCharacterCount()

addCharacterInterval

public void addCharacterInterval(CharacterInterval interval)

getCharacterInterval

public CharacterInterval getCharacterInterval(int index)

getCharacterIntervals

public CharacterInterval[] getCharacterIntervals()

getCharacterIntervalCount

public int getCharacterIntervalCount()

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.

update

public void update()
Overrides:
update in class Pattern

getLimits

public char[] getLimits()
Specified by:
getLimits in class Pattern

contains

public boolean contains(char minimum,
                        char maximum)
Specified by:
contains in class Pattern

contains

public boolean contains(char c)
Specified by:
contains in class Pattern

getSymbol

public java.lang.String getSymbol()
Specified by:
getSymbol in class Pattern

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.