Package net.sf.tweety.math
Class Interval<S extends Number>
- java.lang.Object
-
- net.sf.tweety.math.Interval<S>
-
- Type Parameters:
S- the (number-)type of the elements in this interval
- All Implemented Interfaces:
Iterable<S>,Collection<S>,Set<S>,NumberSet<S>
public class Interval<S extends Number> extends Object implements NumberSet<S>
This class contains a set of closed set (interval) of possible numbers- Author:
- Bastian Wolf
-
-
Method Summary
Modifier and Type Method Description booleanadd(S e)booleanaddAll(Collection<? extends S> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)NumberSet<S>getIntervalset()SgetLowerBound()Returns the lower boundSgetUpperBound()booleanisElementOf(S a)checks, whether an element is within this intervalbooleanisEmpty()Iterator<S>iterator()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)voidsetIntervalset(NumberSet<S> intervalset)voidsetLowerBound(S lowerBound)voidsetUpperBound(S upperBound)intsize()Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
-
-
-
Method Detail
-
getLowerBound
public S getLowerBound()
Returns the lower bound- Returns:
- the lower bound
-
setLowerBound
public void setLowerBound(S lowerBound)
-
getUpperBound
public S getUpperBound()
-
setUpperBound
public void setUpperBound(S upperBound)
-
isElementOf
public boolean isElementOf(S a)
checks, whether an element is within this interval- Parameters:
a- some element- Returns:
- true iff a is an element of this interval
-
add
public boolean add(S e)
-
addAll
public boolean addAll(Collection<? extends S> c)
-
clear
public void clear()
-
contains
public boolean contains(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<S extends Number>- Specified by:
containsAllin interfaceSet<S extends Number>
-
isEmpty
public boolean isEmpty()
-
remove
public boolean remove(Object o)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
size
public int size()
-
toArray
public Object[] toArray()
-
-