abc.notation
Class BarLine

java.lang.Object
  extended byabc.notation.BarLine
All Implemented Interfaces:
ScoreElementInterface
Direct Known Subclasses:
RepeatBarLine

public class BarLine
extends java.lang.Object
implements ScoreElementInterface

This class defines bar lines used in musical scores.


Field Summary
static byte REPEAT_CLOSE
          The repeat close bar line type.
static byte REPEAT_OPEN
          The repeat open bar line type.
static byte SIMPLE
          The simple bar line type.
 
Constructor Summary
BarLine()
          Default constructor.
BarLine(byte type)
          Creates a new bar line with the corresponding type.
 
Method Summary
static byte[] convertToBarLine(java.lang.String barLine)
          Converts the specified string to a bar line type.
 byte getType()
          Returns the type of this bar line.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIMPLE

public static final byte SIMPLE
The simple bar line type. Ex: |

See Also:
Constant Field Values

REPEAT_OPEN

public static final byte REPEAT_OPEN
The repeat open bar line type. Ex: |:

See Also:
Constant Field Values

REPEAT_CLOSE

public static final byte REPEAT_CLOSE
The repeat close bar line type. Ex: :|

See Also:
Constant Field Values
Constructor Detail

BarLine

public BarLine()
Default constructor. Constructs a simple bar line.


BarLine

public BarLine(byte type)
Creates a new bar line with the corresponding type.

Parameters:
type - The type of bar line to be created : SIMPLE, REPEAT_OPEN or REPEAT_CLOSE.
Method Detail

getType

public byte getType()
Returns the type of this bar line.

Returns:
The type of this bar line.

convertToBarLine

public static byte[] convertToBarLine(java.lang.String barLine)
Converts the specified string to a bar line type.

Parameters:
barLine - The string to be converted as a bar line. Possible values are |, ||, [|, |], :|, |:, ::.
Returns:
The bar line type corresponding to the given string. null is returned if no type matches the string.

toString

public java.lang.String toString()
Returns a string representation of this object.

Returns:
A string representation of this object.