provided.music
Class Header

java.lang.Object
  extended by provided.music.Header
All Implemented Interfaces:
IPhrase

public class Header
extends java.lang.Object
implements IPhrase

An abc Header. Headers are identified by a one character "id" and can have an arbitrary string value.
Note that this class represents many different *types* of headers, each with its own id value.


Field Summary
private  java.lang.String _id
          The id of this header.
private  java.lang.String _value
          the text value of this header.
 
Constructor Summary
Header(java.lang.String id, java.lang.String value)
          Create a header out of an id and value
 
Method Summary
 java.lang.Object execute(IPhraseVisitor algo, java.lang.Object... params)
          Calls the header id'th case of the visitor algo.
 java.lang.String getID()
          Accessor for the id.
 java.lang.String getValue()
          Accessor for the text value of this header.
 java.lang.String toString()
          String representation of this header: "id: text"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_id

private java.lang.String _id
The id of this header.


_value

private java.lang.String _value
the text value of this header.

Constructor Detail

Header

public Header(java.lang.String id,
              java.lang.String value)
Create a header out of an id and value

Parameters:
id - - one character corresponding to the abc header name
value - - arbitrary string value of the header
Method Detail

execute

public java.lang.Object execute(IPhraseVisitor algo,
                                java.lang.Object... params)
Calls the header id'th case of the visitor algo.

Specified by:
execute in interface IPhrase
Parameters:
algo - The visitor that is being used.
params - vararg list of input parameters that the algo might use.
Returns:
the result of running the id'th case of the visitor.

getID

public java.lang.String getID()
Accessor for the id.

Returns:
the _id

getValue

public java.lang.String getValue()
Accessor for the text value of this header.

Returns:
the _value

toString

public java.lang.String toString()
String representation of this header: "id: text"

Overrides:
toString in class java.lang.Object