de.rwth.domains.templates
Class TrivialPOSet

java.lang.Object
  |
  +--de.rwth.domains.templates.TrivialPOSet
All Implemented Interfaces:
POSet, Set

public class TrivialPOSet
extends java.lang.Object
implements POSet

Class for the creation of trivial partially ordered sets, where the less-or-equal relation is identical with the equals relation (and hence less-than is the empty relation).

Version:
$Id: TrivialPOSet.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  Set set
          The underlying set.
 
Constructor Summary
TrivialPOSet()
          Creates the trivial partially ordered empty set.
TrivialPOSet(int i)
          Creates a trivial partially ordered set with one int as element.
TrivialPOSet(int[] is)
          Creates a trivial partially ordered et from an array of ints.
TrivialPOSet(int from, int to)
          Creates a trivial partially ordered set with a range of iterator.
TrivialPOSet(java.lang.Object o)
          Creates a trivial partially ordered set with one element.
TrivialPOSet(java.lang.Object[] os)
          Creates a trivial partially ordered set from an array of Objects.
TrivialPOSet(Set set)
          Creates a trivial partially ordered set from a set.
 
Method Summary
 boolean equals(java.lang.Object e1, java.lang.Object e2)
          Returns true iff both parameters are equal in the underlying set.
 boolean isElement(java.lang.Object e)
          Returns true iff the parameter is element in the underlying 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.
 boolean le(java.lang.Object e1, java.lang.Object e2)
          The method le is identical to equals.
 boolean lt(java.lang.Object e1, java.lang.Object e2)
          The method lt always returns false.
 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 underlying set.
Constructor Detail

TrivialPOSet

public TrivialPOSet()
Creates the trivial partially ordered empty set.

TrivialPOSet

public TrivialPOSet(Set set)
Creates a trivial partially ordered set from a set.
Parameters:
set - the underlying set.

TrivialPOSet

public TrivialPOSet(java.lang.Object[] os)
Creates a trivial partially ordered set from an array of Objects.
Parameters:
os - all the elements of the new set.

TrivialPOSet

public TrivialPOSet(java.lang.Object o)
Creates a trivial partially ordered set with one element.
Parameters:
o - the Object which will be the element of the new set.

TrivialPOSet

public TrivialPOSet(int i)
Creates a trivial partially ordered set with one int as element.
Parameters:
i - a value of type int

TrivialPOSet

public TrivialPOSet(int from,
                    int to)
Creates a trivial partially ordered set with a range of iterator.
Parameters:
from - the first element of the set
to - the last element of the set

TrivialPOSet

public TrivialPOSet(int[] is)
Creates a trivial partially ordered et from an array of ints.
Parameters:
is - all the elements of the new set.
Method Detail

equals

public boolean equals(java.lang.Object e1,
                      java.lang.Object e2)
Returns true iff both parameters are equal in the underlying set.
Specified by:
equals in interface Set
Parameters:
e1 - a value of type Object
e2 - a value of type Object
Returns:
a value of type boolean

isElement

public boolean isElement(java.lang.Object e)
Returns true iff the parameter is element in the underlying set.
Specified by:
isElement in interface Set
Parameters:
e - a value of type Object
Returns:
a value of type boolean

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)

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)

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)

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)

lt

public boolean lt(java.lang.Object e1,
                  java.lang.Object e2)
The method lt always returns false.
Specified by:
lt in interface POSet
Parameters:
e1 - a value of type Object
e2 - a value of type Object
Returns:
a value of type boolean

le

public boolean le(java.lang.Object e1,
                  java.lang.Object e2)
The method le is identical to equals.
Specified by:
le in interface POSet
Parameters:
e1 - a value of type Object
e2 - a value of type Object
Returns:
a value of type boolean