public class EventCollection extends ConcurrentSkipListMap<BigFraction,LEvent> implements EventQueryable
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
EventCollection() |
Modifier and Type | Method and Description |
---|---|
void |
add(LEvent e)
Add an event to the collection, unless it overlaps with an existing
event.
|
void |
addAfterwards(Collection<LEvent> events)
Add events after the end of the last event currently in the collection.
|
void |
addAll(Collection<LEvent> events) |
void |
addWithOffset(BigFraction offset,
Collection<LEvent> events)
Add events with a specified offset.
|
static EventCollection |
fromDoubles(Double... values)
Creates an event collection where each event is 1/N cycles long (where N
is the length of the list) and each has the specified value between 0.0
and 1.0 inclusive.
|
static EventCollection |
fromDoubles(List<Double> doubleValues)
Creates an event collection where each event is 1/N cycles long (where N
is the length of the list) and each has the specified value between 0.0
and 1.0 inclusive.
|
static EventCollection |
fromEvents(Collection<LEvent> collection)
Turn a generic Collection of Events into an EventCollection.
|
static EventCollection |
fromEvents(LEvent... events)
Turn a variable number of Events into an EventCollection.
|
static EventCollection |
fromInts(Integer... values)
Creates a series of events from integers.
|
static EventCollection |
fromInts(List<Integer> intValues)
Creates a series of events from integers.
|
static EventCollection |
fromString(String string)
Creates a series of events from a string.
|
Collection<LEvent> |
getForInterval(Interval interval) |
Interval |
getTotalInterval()
Find the span of time taken up by all of the events in this collection.
|
String |
toString() |
ceilingEntry, ceilingKey, clear, clone, comparator, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, equals, firstEntry, firstKey, floorEntry, floorKey, forEach, get, getOrDefault, headMap, headMap, higherEntry, higherKey, isEmpty, keySet, lastEntry, lastKey, lowerEntry, lowerKey, merge, navigableKeySet, pollFirstEntry, pollLastEntry, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
hashCode, putAll
public static EventCollection fromString(String string)
string
- fromInts
public static EventCollection fromInts(Integer... values)
values
- the integer values of each eventpublic static EventCollection fromInts(List<Integer> intValues)
list
be a list containing 0, 2, and 4. Then
fromInts(list) will create a collection with 3 events, each 1/3 a cycle
long, with values 0.0, 0.5, and 1.0.values
- the integer values of each eventpublic static EventCollection fromDoubles(Double... values)
values
- the input valuesIllegalArgumentException
public static EventCollection fromDoubles(List<Double> doubleValues) throws IllegalArgumentException
doubleValues
- the list of input valuesIllegalArgumentException
public static EventCollection fromEvents(LEvent... events)
events
- the events to be addedpublic static EventCollection fromEvents(Collection<LEvent> collection)
collection
- the collection of events to be addedpublic void add(LEvent e) throws IllegalStateException
e
- the event to addIllegalStateException
public void addAll(Collection<LEvent> events) throws IllegalStateException
IllegalStateException
public void addAfterwards(Collection<LEvent> events) throws IllegalStateException
events
- the events to addIllegalStateException
public void addWithOffset(BigFraction offset, Collection<LEvent> events)
offset
- the amount by which to offset eventsevents
- the events to addpublic Interval getTotalInterval()
public Collection<LEvent> getForInterval(Interval interval)
getForInterval
in interface EventQueryable
public String toString()
toString
in class AbstractMap<BigFraction,LEvent>
Processing Library loom by Cora Johnson-Roberson. (c) 2014-2016