de.rwth.domains.templates
Class StackSet

java.lang.Object
  |
  +--de.rwth.domains.templates.StackSet
All Implemented Interfaces:
Set
Direct Known Subclasses:
StackPOSet

public class StackSet
extends java.lang.Object
implements Set

Class for (maybe infinite) sets which consists of stacks of elements from a set.

Version:
$Id: StackSet.java,v 1.2 2002/09/17 06:53:53 mohnen Exp $
Author:
Markus Mohnen

Inner classes inherited from class de.rwth.domains.Set
Set.Default
 
Field Summary
protected  int maxSize
          The maximal stack size of the elements of this set.
protected  Set set
          The set for the elements of the stacks of this set.
protected  long size
          The size of this set.
protected  long sizeSkel
          The size of this skeleton subset of this set.
protected  int skelMaxSize
          The maximal stack size of the elements of skeleton subset of this set.
protected static int SKELMAXSIZE
          The default value for the maximal stack size for the skeleton subset of this set.
 
Constructor Summary
StackSet(Set set)
          Creates a new StackSet instance with unlimited stack size and skeleton stack size SKELMAXSIZE.
StackSet(Set set, int maxSize)
          Creates a new StackSet instance with maximal stack size.
 
Method Summary
protected static long computeSize(int maxSize, long baseSize)
          Compute the size of a stack set which maximal maxSize stack size and baseSize elements for each entry in the stack.
 boolean equals(java.lang.Object param1, java.lang.Object param2)
          Checks if two elements of this set are equal.
 boolean isElement(java.lang.Object param1)
          Checks if an element is contained in this set.
 java.util.Iterator iterator()
          Returns an Iterator of the elements of this set.
 java.util.Iterator iteratorSkel()
          Returns an Iterator of the elements of the skeleton subset this set.
static void main(java.lang.String[] args)
          Mini test environment.
 long size()
          Returns the size of this set.
 long sizeSkel()
          Returns the size of the skeleton subset of this set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

set

protected Set set
The set for the elements of the stacks of this set.

SKELMAXSIZE

protected static final int SKELMAXSIZE
The default value for the maximal stack size for the skeleton subset of this set.

maxSize

protected int maxSize
The maximal stack size of the elements of this set. Maybe -1 for unlimited stack size.

skelMaxSize

protected int skelMaxSize
The maximal stack size of the elements of skeleton subset of this set.

size

protected long size
The size of this set.

sizeSkel

protected long sizeSkel
The size of this skeleton subset of this set.
Constructor Detail

StackSet

public StackSet(Set set)
Creates a new StackSet instance with unlimited stack size and skeleton stack size SKELMAXSIZE.
Parameters:
set - a Set value

StackSet

public StackSet(Set set,
                int maxSize)
Creates a new StackSet instance with maximal stack size.
Parameters:
set - a Set value
maxSize - an int value
Method Detail

computeSize

protected static long computeSize(int maxSize,
                                  long baseSize)
Compute the size of a stack set which maximal maxSize stack size and baseSize elements for each entry in the stack.
Parameters:
maxSize - an int value
baseSize - a long value
Returns:
a long value

equals

public boolean equals(java.lang.Object param1,
                      java.lang.Object param2)
Description copied from interface: Set
Checks if two elements of this set are equal.
Implementations should guarantee that equals is reflexive, transitive and symmetric. Furthermore, equals(e1,e2) should coincide with e1.equals(e2).
Specified by:
equals in interface Set
Following copied from interface: de.rwth.domains.Set
Parameters:
e1 - a value of type Object
e2 - a value of type Object
Returns:
true if e1 and e2 belong to this set and are equal, false otherwise
See Also:
Domain.checkProperties(Set set)

isElement

public boolean isElement(java.lang.Object param1)
Description copied from interface: Set
Checks if an element is contained in this set.
Implementations should guarantee that isElement() is true for all objects generated by Set.iterator() and false for all other objects.
Specified by:
isElement in interface Set
Following copied from interface: de.rwth.domains.Set
Parameters:
e - a value of type Object
Returns:
true if and only if this set contains this element.
See Also:
Set.iterator(), Domain.checkProperties(Set set)

iterator

public java.util.Iterator iterator()
Description copied from interface: Set
Returns an Iterator of the elements of this set.
Implementations should guarantee that:
Specified by:
iterator in interface Set
Following copied from interface: de.rwth.domains.Set
Returns:
an Iterator of all elements of this set.
See Also:
Set.isElement(Object e), Domain.checkProperties(Set set)

iteratorSkel

public java.util.Iterator iteratorSkel()
Description copied from interface: Set
Returns an Iterator of the elements of the skeleton subset this set. It maybe null if there is no skeleton subset.
Implementations should guarantee that:
Specified by:
iteratorSkel in interface Set
Following copied from interface: de.rwth.domains.Set
Returns:
an Iterator of all elements of this set.
See Also:
Set.isElement(Object e), Domain.checkProperties(Set set)

size

public long size()
Description copied from interface: Set
Returns the size of this set.
Implementations should guarantee that it is the number of times iterator().hasNext() can be called.
Specified by:
size in interface Set
Following copied from interface: de.rwth.domains.Set
Returns:
-1 iff the set has infinite size, the number of elements otherwise.
See Also:
Domain.checkProperties(Set set)

sizeSkel

public long sizeSkel()
Description copied from interface: Set
Returns the size of the skeleton subset of this set.
Implementations should guarantee that it is the number of times iterator().hasNext() can be called.
Specified by:
sizeSkel in interface Set
Following copied from interface: de.rwth.domains.Set
Returns:
-1 iff there is no skeleton subset, the number of elements otherwise.
See Also:
Domain.checkProperties(Set set)

main

public static void main(java.lang.String[] args)
Mini test environment.
Parameters:
args - a String[] value