public class Notes
extends java.lang.Object
| Constructor and Description |
|---|
Notes() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int tick,
java.util.List<Note> notes) |
void |
add(int tick,
Note note) |
void |
clear() |
void |
clearTick(int tick) |
void |
compact()
Removes empty note lists from the notes map.
|
Notes |
copy() |
void |
forEach(java.util.function.Consumer<Note> noteConsumer)
Applies the given consumer to all notes.
|
java.util.List<Note> |
get(int tick) |
int |
getLastTick() |
int |
getLengthInTicks() |
int |
getNoteCount() |
java.util.List<Note> |
getOrEmpty(int tick) |
java.util.Set<java.lang.Integer> |
getTicks() |
void |
removeDoubleNotes()
Removes duplicate notes which are on the same tick.
|
void |
removeIf(java.util.function.Predicate<Note> notePredicate)
Removes all notes which match the given predicate.
|
void |
removeSilentNotes()
Removes all notes which have a volume of 0.
|
void |
removeSilentNotes(float threshold)
Removes all notes which have a volume lower than or equal the given threshold.
|
void |
set(int tick,
java.util.List<Note> notes) |
boolean |
testEach(java.util.function.Predicate<Note> notePredicate)
Applies the given predicate to all notes.
|
public java.util.List<Note> get(int tick)
public java.util.List<Note> getOrEmpty(int tick)
public void set(int tick,
java.util.List<Note> notes)
public void add(int tick,
Note note)
public void add(int tick,
java.util.List<Note> notes)
public java.util.Set<java.lang.Integer> getTicks()
public void clearTick(int tick)
public void clear()
public void forEach(java.util.function.Consumer<Note> noteConsumer)
noteConsumer - The consumerpublic boolean testEach(java.util.function.Predicate<Note> notePredicate)
notePredicate - The predicatepublic void removeIf(java.util.function.Predicate<Note> notePredicate)
notePredicate - The predicatepublic void removeDoubleNotes()
public void removeSilentNotes()
public void removeSilentNotes(float threshold)
threshold - The threshold (0.0 - 1.0)public void compact()
public int getLastTick()
public int getLengthInTicks()
public int getNoteCount()
public Notes copy()