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 class
Segment.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 Object
clone()
int
compareTo(Segment that)
boolean
equals(Object o)
long
getDuration()
Duration in milliseconds (ms).long
getDuration(TimeUnit timeUnit)
String
getLabel()
long
getStart()
Start time in milliseconds (ms).long
getStart(TimeUnit timeUnit)
Segment.Type
getType()
int
hashCode()
String
toJSONString()
String
toString()
-
-
-
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:
compareTo
in interfaceComparable<Segment>
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.simple.JSONAware
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
-