public class RelSet extends EvalSet
EvalSet.SubsetIterator<E>
INFINITE_SIZE, UNKNOWN_SIZE
Constructor and Description |
---|
RelSet(net.sourceforge.czt.z.ast.Expr from,
net.sourceforge.czt.z.ast.Expr to,
boolean function,
boolean total,
boolean onto,
boolean injective)
Creates a new power set of the given base set.
|
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(net.sourceforge.czt.util.Visitor<R> visitor) |
boolean |
contains(Object obj) |
double |
estSize()
Estimate the size of the set.
|
String |
funcName()
This returns the function operator, in email markup.
|
static String |
funcName(boolean func,
boolean inj,
boolean tot,
boolean onto)
This returns the function operator that has the given
properties.
|
String |
funcNameUnicode()
This returns the function operator, in Unicode markup.
|
static String |
funcNameUnicode(boolean func,
boolean inj,
boolean tot,
boolean onto) |
net.sourceforge.czt.z.ast.Expr |
getDom() |
net.sourceforge.czt.z.ast.Expr |
getRan() |
boolean |
isEmpty() |
boolean |
isFunction() |
boolean |
isInjective() |
boolean |
isOnto() |
boolean |
isTotal() |
Iterator<net.sourceforge.czt.z.ast.Expr> |
iterator()
Iterate through all members of the set.
|
ListIterator<net.sourceforge.czt.z.ast.Expr> |
listIterator()
Iterate forwards/backwards through all members of the set.
|
BigInteger |
maxSize()
The maximum size of the set in the default environment.
|
int |
size()
TODO: calculate this correctly for functions with small/finite dom&ran.
|
Iterator<net.sourceforge.czt.z.ast.Expr> |
sortedIterator()
Iterate through all members of the set in sorted order.
|
Iterator<net.sourceforge.czt.z.ast.Expr> |
subsetIterator(EvalSet otherSet)
Iterate through the intersection of this set
and the 'other' set.
|
String |
toString()
Each subclass should implement a nice toString.
|
add, addAll, clear, containsAll, equals, estSubsetSize, getAnn, getAnns, getLower, getUpper, hashCode, matchIterator, remove, removeAll, retainAll, toArray, toArray
create, getChildren
annsSize, getFactory, hasAnn, hasAnn, removeAnn, removeAnn
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
parallelStream, removeIf, stream
public RelSet(net.sourceforge.czt.z.ast.Expr from, net.sourceforge.czt.z.ast.Expr to, boolean function, boolean total, boolean onto, boolean injective)
public net.sourceforge.czt.z.ast.Expr getDom()
public net.sourceforge.czt.z.ast.Expr getRan()
public boolean isFunction()
public boolean isTotal()
public boolean isOnto()
public boolean isInjective()
public boolean isEmpty()
public int size()
public BigInteger maxSize()
EvalSet
EvalSet provides a default implementation that always returns null.
public double estSize()
EvalSet
EvalSet provides a default implementation that is the same as maxSize(), but converted to a double. So maxSize()==null gives EvalSet.INFINITE_SIZE here.
public boolean contains(Object obj)
EvalException
- if the given object is not an EvalSet.public Iterator<net.sourceforge.czt.z.ast.Expr> iterator()
EvalSet
iterator
in interface Iterable<net.sourceforge.czt.z.ast.Expr>
iterator
in interface Collection<net.sourceforge.czt.z.ast.Expr>
iterator
in interface Set<net.sourceforge.czt.z.ast.Expr>
iterator
in class EvalSet
UnsupportedOperationException
- whenever this method is called.public ListIterator<net.sourceforge.czt.z.ast.Expr> listIterator()
EvalSet
listIterator
in class EvalSet
UnsupportedOperationException
- whenever this method is called.public Iterator<net.sourceforge.czt.z.ast.Expr> sortedIterator()
EvalSet
sortedIterator
in class EvalSet
UnsupportedOperationException
- whenever this method is called.public Iterator<net.sourceforge.czt.z.ast.Expr> subsetIterator(EvalSet otherSet)
EvalSet
EvalSet provides a default implementation that it iterates through the smaller of the two sets and checks membership in the other. TODO: add unit tests for this.
subsetIterator
in class EvalSet
UnsupportedOperationException
- whenever this method is called.public static String funcName(boolean func, boolean inj, boolean tot, boolean onto)
public static String funcNameUnicode(boolean func, boolean inj, boolean tot, boolean onto)
public String funcName()
public String funcNameUnicode()
public String toString()
EvalSet
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.