Package org.tweetyproject.math
Class Interval<S extends java.lang.Number>
- java.lang.Object
-
- org.tweetyproject.math.Interval<S>
-
- Type Parameters:
S- the (number-)type of the elements in this interval
- All Implemented Interfaces:
java.lang.Iterable<S>,java.util.Collection<S>,java.util.Set<S>,NumberSet<S>
public class Interval<S extends java.lang.Number> extends java.lang.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(java.util.Collection<? extends S> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)NumberSet<S>getIntervalset()SgetLowerBound()Returns the lower boundSgetUpperBound()booleanisElementOf(S a)checks, whether an element is within this intervalbooleanisEmpty()java.util.Iterator<S>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)voidsetIntervalset(NumberSet<S> intervalset)voidsetLowerBound(S lowerBound)voidsetUpperBound(S upperBound)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)
-
-
-
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(java.util.Collection<? extends S> c)
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<S> iterator()
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
size
public int size()
-
toArray
public java.lang.Object[] toArray()
-
-