jcaas.midi
Class NoteVector
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
jcaas.midi.NoteVector
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess
public class NoteVector
- extends java.util.ArrayList
- Version:
- created Apr 17, 2005
last modified Apr 18, 2005
NoteVector represents the notes played on a staff at a given time.
- Author:
- Conrad M. Hutcheson
- See Also:
- Serialized Form
Constructor Summary |
NoteVector()
Default constructor. |
NoteVector(boolean slurred,
double volume)
Advanced Constructor. |
Method Summary |
void |
add(int i,
java.lang.Object o)
|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int i,
java.util.Collection c)
|
Note |
getNote(int i)
A Method to get the note at i |
double |
getVolChange()
A method to determine how much this note's volume differs from the master volume. |
boolean |
isSlurred()
A method to determine if this note is slurred with the next one. |
Methods inherited from class java.util.ArrayList |
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
NoteVector
public NoteVector()
- Default constructor. Assumes no change of volume, no slur.
NoteVector
public NoteVector(boolean slurred,
double volume)
- Advanced Constructor. Allows the slurring/volume modification functions.
- Parameters:
slurred
- volume
-
isSlurred
public boolean isSlurred()
- A method to determine if this note is slurred with the next one.
- Returns:
- true if this note is slurred, false otherwise.
getVolChange
public double getVolChange()
- A method to determine how much this note's volume differs from the master volume.
- Returns:
- a double representing the change in volume between this note and the staff master volume as a multipling factor.
add
public boolean add(java.lang.Object o)
- Specified by:
add
in interface java.util.Collection
- Specified by:
add
in interface java.util.List
- Overrides:
add
in class java.util.ArrayList
add
public void add(int i,
java.lang.Object o)
- Specified by:
add
in interface java.util.List
- Overrides:
add
in class java.util.ArrayList
addAll
public boolean addAll(java.util.Collection c)
- Specified by:
addAll
in interface java.util.Collection
- Specified by:
addAll
in interface java.util.List
- Overrides:
addAll
in class java.util.ArrayList
addAll
public boolean addAll(int i,
java.util.Collection c)
- Specified by:
addAll
in interface java.util.List
- Overrides:
addAll
in class java.util.ArrayList
getNote
public Note getNote(int i)
- A Method to get the note at i
- Parameters:
i
- the index to get the note at
- Returns:
- the note at the index i