DixShtix

com.dixshtix.midi
Class BinaryData

java.lang.Object
  |
  +--com.dixshtix.midi.BinaryData
Direct Known Subclasses:
HrMnSeFrFf, KeySignature, TextData, TimeSignature

public class BinaryData
extends java.lang.Object

BinaryData is a wrapper for byte[] which should make it type-safe. This is not a very good example of a class. There is no Midi-specific data here.

Version:
0.1
Author:
Richard C. Penner II

Field Summary
(package private)  byte[] data
          The actual data encapsulated by this class.
(package private) static int maxPrintLength
          Controls how many bytes to print in text dump.
 
Constructor Summary
BinaryData(byte[] data)
          Initializer.
 
Method Summary
 byte[] getData()
          Accessor Method.
 byte getData(int index)
          Accessor Method.
 int getLength()
          Accessor Method.
static int getMaxPrintLength()
          Exposes the maximum number of bytes to be printed by this class.
 int hashCode()
          Accessor Method.
static void setMaxPrintLength(int num)
          Exposes the maximum number of bytes to be printed by this class.
static java.lang.String simpleClass(java.lang.String s)
          Get the short name of a fully qualified class name.
 java.lang.String toString()
          Accessor Method.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

data

byte[] data
The actual data encapsulated by this class. This can be of arbitrary length.

maxPrintLength

static int maxPrintLength
Controls how many bytes to print in text dump.
See Also:
toString()
Constructor Detail

BinaryData

public BinaryData(byte[] data)
Initializer.
Parameters:
data - An array of data bytes.
Method Detail

getLength

public int getLength()
Accessor Method.

getData

public byte getData(int index)
Accessor Method.
Parameters:
index - Offset into the array of bytes.

getData

public byte[] getData()
Accessor Method.

hashCode

public int hashCode()
Accessor Method.
Overrides:
hashCode in class java.lang.Object

simpleClass

public static java.lang.String simpleClass(java.lang.String s)
Get the short name of a fully qualified class name.
Parameters:
s - A String in the form package.Class

getMaxPrintLength

public static int getMaxPrintLength()
Exposes the maximum number of bytes to be printed by this class.
See Also:
toString()

setMaxPrintLength

public static void setMaxPrintLength(int num)
Exposes the maximum number of bytes to be printed by this class.
Parameters:
num - The maximum bytes to print; other bytes are printed as ellipses.

toString

public java.lang.String toString()
Accessor Method.
Overrides:
toString in class java.lang.Object
See Also:
maxPrintLength

DixShtix