public class VirtualBook extends java.lang.Object implements java.io.Serializable, VirtualBookSectionManipulation
Constructor and Description |
---|
VirtualBook(Scale scale)
default constructor
|
VirtualBook(Scale scale,
java.util.ArrayList<Hole> holes)
Constructor
|
VirtualBook(Scale scale,
VirtualBook copy)
construct a new VirtualBook with holes and events
|
Modifier and Type | Method and Description |
---|---|
void |
addAndMerge(Hole n)
Add and merge hole if some holes are overlapping
|
void |
addEvent(AbstractEvent event)
Add an Event
|
void |
addHole(java.util.Collection<Hole> holecollection)
Add a hole collection to the book
|
void |
addHole(Hole hole)
Add a hole in the book
|
void |
addHoles(java.util.Collection<Hole> holecollection)
add a list of holes
|
void |
clear()
This method clear all the holes on the book
|
VirtualBook |
clone()
Clone the content of the virtual book
|
void |
cutHoles(Hole n)
Cut book by the hole passed in parameter
|
java.util.ArrayList<AbstractEvent> |
findEvents(long start,
long end,
java.lang.Class<?> type)
find events of a given type from a start and end
|
java.util.ArrayList<Hole> |
findHoles(long start)
Find all the holes from the start position
|
java.util.ArrayList<Hole> |
findHoles(long start,
long length)
Find all the holes in the window specified in parameters
|
void |
findHoles(long start,
long length,
java.util.Collection<Hole> result,
HoleFilter f)
Find all the holes in the window specified in parameters, with an
additionnal filter
|
java.util.List<Hole> |
findHoles(long start,
long length,
int firsttrack,
int endtrack)
Recherche des notes dans la fenetre donnée
|
void |
findHoles(long start,
long length,
int firsttrack,
int endtrack,
java.util.List<Hole> resultList)
Recherche toutes les notes dans la fenetre donnée de temps donnée
|
void |
findHoles(long start,
long length,
int firsttrack,
int endtrack,
java.util.Set<Hole> result)
Recherche toutes les notes dans la fenetre donnée de temps donnée
|
void |
findHoles(long start,
long length,
java.util.Set<Hole> result)
Find all the holes in the window specified in parameters
|
<T extends AbstractEvent> |
findNextEvent(T ae)
Find the next event of the same type
|
<T extends AbstractEvent> |
findPreviousEvent(long timeStamp,
java.lang.Class<T> type)
Find the previous event applicable from this timeStamp
|
int |
findSection(long timestamp)
Get the section from the timestamp
|
VirtualBook |
flattenVirtualBook()
Create a new Virtual Book where all overlapped holes are merged
|
long |
getFirstHoleStart()
get the first hole timestamp, if not found, Long.MAX_VALUE is returned
|
java.util.ArrayList<Hole> |
getHolesCopy()
Deprecated.
|
long |
getLength_fast()
Get the book length in microseconds
|
long |
getLength()
Get the book length in microseconds
|
long |
getMarkerLength(MarkerEvent marker)
Return the length of the marker (the length from the marker to the next
one, or the end of the virtualbook)
|
VirtualBookMetadata |
getMetadata()
set virtual book metadata object
|
java.lang.String |
getName()
Get the name
|
java.util.Set<AbstractEvent> |
getOrderedEventsByRef()
get the events, ordered by timestamp [READ ONLY]
|
java.util.ArrayList<Hole> |
getOrderedHolesCopy()
Get a copy of all the holes, sorted by timestamp
|
Scale |
getScale()
Get the reference scale of the book
|
int |
getSectionCount()
get the section count
|
java.lang.String[] |
getSectionRegisters(int section)
get the activated registers in the section
|
long |
getSectionStart(int section)
get the section start of a section
|
protected org.barrelorgandiscovery.virtualbook.VirtualBook.SelectionContent |
getSelectionContent(Fragment sel)
Select the holes belonging to the selection, hole that start and the end
of the selection are not taken into consideration
|
int |
hashCode() |
void |
insertAt(Fragment selection,
long atPosition)
insert in the book the selection at the given atPosition, this will
extend the virtualbook for inserting the region
|
java.util.List<MarkerEvent> |
listMarkers()
Return the list of markers
|
void |
removeEvent(AbstractEvent event)
remove an event
|
void |
removeFragment(Fragment selection)
Remove the selection from the book
|
void |
removeHole(Hole n)
Remove a hole :-)computer science priviledge :-)
|
void |
removeHoles(java.util.List<Hole> holes)
remove a list of hole
|
Fragment |
selectMarker(MarkerEvent marker)
Select the marker
|
Fragment |
selectMarkers(MarkerEvent from,
MarkerEvent to)
Make a selection
|
void |
setMetadata(VirtualBookMetadata metadata)
get virtual book metadata object
|
void |
setName(java.lang.String name)
Set the name
|
void |
shift(long delta) |
void |
shiftAt(long start,
long delta)
shift the holes, that begin at start and events of a delta (in micro
seconds) from the start position
|
java.lang.String |
toString() |
public VirtualBook(Scale scale)
scale
- the scale of this bookpublic VirtualBook(Scale scale, java.util.ArrayList<Hole> holes)
scale
- scaleholes
- the holes for the bookpublic VirtualBook(Scale scale, VirtualBook copy)
public int hashCode()
hashCode
in class java.lang.Object
public Scale getScale()
public void addHole(Hole hole)
hole
- hole to addpublic void addHole(java.util.Collection<Hole> holecollection)
holecollection
- public void addHoles(java.util.Collection<Hole> holecollection)
holecollection
- public void addAndMerge(Hole n)
n
- public void cutHoles(Hole n)
n
- la note de decoupepublic void removeHole(Hole n)
n
- public void removeHoles(java.util.List<Hole> holes)
holes
- public void clear()
public java.util.ArrayList<Hole> findHoles(long start, long length)
start
- length
- public java.util.ArrayList<Hole> findHoles(long start)
start
- public void findHoles(long start, long length, java.util.Set<Hole> result)
result
- the list to be filledstart
- length
- public void findHoles(long start, long length, java.util.Collection<Hole> result, HoleFilter f)
result
- the list to be filledstart
- length
- f
- the additional filterpublic void findHoles(long start, long length, int firsttrack, int endtrack, java.util.Set<Hole> result)
start
- length
- public void findHoles(long start, long length, int firsttrack, int endtrack, java.util.List<Hole> resultList)
start
- length
- public java.util.List<Hole> findHoles(long start, long length, int firsttrack, int endtrack)
start
- the start timestamplength
- the length of the searchfirsttrack
- the first trackendtrack
- public long getLength()
public long getLength_fast()
public long getFirstHoleStart()
public void shift(long delta)
public void shiftAt(long start, long delta)
delta
- public java.util.ArrayList<Hole> getOrderedHolesCopy()
@Deprecated public java.util.ArrayList<Hole> getHolesCopy()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public void setName(java.lang.String name)
name
- public void addEvent(AbstractEvent event)
event
- public java.util.ArrayList<AbstractEvent> findEvents(long start, long end, java.lang.Class<?> type)
start
- startend
- endtype
- event type, or null if all events are wishedpublic <T extends AbstractEvent> T findPreviousEvent(long timeStamp, java.lang.Class<T> type)
T
- the event TypetimeStamp
- the timeStamptype
- the type of the eventpublic <T extends AbstractEvent> T findNextEvent(T ae)
T
- the event Typeae
- the abstract eventpublic java.util.Set<AbstractEvent> getOrderedEventsByRef()
public void removeEvent(AbstractEvent event)
event
- public int getSectionCount()
public long getSectionStart(int section)
section
- public java.lang.String[] getSectionRegisters(int section)
section
- the section indexpublic int findSection(long timestamp)
timestamp
- public VirtualBook flattenVirtualBook()
public void setMetadata(VirtualBookMetadata metadata)
metadata
- public VirtualBookMetadata getMetadata()
public java.util.List<MarkerEvent> listMarkers()
VirtualBookSectionManipulation
listMarkers
in interface VirtualBookSectionManipulation
public long getMarkerLength(MarkerEvent marker)
VirtualBookSectionManipulation
getMarkerLength
in interface VirtualBookSectionManipulation
public Fragment selectMarker(MarkerEvent marker)
VirtualBookSectionManipulation
selectMarker
in interface VirtualBookSectionManipulation
public Fragment selectMarkers(MarkerEvent from, MarkerEvent to)
VirtualBookSectionManipulation
selectMarkers
in interface VirtualBookSectionManipulation
protected org.barrelorgandiscovery.virtualbook.VirtualBook.SelectionContent getSelectionContent(Fragment sel)
sel
- public void insertAt(Fragment selection, long atPosition)
VirtualBookSectionManipulation
insertAt
in interface VirtualBookSectionManipulation
selection
- the selectionatPosition
- the positionpublic void removeFragment(Fragment selection)
VirtualBookSectionManipulation
removeFragment
in interface VirtualBookSectionManipulation
public VirtualBook clone()
clone
in class java.lang.Object