Class SegmentImpl
java.lang.Object
org.opencastproject.metadata.mpeg7.SegmentImpl
- All Implemented Interfaces:
XmlElement,AudioSegment,AudioVisualSegment,Segment,VideoSegment
public class SegmentImpl
extends Object
implements Segment, AudioSegment, VideoSegment, AudioVisualSegment
Default implementation of the
SegmentType.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencastproject.metadata.mpeg7.Segment
Segment.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<TextAnnotation> The text annotationsprotected StringThe content element identifierprotected MediaTimeThe content time contraintsprotected SpatioTemporalDecompositionAn optional spatio-temporal decompositionprotected Segment.TypeThe content type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSpatioTemporalDecomposition(boolean gap, boolean overlap) Creates a spatio temporal decomposition in this video segment.createTextAnnotation(float relevance, float confidence, String language) Creates a new text annotation that will hold keywords and free text comments.booleanReturns the segment identifier.Returns the segment's time constraints.Returns the spatio temporal decomposition that contains information about elements on the segment such as text elements.intReturns the number of text annotations.inthashCode()booleanReturnstrueif there is a spatio temporal decomposition as part of this segment.booleanReturnstrueif the segment contains any text annotations.booleanhasTextAnnotations(float relevance, float confidence) Returnstrueif the segment contains text annotations that satisfy the given relevance and confidence values.booleanhasTextAnnotations(float relevance, float confidence, String language) Returnstrueif the segment contains text annotations that satisfy the given relevance, confidence and language constraints.booleanhasTextAnnotations(String language) Returnstrueif the segment contains text annotations in the specified language.voidsetMediaTime(MediaTime mediaTime) Sets the segment's media time constraints.Returns this segment's text annotations.Returns this segment's text annotations, sorted by relevance.Returns this segment's text annotations, sorted by relevance.Returns an xml node representation of this element.
-
Field Details
-
type
The content type -
id
The content element identifier -
mediaTime
The content time contraints -
annotations
The text annotations -
spatioTemporalDecomposition
An optional spatio-temporal decomposition
-
-
Constructor Details
-
SegmentImpl
Creates a new content segment.- Parameters:
type- the segment typeid- the segment identifier
-
-
Method Details
-
getIdentifier
Description copied from interface:SegmentReturns the segment identifier.- Specified by:
getIdentifierin interfaceSegment- Returns:
- the identifier
- See Also:
-
setMediaTime
Description copied from interface:SegmentSets the segment's media time constraints.- Specified by:
setMediaTimein interfaceSegment- Parameters:
mediaTime- the media time- See Also:
-
getMediaTime
Description copied from interface:SegmentReturns the segment's time constraints.- Specified by:
getMediaTimein interfaceSegment- Returns:
- the media time
- See Also:
-
hasTextAnnotations
public boolean hasTextAnnotations()Description copied from interface:SegmentReturnstrueif the segment contains any text annotations.- Specified by:
hasTextAnnotationsin interfaceSegment- Returns:
trueif there are text annotations- See Also:
-
hasTextAnnotations
Description copied from interface:SegmentReturnstrueif the segment contains text annotations in the specified language.- Specified by:
hasTextAnnotationsin interfaceSegment- Returns:
trueif there are text annotations- See Also:
-
hasTextAnnotations
public boolean hasTextAnnotations(float relevance, float confidence) Description copied from interface:SegmentReturnstrueif the segment contains text annotations that satisfy the given relevance and confidence values.- Specified by:
hasTextAnnotationsin interfaceSegment- Returns:
trueif there are text annotations- See Also:
-
hasTextAnnotations
Description copied from interface:SegmentReturnstrueif the segment contains text annotations that satisfy the given relevance, confidence and language constraints.- Specified by:
hasTextAnnotationsin interfaceSegment- Returns:
trueif there are text annotations- See Also:
-
getTextAnnotationCount
public int getTextAnnotationCount()Description copied from interface:SegmentReturns the number of text annotations. Note that text annotations are containers themselves, containing a number of keywords and free text entries.- Specified by:
getTextAnnotationCountin interfaceSegment- Returns:
- the number of text annotations
- See Also:
-
textAnnotationsByConfidence
Description copied from interface:SegmentReturns this segment's text annotations, sorted by relevance.- Specified by:
textAnnotationsByConfidencein interfaceSegment- Returns:
- the text annotations
- See Also:
-
textAnnotationsByRelevance
Description copied from interface:SegmentReturns this segment's text annotations, sorted by relevance.- Specified by:
textAnnotationsByRelevancein interfaceSegment- Returns:
- the text annotations
- See Also:
-
createTextAnnotation
Description copied from interface:SegmentCreates a new text annotation that will hold keywords and free text comments.- Specified by:
createTextAnnotationin interfaceSegment- Parameters:
relevance- the relevance valueconfidence- the confidencelanguage- the language identifier- Returns:
- the new text annotation
- See Also:
-
textAnnotations
Description copied from interface:SegmentReturns this segment's text annotations.- Specified by:
textAnnotationsin interfaceSegment- Returns:
- the text annotations
- See Also:
-
createSpatioTemporalDecomposition
public SpatioTemporalDecomposition createSpatioTemporalDecomposition(boolean gap, boolean overlap) throws IllegalStateException Creates a spatio temporal decomposition in this video segment.- Specified by:
createSpatioTemporalDecompositionin interfaceAudioVisualSegment- Specified by:
createSpatioTemporalDecompositionin interfaceVideoSegment- Parameters:
gap-trueif there may be gap between the elementsoverlap-trueif elements may overlap- Returns:
- the new decomposition
- Throws:
IllegalStateException- if there is already such a decomposition- See Also:
-
getSpatioTemporalDecomposition
Returns the spatio temporal decomposition that contains information about elements on the segment such as text elements.- Specified by:
getSpatioTemporalDecompositionin interfaceAudioVisualSegment- Specified by:
getSpatioTemporalDecompositionin interfaceVideoSegment- Returns:
- the spatio temporal decomposition
- See Also:
-
hasSpatioTemporalDecomposition
public boolean hasSpatioTemporalDecomposition()Returnstrueif there is a spatio temporal decomposition as part of this segment.- Specified by:
hasSpatioTemporalDecompositionin interfaceAudioVisualSegment- Specified by:
hasSpatioTemporalDecompositionin interfaceVideoSegment- Returns:
trueif there is a spatio temporal decomposition- See Also:
-
hashCode
public int hashCode() -
equals
-
toXml
Description copied from interface:XmlElementReturns an xml node representation of this element.- Specified by:
toXmlin interfaceXmlElement- Parameters:
document- the enclosing xml document- Returns:
- the xml node
- See Also:
-