com.virtuosotechnologies.asaph.model
Interface StringList

All Superinterfaces:
SongMember
All Known Subinterfaces:
StringListField

public interface StringList
extends SongMember

This is the string list interface in an Asaph model. It is used in various places to represent an ordered list of strings, each represented by a SimpleString.


Method Summary
 void clear(UndoableEditListener undoListener)
          Clear the string list
 SimpleString getNextString(SimpleString reference)
          Get the next string following reference.
 SimpleString getNthString(int n)
          Get the nth string
 SimpleString getPreviousString(SimpleString reference)
          Get the previous string preceding reference.
 int getStringCount()
          Get the number of strings in the list
 SimpleString insertStringAfter(SimpleString after, String str, UndoableEditListener undoListener)
          Add a string to the list at the given position
 SimpleString insertStringBefore(SimpleString before, String str, UndoableEditListener undoListener)
          Add a string to the list at the given position
 void removeString(SimpleString str, UndoableEditListener undoListener)
          Remove a SimpleString from the list.
 
Methods inherited from interface com.virtuosotechnologies.asaph.model.SongMember
getSong, isDefunct
 

Method Detail

getStringCount

public int getStringCount()
Get the number of strings in the list

Returns:
number of strings

getNthString

public SimpleString getNthString(int n)
Get the nth string

Parameters:
n - index
Returns:
SimpleString

getNextString

public SimpleString getNextString(SimpleString reference)
Get the next string following reference. If reference is null, returns the first string. If reference is the last string, returns null;

Parameters:
reference - reference SimpleString
Returns:
next string
Throws:
IllegalArgumentException - reference is not a member

getPreviousString

public SimpleString getPreviousString(SimpleString reference)
Get the previous string preceding reference. If reference is null, returns the last string. If reference is the first string, returns null;

Parameters:
reference - reference SimpleString
Returns:
previous string
Throws:
IllegalArgumentException - reference is not a member

insertStringBefore

public SimpleString insertStringBefore(SimpleString before,
                                       String str,
                                       UndoableEditListener undoListener)
Add a string to the list at the given position

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

insertStringAfter

public SimpleString insertStringAfter(SimpleString after,
                                      String str,
                                      UndoableEditListener undoListener)
Add a string to the list at the given position

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

removeString

public void removeString(SimpleString str,
                         UndoableEditListener undoListener)
Remove a SimpleString from the list.

Parameters:
str - string 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