Package com.peterphi.std.types
Class TimecodeRange
java.lang.Object
com.peterphi.std.types.TimecodeRange
Represents a range between two non-null timecodes
-
Constructor Summary
ConstructorDescriptionTimecodeRange
(Timecode start, SampleCount duration) TimecodeRange
(Timecode start, Timecode end) -
Method Summary
Modifier and TypeMethodDescriptionadd
(SampleCount samples) Move the range right by the specified number of samplesboolean
getEnd()
getStart()
int
hashCode()
static TimecodeRange
merge
(TimecodeRange a, TimecodeRange b) Produce a new Timecode range which includes all timecodes froma
andb
.boolean
overlaps
(TimecodeRange that) Determines whether two timecode ranges overlap (or are equivalent)subtract
(SampleCount samples) Move the range left by the specified number of samplesConstructs a new TimecodeRange where the values are expressed as offsets fromreference
.toString()
boolean
Tests whether a timecode lies within (or on the boundaries of) this rangeboolean
within
(TimecodeRange test) Test whether a given timecode range lies wholly within (or on the boundaries of) this range
-
Constructor Details
-
TimecodeRange
-
TimecodeRange
-
-
Method Details
-
getStart
-
getEnd
-
getDuration
-
toOffset
Constructs a new TimecodeRange where the values are expressed as offsets fromreference
.- Parameters:
reference
- the reference timecode. Must be less than or equal to the start timecode for this range- Returns:
-
subtract
Move the range left by the specified number of samples- Parameters:
samples
-- Returns:
-
add
Move the range right by the specified number of samples- Parameters:
samples
-- Returns:
-
resample
-
resample
-
within
Tests whether a timecode lies within (or on the boundaries of) this range- Parameters:
test
-- Returns:
-
within
Test whether a given timecode range lies wholly within (or on the boundaries of) this range- Parameters:
test
-- Returns:
-
overlaps
Determines whether two timecode ranges overlap (or are equivalent)- Parameters:
that
- some other timecode range. comparisons will be made based on the time represented- Returns:
- true if the ranges overlap, otherwise false
-
merge
Produce a new Timecode range which includes all timecodes froma
andb
. This may result in coverage of additional timecodes if the two ranges do not overlap.- Parameters:
a
-b
-- Returns:
-
toString
-
hashCode
public int hashCode() -
equals
-