|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.sciss.io.Marker
public class Marker
A struct class: marker in an audio file. (copied from FScape).
AudioFileDescr.KEY_MARKERS
,
Serialized FormField Summary | |
---|---|
java.lang.String |
name
A marker's name |
static java.util.Comparator |
nameComparator
A Comparator which can be
used to sort a list of markers according
to the markers' names. |
long |
pos
A marker's position in sample frames |
Constructor Summary | |
---|---|
Marker(long pos,
java.lang.String name)
Constructs a new immutable marker |
|
Marker(Marker orig)
Constructs a new immutable marker identical to a given marker. |
Method Summary | |
---|---|
static int |
add(java.util.List markers,
Marker marker)
Adds marker chronologically to a pre-sorted list. |
java.lang.Object |
clone()
Returns a new marker which is equal to this one. |
int |
compareTo(java.lang.Object o)
Implementation of the Comparable interface. |
boolean |
equals(java.lang.Object o)
|
static int |
find(java.util.List markers,
java.lang.String name,
int startIndex)
Gets the index for specific marker in a list. |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.Comparator nameComparator
Comparator
which can be
used to sort a list of markers according
to the markers' names. Note that to sort
markers according to their position, you
can use the natural ordering of
the markers as defined by the Comparable
interface.
Collections.sort( List )
,
Collections.sort( List, Comparator )
public final long pos
public final java.lang.String name
Constructor Detail |
---|
public Marker(long pos, java.lang.String name)
pos
- position in sample framesname
- marker's namepublic Marker(Marker orig)
orig
- the marker to copyMethod Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneNotSupportedException
is never thrown.
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
Comparable
interface.
The passed object can be either another Marker
or a Region
. In the latter case, the region's
start position is compared to this marker's position.
compareTo
in interface java.lang.Comparable
o
- the object to compare to this marker
java.lang.ClassCastException
- if o
is neither a Markers
nor a Region
public static int add(java.util.List markers, Marker marker)
markers
- a chronological marker listmarker
- the marker to insert such that
its predecessor has a position
less or equal this marker's position
and the marker's successor has a position
greater than this marker's position.
public static int find(java.util.List markers, java.lang.String name, int startIndex)
nameComparator
,
and looking it up using Collections.binarySearch()
.
markers
- a List
whose elements are
instanceof Marker
.name
- marker name to findstartIndex
- where to begin
startIndex
) of a marker whose name equals
the given name.nameComparator
,
Collections.binarySearch( List, Object, Comparator )
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |