org.favabeans.util
Class DagPoset

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--org.favabeans.util.DagPoset
All Implemented Interfaces:
Collection, Poset, Set

public class DagPoset
extends AbstractSet
implements Poset

A DagPoset is an implementation of a Poset based on a directed acyclic graph data structure.


Constructor Summary
DagPoset()
           
DagPoset(PoComparator comparator)
           
 
Method Summary
 boolean add(Object o)
           
 void clear()
           
 PoComparator comparator()
          Return the comparator associated with this partially ordered set, or null if it uses the elements' natural ordering.
 boolean contains(Object o)
           
 Set directGreaters(Object o)
          Obtain the direct greaters of a given object.
 Set directLessers(Object o)
          Obtain the direct lessers of a given object.
 Poset greaters(Object o)
          Obtain the greaters of a given object.
 Object greatest()
          Obtain the greatest element of the set.
 boolean isEmpty()
           
 Iterator iterator()
           
 Object least()
          Obtain the least element of the set.
 Poset lessers(Object o)
          Obtain the lessers of a given object.
 Set maximal()
          Obtain the maximal elements of the set.
 Set minimal()
          Obtain the minimal elements of the set.
 void printContents(OutputStream outputStream)
          Print the contents of this DagPoset in a newline-formatted fashion onto a supplied OutputStream using the default character encoding.
 void printContents(PrintWriter printWriter)
          Print the contents of this DagPoset in a newline-formatted fashion onto a supplied PrintWriter.
 boolean remove(Object o)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

DagPoset

public DagPoset()

DagPoset

public DagPoset(PoComparator comparator)
Method Detail

size

public int size()
Specified by:
size in interface Set
Overrides:
size in class AbstractCollection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Set
Overrides:
isEmpty in class AbstractCollection

contains

public boolean contains(Object o)
Specified by:
contains in interface Set
Overrides:
contains in class AbstractCollection

iterator

public Iterator iterator()
Specified by:
iterator in interface Set
Overrides:
iterator in class AbstractCollection

add

public boolean add(Object o)
Specified by:
add in interface Set
Overrides:
add in class AbstractCollection

remove

public boolean remove(Object o)
Specified by:
remove in interface Set
Overrides:
remove in class AbstractCollection

clear

public void clear()
Specified by:
clear in interface Set
Overrides:
clear in class AbstractCollection

comparator

public PoComparator comparator()
Description copied from interface: Poset
Return the comparator associated with this partially ordered set, or null if it uses the elements' natural ordering.
Specified by:
comparator in interface Poset
Following copied from interface: org.favabeans.util.Poset
Returns:
the comparator, or null if none is defined.

least

public Object least()
Description copied from interface: Poset
Obtain the least element of the set.
Specified by:
least in interface Poset
Following copied from interface: org.favabeans.util.Poset
Returns:
the least element, or null if no least element exists.
Throws:
NoSuchElementException - if this set is empty.

greatest

public Object greatest()
Description copied from interface: Poset
Obtain the greatest element of the set.
Specified by:
greatest in interface Poset
Following copied from interface: org.favabeans.util.Poset
Returns:
the greatest element, or null if no least element exists.
Throws:
NoSuchElementException - if this set is empty.

minimal

public Set minimal()
Description copied from interface: Poset
Obtain the minimal elements of the set.
Specified by:
minimal in interface Poset
Following copied from interface: org.favabeans.util.Poset
Returns:
the minimal elements.
Throws:
NoSuchElementException - if this set is empty.

maximal

public Set maximal()
Description copied from interface: Poset
Obtain the maximal elements of the set.
Specified by:
maximal in interface Poset
Following copied from interface: org.favabeans.util.Poset
Returns:
the maximal elements.
Throws:
NoSuchElementException - if this set is empty.

directLessers

public Set directLessers(Object o)
Description copied from interface: Poset
Obtain the direct lessers of a given object.
Specified by:
directLessers in interface Poset
Following copied from interface: org.favabeans.util.Poset
Parameters:
x - the object for which to obtain the greaters, which may or may not be in the set.
Returns:
the direct lessers of x.

directGreaters

public Set directGreaters(Object o)
Description copied from interface: Poset
Obtain the direct greaters of a given object.
Specified by:
directGreaters in interface Poset
Following copied from interface: org.favabeans.util.Poset
Parameters:
x - the object for which to obtain the greaters, which may or may not be in the set.
Returns:
the direct greaters of x.

lessers

public Poset lessers(Object o)
Description copied from interface: Poset
Obtain the lessers of a given object.
Specified by:
lessers in interface Poset
Following copied from interface: org.favabeans.util.Poset
Parameters:
x - the object for which to obtain the greaters, which may or may not be in the set.
Returns:
a new Poset containing the lessers of x.

greaters

public Poset greaters(Object o)
Description copied from interface: Poset
Obtain the greaters of a given object.
Specified by:
greaters in interface Poset
Following copied from interface: org.favabeans.util.Poset
Parameters:
x - the object for which to obtain the greaters, which may or may not be in the set.
Returns:
a new Poset containing the greaters of x.

printContents

public void printContents(OutputStream outputStream)
Print the contents of this DagPoset in a newline-formatted fashion onto a supplied OutputStream using the default character encoding. This is useful for debugging.
Parameters:
outputStream - an OutputStream onto which the output will be printed.

printContents

public void printContents(PrintWriter printWriter)
Print the contents of this DagPoset in a newline-formatted fashion onto a supplied PrintWriter. This is useful for debugging.
Parameters:
printWriter - a PrintWriter onto which the output will be printed.


Copyright © 2000-2001, Regents of the University of Minnesota. All Rights Reserved.