net.sourceforge.chaperon.model.lexicon
Class Lexicon

java.lang.Object
  extended bynet.sourceforge.chaperon.model.lexicon.Lexicon

public class Lexicon
extends java.lang.Object

The lexicon represents a collection of lexemes.

Version:
CVS $Id: Lexicon.java,v 1.7 2004/01/18 01:36:29 benedikta Exp $
Author:
Stephan Michels

Constructor Summary
Lexicon()
           
 
Method Summary
 void addLexeme(Lexeme lexeme)
          Add a lexeme to this lexicon.
 void addLexeme(Lexeme[] lexemes)
           
 java.lang.Object clone()
          Create a clone of this lexicon.
 Lexeme[] getLexeme()
           
 Lexeme getLexeme(int index)
          Return a lexeme given by an index.
 int getLexemeCount()
          Return the count of lexemes in this lexicon.
 java.lang.String getLocation()
          Returns the location from the input source.
 void removeLexeme(Lexeme lexeme)
          Remove a lexeme from this lexicon.
 void setLocation(java.lang.String location)
          Set the location from the input source.
 java.lang.String toString()
          Return a string representation of the lexicon
 Violations validate()
          Validates the lexicon.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Lexicon

public Lexicon()
Method Detail

addLexeme

public void addLexeme(Lexeme lexeme)
Add a lexeme to this lexicon.

Parameters:
lexeme - Lexeme, which should be added.

addLexeme

public void addLexeme(Lexeme[] lexemes)

removeLexeme

public void removeLexeme(Lexeme lexeme)
Remove a lexeme from this lexicon.

Parameters:
lexeme - Lexeme, which should be removed.

getLexeme

public Lexeme getLexeme(int index)
Return a lexeme given by an index.

Parameters:
index - Index of the lexeme.
Returns:
Lexeme.

getLexeme

public Lexeme[] getLexeme()

getLexemeCount

public int getLexemeCount()
Return the count of lexemes in this lexicon.

Returns:
Count of lexemes.

setLocation

public void setLocation(java.lang.String location)
Set the location from the input source.

Parameters:
location - Location in the input source.

getLocation

public java.lang.String getLocation()
Returns the location from the input source.

Returns:
Location in the input source.

validate

public Violations validate()
Validates the lexicon.

Returns:
Return a list of violations, if this object isn't valid.

toString

public java.lang.String toString()
Return a string representation of the lexicon

Returns:
String representation.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Create a clone of this lexicon.

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


Copyright ? 2003 Chaperon project. All Rights Reserved.