Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class AdvancedSongList

    java.lang.Object
      AdvancedSongList

    public class AdvancedSongList

extends Object

A linked list containing AdvancedSongNodes. Written entirely from scratch or modified existing code written by Barbara Ericson and Mark Gudzial

Author:
  Dawn Finney

Constructor Summary
`AdvancedSongList()` Default constructor
`AdvancedSongList(AdvancedSongNode head)` Constructor that takes in the first node of the list

Method Summary
`void` | `add(AdvancedSongNode node)` Method to insert a new node into the list.
`void` | `appendToList(AdvancedSongList list)` Method to append another SongList to the end of the current one
`jm.music.data.Phrase` | `collect()` Collect all nodes in this list and return the composite phrase
`boolean` | `delete(AdvancedSongNode node)` Method to delete a node from the list and return true if it was successful.
`AdvancedSongNode` | `getHead()` Method to return the variable head
`boolean` | `insertAfter(AdvancedSongNode node, AdvancedSongNode nodeToInsert)` Method to insert a new node after the specified node and return true if successful.
`AdvancedSongNode` | `last()` Method to return the last node in the list
`jm.music.data.Part` | `makeMyPart(int instrument)` Collect all the notes from the list in an part and returns it
`jm.music.data.Score` | `makeMyScore(int instrument)` Collect all the notes from the list in an part (then a score) and returns the score
`jm.music.data.Score` | `makeMyScore(String songName, double tempo, int timeSignatureTop, int timeSignatureBottom, int instrument)` Collect all the notes from the list in an part (then a score) and then returns the score.
`void` | `repeatNext(AdvancedSongNode afterThisNode, AdvancedSongNode newNode, int count)` Method to repeat COPIES of the newNode after a given node, afterThisNode, for an inputted amount of times.
`void` | `repeatNextInserting(AdvancedSongNode afterThisNode, AdvancedSongNode newNode, int count)` Method to INSERT COPIES of the newNode after a given node, afterThisNode, for an inputted amount of times.
`boolean` | `search(AdvancedSongNode node)` Method to search for a node within the list.
`void` | `setHead(AdvancedSongNode head)` Method to set the variable head
`void` | `showFromMeOn(int instrument)` Collect all the notes in the list and place it in an part (then a score) and open it up for viewing.
`int` | `size()` Method to return the size of or the number of elements in the list
`void` | `weave(AdvancedSongNode afterThisNode, AdvancedSongNode newNode, int count, int skipAmount)` Weave the input phrase count times every skipAmount nodes.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AdvancedSongList

    public AdvancedSongList()

  Default constructor

### AdvancedSongList

    public AdvancedSongList(AdvancedSongNode head)

  Constructor that takes in the first node of the list

  Parameters:
    `head` - the first node in the list

Method Detail

### getHead

    public AdvancedSongNode getHead()

  Method to return the variable head

  Returns:
    head

### setHead

    public void setHead(AdvancedSongNode head)

  Method to set the variable head

  Parameters:
    `head` - new head of the list

### add

    public void add(AdvancedSongNode node)

  Method to insert a new node into the list. If the list is empty i.e. head equals null, then set the head equal to the new node.

  Parameters:
    `node` - AdvancedSongNode that to be inserted

### appendToList

    public void appendToList(AdvancedSongList list)

  Method to append another SongList to the end of the current one

  Parameters:
    `list` - the SongList to be added to the end

### collect

    public jm.music.data.Phrase collect()

  Collect all nodes in this list and return the composite phrase

  Returns:
    the composite Phrase

### delete

    public boolean delete(AdvancedSongNode node)

  Method to delete a node from the list and return true if it was successful.

  Parameters:
    `node` - the node to be deleted
  Returns:
    true if the removal was successful

### insertAfter

    public boolean insertAfter(AdvancedSongNode node,
                               AdvancedSongNode nodeToInsert)

  Method to insert a new node after the specified node and return true if successful.

  Parameters:
    `node` - node to insert after
    `nodeToInsert` - node that will be inserted after node
  Returns:
    true if insertion was successful, false otherwise.

### last

    public AdvancedSongNode last()

  Method to return the last node in the list

  Returns:
    the last node in the list, null if the list is empty

### makeMyPart

    public jm.music.data.Part makeMyPart(int instrument)

  Collect all the notes from the list in an part and returns it

  Parameters:
    `instrument` - MIDI instrument (program) to be used in playing this list
  Returns:
    a Part with all of the notes placed into it

### makeMyScore

    public jm.music.data.Score makeMyScore(int instrument)

  Collect all the notes from the list in an part (then a score) and returns the score

  Parameters:
    `instrument` - MIDI instrument (program) to be used in playing this list
  Returns:
    a score with all of the notes placed into it

### makeMyScore

    public jm.music.data.Score makeMyScore(String songName,
                                           double tempo,
                                           int timeSignatureTop,
                                           int timeSignatureBottom,
                                           int instrument)

  Collect all the notes from the list in an part (then a score) and then returns the score.

  Parameters:
    `songName` - name of the Score
    `tempo` - tempo for the score
    `timeSignatureTop` - the top part of the time signature
    `timeSignatureBottom` - the bottom part of the time signature
    `instrument` - MIDI instrument (program) to be used in playing this list
  Returns:
    a score with all of the notes placed into it

### repeatNext

    public void repeatNext(AdvancedSongNode afterThisNode,
                           AdvancedSongNode newNode,
                           int count)

  Method to repeat COPIES of the newNode after a given node, afterThisNode, for an inputted amount of times. Will only repeat if afterThisNode exists within the list.

  Parameters:
    `afterThisNode` - node to insert the new node after
    `newNode` - node to be copied into the list
    `count` - number of times to copy newNode in.

### repeatNextInserting

    public void repeatNextInserting(AdvancedSongNode afterThisNode,
                                    AdvancedSongNode newNode,
                                    int count)

  Method to INSERT COPIES of the newNode after a given node, afterThisNode, for an inputted amount of times. Will only insert if afterThisNode exists within the list.

  Parameters:
    `afterThisNode` - node to insert the new node after
    `newNode` - node to be copied into the list
    `count` - number of times to copy newNode in.

### search

    public boolean search(AdvancedSongNode node)

  Method to search for a node within the list.

  Parameters:
    `node` - the node to find
  Returns:
    true if the node is in the list, false otherwise

### showFromMeOn

    public void showFromMeOn(int instrument)

  Collect all the notes in the list and place it in an part (then a score) and open it up for viewing.

  Parameters:
    `instrument` - MIDI instrument (program) to be used in playing this list

### size

    public int size()

  Method to return the size of or the number of elements in the list

  Returns:
    the size of the list

### weave

    public void weave(AdvancedSongNode afterThisNode,
                      AdvancedSongNode newNode,
                      int count,
                      int skipAmount)

  Weave the input phrase count times every skipAmount nodes. afterThisNode is not included in the skipAmount. Cases where skipAmount = 0, the method will function like repeatNextInserting

  Parameters:
    `afterThisNode` - node to insert the new node after
    `newNode` - node to be copied into the list
    `count` - how many times to copy
    `skipAmount` - how many nodes to skip per weave

Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD