jcaas.midi
Class Score

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by jcaas.midi.Score
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess
Direct Known Subclasses:
GeneratedScore

public class Score
extends java.util.ArrayList

Version:
created Apr 18, 2005 last modified Apr 18, 2005 Score represents a group of staves that are (presumably) all meant to play together.
Author:
Conrad M. Hutcheson
See Also:
Serialized Form

Constructor Summary
Score(Staff s)
          Standard Constructor
Score(Staff[] s)
          Standard 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)
           
 boolean changeStaff(int i, Staff s)
          A method to replace one of the staves in this score
 MMessage getInfo(int i, MMessage m)
          A method to get information about the currently Playing Scores/Staffs.
 NoteVector[] getNextNote()
          A method to return the next note to be played in this score
 int getNumStaffs()
          Method to get the number of staves in this Score
 StaffProperty getProperty(int i, java.lang.String pname)
          Method to get information about substaffs of the score
 Staff getStaff(int i)
          A method to get teh ith staff in this Score
 boolean passMessage(int i, MMessage m)
          A method to inform the Score of changes it should make.
 
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
 

Constructor Detail

Score

public Score(Staff[] s)
Standard Constructor

Parameters:
s - the staves this score represents

Score

public Score(Staff s)
Standard Constructor

Parameters:
s - the staff this score represents
Method Detail

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

getNextNote

public NoteVector[] getNextNote()
A method to return the next note to be played in this score

Returns:
the array of NoteVectors to be played next.

getProperty

public StaffProperty getProperty(int i,
                                 java.lang.String pname)
Method to get information about substaffs of the score

Parameters:
i - the index of the staff in this score
pname - the name of the property
Returns:
the property requested

getNumStaffs

public int getNumStaffs()
Method to get the number of staves in this Score

Returns:
the number of staves in this score

changeStaff

public boolean changeStaff(int i,
                           Staff s)
A method to replace one of the staves in this score

Parameters:
i -
s -
Returns:

getStaff

public Staff getStaff(int i)
A method to get teh ith staff in this Score

Parameters:
i - the index of the Staff
Returns:
The staff stored at index i

passMessage

public boolean passMessage(int i,
                           MMessage m)
A method to inform the Score of changes it should make.

Parameters:
i - the index of the staff to modify.
m - the message to be implemented
Returns:
true if successful change, false otherwise.

getInfo

public MMessage getInfo(int i,
                        MMessage m)
A method to get information about the currently Playing Scores/Staffs.

Parameters:
i - the index of the staff to get information about
type - the type of information to get
Returns:
a MMessage containing the requested info