Package com.tagtraum.audiokern.segments
Class Segment
- java.lang.Object
-
- com.tagtraum.audiokern.segments.Segment
-
- All Implemented Interfaces:
Cloneable,Comparable<Segment>,org.json.simple.JSONAware
public class Segment extends Object implements Comparable<Segment>, Cloneable, org.json.simple.JSONAware
Audio segment like verse or refrain.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSegment.Type
-
Constructor Summary
Constructors Constructor Description Segment(String label, long start, long duration, Segment.Type type)Segment(org.json.simple.JSONObject jsonObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()intcompareTo(Segment that)booleanequals(Object o)longgetDuration()Duration in milliseconds (ms).longgetDuration(TimeUnit timeUnit)StringgetLabel()longgetStart()Start time in milliseconds (ms).longgetStart(TimeUnit timeUnit)Segment.TypegetType()inthashCode()StringtoJSONString()StringtoString()
-
-
-
Constructor Detail
-
Segment
public Segment(String label, long start, long duration, Segment.Type type)
-
Segment
public Segment(org.json.simple.JSONObject jsonObject)
-
-
Method Detail
-
getDuration
public long getDuration()
Duration in milliseconds (ms).- Returns:
- duration in milliseconds
- See Also:
getDuration(java.util.concurrent.TimeUnit)
-
getDuration
public long getDuration(TimeUnit timeUnit)
-
getLabel
public String getLabel()
-
getStart
public long getStart()
Start time in milliseconds (ms).- Returns:
- start time in milliseconds
- See Also:
getStart(java.util.concurrent.TimeUnit)
-
getStart
public long getStart(TimeUnit timeUnit)
-
getType
public Segment.Type getType()
-
compareTo
public int compareTo(Segment that)
- Specified by:
compareToin interfaceComparable<Segment>
-
toJSONString
public String toJSONString()
- Specified by:
toJSONStringin interfaceorg.json.simple.JSONAware
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-