net.sourceforge.chaperon.common
Class SortedCharSet

java.lang.Object
  extended bynet.sourceforge.chaperon.common.SortedCharSet

public class SortedCharSet
extends java.lang.Object

This class represents a set of char values, which means there doesn't exist multiple instances of values.

Version:
CVS $Id: SortedCharSet.java,v 1.3 2003/12/29 14:48:12 benedikta Exp $
Author:
Stephan Michels

Constructor Summary
SortedCharSet()
          Creates an empty set of char values.
 
Method Summary
 void addChar(char value)
          Add a value to this set.
 void addChar(char[] array)
          Add the values of an array to this set.
 void clear()
          Removes all values from this set
 boolean contains(char value)
          If the list contains a value.
 char[] getChar()
           
 char getChar(int index)
          Return a value from this set given by an index.
 char getCharCount()
          Returns the count of value in this set.
 int indexOf(char value)
          Return the index of a value, otherwise -1
 boolean isEmpty()
          If this set contains no values.
 void removeChar(char index)
          Removes a value giving by an index.
 java.lang.String toString()
          Return a string representation of the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortedCharSet

public SortedCharSet()
Creates an empty set of char values.

Method Detail

addChar

public void addChar(char value)
Add a value to this set.

Parameters:
value - Char value.
Returns:
Index of this value.

addChar

public void addChar(char[] array)
Add the values of an array to this set.

Parameters:
array - Array of char values.

removeChar

public void removeChar(char index)
Removes a value giving by an index.

Parameters:
index - Index of the char value.

getChar

public char getChar(int index)
Return a value from this set given by an index.

Parameters:
index - Index of the value.
Returns:
Char value.

getChar

public char[] getChar()

getCharCount

public char getCharCount()
Returns the count of value in this set.

Returns:
Count of char values.

indexOf

public int indexOf(char value)
Return the index of a value, otherwise -1

Parameters:
value - Value, which should be found in this set.
Returns:
Index of this value.

contains

public boolean contains(char value)
If the list contains a value.

Parameters:
value - Value, which should be found in this set
Returns:
True, if this set contains the value.

isEmpty

public boolean isEmpty()
If this set contains no values.

Returns:
True, if this set is empty.

clear

public void clear()
Removes all values from this set


toString

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

Returns:
String representation of the collection.


Copyright ? 2003 Chaperon project. All Rights Reserved.