|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.dacopan.model.NoteManager
public class NoteManager
This class acts as a container for all Notes. It takes care of providing an ecapsulated notes management strategy, so that each component that need notes data uses the services in this class. In the design this is sometimes referred to as the "notes interface".
Field Summary | |
---|---|
protected java.util.Map |
notesEnc
|
protected java.util.Map |
notesMsc
Notes attached to time and layer are stored in one map, with as many entries as there are layers. |
protected java.util.Map |
notesTsc
|
Constructor Summary | |
---|---|
NoteManager()
This constructor sets up the proper HashMaps needed for keeping track of the notes relevant to a particular set of protocol events. |
Method Summary | |
---|---|
void |
addNoteEnc(Note note)
Adds an encapsulation note that is attached to a specific TransferUnit. |
void |
addNoteTimeLayer(Note note)
Adds a note to the requested layer by putting it in the corresponding linked list. |
void |
addNoteTsc(Note note)
|
void |
deleteNote(Note note)
Deletes the passed note from the NoteManager |
java.lang.Object |
getData()
This method is used to save all notes to a scenario file. |
Note |
getNoteEnc(TransferUnit transferUnit)
Returns the encapsulation note attached to the given TransferUnit. |
java.util.Map |
getNotesEnc()
Returns the map where ENC notes are stored, in linked lists, one per layer. |
java.util.LinkedList |
getNotesForLayer(Layer layer)
Returns a Linked list (Collection) of all the notes corresponding to the requested layer. |
java.util.Collection |
getNotesInTimeRange(Layer layer,
float startTime,
float endTime)
Returns the notes corresponding to the requested layer where the times are between startTime and endTime. |
java.util.Map |
getNotesMsc()
Returns the map where MSC notes are stored, in linked lists, one per layer. |
java.util.Map |
getNotesTsc()
|
Note |
getNoteTimeLayerNext(Layer layer,
float time,
boolean inclusive)
Returns the first note coming AFTER the given time on the given layer. |
Note |
getNoteTimeLayerPrev(Layer layer,
float time,
boolean inclusive)
Returns the first note coming BEFORE the given time on the given layer. |
Note |
getNoteTsc(TransferUnit transferUnit)
|
void |
setData(java.lang.Object o)
Used to load notes from a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map notesMsc
protected java.util.Map notesEnc
protected java.util.Map notesTsc
Constructor Detail |
---|
public NoteManager()
dataView
- Method Detail |
---|
public void addNoteTimeLayer(Note note)
note
- public void deleteNote(Note note) throws java.lang.IllegalArgumentException
note
-
java.lang.IllegalArgumentException
public Note getNoteTimeLayerPrev(Layer layer, float time, boolean inclusive)
layer
- time
- inclusive
- whether the timestamp is inclusive or not
public Note getNoteTimeLayerNext(Layer layer, float time, boolean inclusive)
layer
- time
- inclusive
- whether the timestamp is inclusive or not
public java.util.LinkedList getNotesForLayer(Layer layer)
layer
- public java.util.Collection getNotesInTimeRange(Layer layer, float startTime, float endTime)
layer
- startTime
- endTime
-
public void addNoteEnc(Note note)
noteText
- public Note getNoteEnc(TransferUnit transferUnit)
transferUnit
-
public void addNoteTsc(Note note)
public Note getNoteTsc(TransferUnit transferUnit)
public java.lang.Object getData()
getData
in interface Saveable
public void setData(java.lang.Object o)
setData
in interface Saveable
o
- loaded objectpublic java.util.Map getNotesMsc()
public java.util.Map getNotesTsc()
public java.util.Map getNotesEnc()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |