Class IntervalList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Interval>
-
- org.processmining.servicelevelagreements.model.interval.IntervalList
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<Interval>,java.util.Collection<Interval>,java.util.List<Interval>,java.util.RandomAccess
public class IntervalList extends java.util.ArrayList<Interval>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntervalList()IntervalList(int initialCapacity)IntervalList(IntervalList other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsInterval(Interval interval)Checks whether this list contains the specified interval.booleancontainsTimestamp(long timestamp)Checks whether this list contains any interval that contains the specified timestamp.voidend(long timestamp)Will try to change the end timestamp of the last interval in the list to the provided timestamp T.voidstart(long timestamp)Will add a new open-ended interval (T,-) to the end of the list.java.lang.StringtoString()-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
IntervalList
public IntervalList()
-
IntervalList
public IntervalList(int initialCapacity)
-
IntervalList
public IntervalList(IntervalList other)
-
-
Method Detail
-
containsTimestamp
public boolean containsTimestamp(long timestamp)
Checks whether this list contains any interval that contains the specified timestamp. The list is traversed in reverse order.- Parameters:
timestamp- The timestamp- Returns:
- True if the list contains an interval that contains the timestamp, false otherwise.
-
containsInterval
public boolean containsInterval(Interval interval)
Checks whether this list contains the specified interval. The list is traversed in reverse order.- Parameters:
interval- The interval- Returns:
- True if the list contains an interval that fully contains the specified interval, false otherwise.
-
end
public void end(long timestamp)
Will try to change the end timestamp of the last interval in the list to the provided timestamp T. When the last interval is empty the previous interval will be tried etc. When an interval is reached that has an end timestamp that is greater than T, a notification is thrown.- Parameters:
timestamp- T
-
start
public void start(long timestamp)
Will add a new open-ended interval (T,-) to the end of the list.- Parameters:
timestamp- T
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.AbstractCollection<Interval>
-
-