01: /*
02: * 01/07/2003 - 15:19:32
03: *
04: * ISet_char.java -
05: * Copyright (C) 2003 Buero fuer Softwarearchitektur GbR
06: * ralf.meyer@karneim.com
07: * http://jrexx.sf.net
08: *
09: * This program is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public License
11: * as published by the Free Software Foundation; either version 2
12: * of the License, or (at your option) any later version.
13: *
14: * This program is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: * GNU Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public License
20: * along with this program; if not, write to the Free Software
21: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22: */
23: package com.tc.jrexx.set;
24:
25: import java.io.Serializable;
26:
27: public interface ISet_char extends Serializable, Cloneable {
28:
29: public interface Iterator {
30: public boolean hasNext();
31:
32: public char next();
33: }
34:
35: public boolean contains(char ch);
36:
37: public boolean isEmpty();
38:
39: public int size();
40:
41: public ISet_char.Iterator iterator();
42:
43: // public ISet_char getComplement();
44:
45: /**
46: * return this.addAll(set).
47: * return C = A | B = this | set
48: */
49: // public ISet_char getUnionSet(ISet_char set);
50: /**
51: * return this.retainAll(set).
52: * return C = A & B = this & set
53: */
54: // public ISet_char getIntersectionSet(ISet_char set);
55: /**
56: * return this.removeAll(set).
57: * return C = A \ B = this \ set
58: */
59: // public ISet_char getDifferenceSet(ISet_char set);
60:
61: public void clear();
62:
63: public boolean add(char ch);
64:
65: public boolean remove(char ch);
66:
67: public void complement();
68:
69: public void addAll(String chars);
70:
71: /**
72: * adds all chars from set to this ISet_char without adding doublicates.
73: * returns the number of chars added to this ISet_char.
74: */
75: public void addAll(ISet_char set);
76:
77: /**
78: * Removes from this set all of its elements that are contained in the specified set (optional operation).
79: * returns the number of chars that were removed.
80: */
81: public void removeAll(ISet_char set);
82:
83: public void retainAll(ISet_char set);
84:
85: public Object clone();
86:
87: }
|