com.virtuosotechnologies.asaph.model
Interface BinaryList

All Superinterfaces:
SongMember
All Known Subinterfaces:
BinaryListField

public interface BinaryList
extends SongMember

This is the binary list interface in an Asaph model. It is used in various places to represent an ordered list of binary data elements, each represented by a BinaryData.


Method Summary
 void clear(UndoableEditListener undoListener)
          Clear the string list
 int getBinaryDataCount()
          Get the number of binary data elements in the list
 BinaryData getNextBinaryData(BinaryData reference)
          Get the next data element following reference.
 BinaryData getNthBinaryData(int n)
          Get the nth binary data element
 BinaryData getPreviousBinaryData(BinaryData reference)
          Get the previous data element preceding reference.
 BinaryData insertBinaryDataAfter(BinaryData after, String type, byte[] value, UndoableEditListener undoListener)
          Add a data element to the list at the given position
 BinaryData insertBinaryDataBefore(BinaryData before, String type, byte[] value, UndoableEditListener undoListener)
          Add a data element to the list at the given position
 void removeBinaryData(BinaryData data, UndoableEditListener undoListener)
          Remove a BinaryData from the list.
 
Methods inherited from interface com.virtuosotechnologies.asaph.model.SongMember
getSong, isDefunct
 

Method Detail

getBinaryDataCount

public int getBinaryDataCount()
Get the number of binary data elements in the list

Returns:
number of elements

getNthBinaryData

public BinaryData getNthBinaryData(int n)
Get the nth binary data element

Parameters:
n - index
Returns:
BinaryData

getNextBinaryData

public BinaryData getNextBinaryData(BinaryData reference)
Get the next data element following reference. If reference is null, returns the first data element. If reference is the last data element, returns null;

Parameters:
reference - reference BinaryData
Returns:
next data element
Throws:
IllegalArgumentException - reference is not a member

getPreviousBinaryData

public BinaryData getPreviousBinaryData(BinaryData reference)
Get the previous data element preceding reference. If reference is null, returns the last data element. If reference is the first data element, returns null;

Parameters:
reference - reference BinaryData
Returns:
previous data element
Throws:
IllegalArgumentException - reference is not a member

insertBinaryDataBefore

public BinaryData insertBinaryDataBefore(BinaryData before,
                                         String type,
                                         byte[] value,
                                         UndoableEditListener undoListener)
Add a data element to the list at the given position

Parameters:
before - insert before this data element, or at the end if null
type - binary data type
value - binary data value. May be null.
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits
Returns:
SimpleString for new data element
Throws:
IllegalArgumentException - before is not a member
NullPointerException - type was null

insertBinaryDataAfter

public BinaryData insertBinaryDataAfter(BinaryData after,
                                        String type,
                                        byte[] value,
                                        UndoableEditListener undoListener)
Add a data element to the list at the given position

Parameters:
after - insert after this data element, or at the beginning if null
type - binary data type
value - binary data value. May be null.
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits
Returns:
SimpleString for new data element
Throws:
IllegalArgumentException - after is not a member
NullPointerException - type was null

removeBinaryData

public void removeBinaryData(BinaryData data,
                             UndoableEditListener undoListener)
Remove a BinaryData from the list.

Parameters:
data - data element to remove
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits
Throws:
IllegalArgumentException - str is not a member
NullPointerException - str was null

clear

public void clear(UndoableEditListener undoListener)
Clear the string list

Parameters:
undoListener - listener to notify if an undoable edit is generated, or null to suppress generation of undoable edits