|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.weblab_project.core.factory.SegmentFactory
public class SegmentFactory
To create Segment
s we strongly encourage to use this class. It will enable the creation of a Segment
having an URI
compliant with the WebLabRI
recommendations.
Since an Segment
hasn't any sense without being attached to a MediaUnit
, we only provide a method for creating Segment
s that takes a MediaUnit
in parameter. As a result, the created Segment
(an instance of the Segment
class in
parameter) is added to the Segment
List
of the MediaUnit
.
Method Summary | ||
---|---|---|
static org.weblab_project.core.model.text.LinearSegment |
createAndLinkLinearSegment(org.weblab_project.core.model.text.Text text,
int start,
int end)
Look in text if a LinearSegment already exists at start and end . |
|
static
|
createAndLinkSegment(org.weblab_project.core.model.MediaUnit mediaUnit,
java.lang.Class<T> segClass)
Automatically set a valid WebLabRI to the created Segment using the MediaUnit to generate an unique id. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final org.weblab_project.core.model.text.LinearSegment createAndLinkLinearSegment(org.weblab_project.core.model.text.Text text, int start, int end)
text
if a LinearSegment
already exists at start
and end
. If it's the case, returns it.
Otherwise, it creates a LinearSegment
using createAndLinkSegment(MediaUnit, Class)
method, and setting the start
and
end
.
text
- The Text
containing the Segment
start
- char index of the Segment
startend
- char index of the Segment
end
LinearSegment
or the existing one at the same position in the Text
.public static final <T extends org.weblab_project.core.model.Segment> T createAndLinkSegment(org.weblab_project.core.model.MediaUnit mediaUnit, java.lang.Class<T> segClass)
WebLabRI
to the created Segment
using the MediaUnit
to generate an unique id. Created
Segment
will be added to the MediaUnit
.
T
- The subclass of Segment
to be createdmediaUnit
- the MediaUnit
that will contains the created Segment
segClass
- The class of the Segment
to be created
segClass
with a valid WebLabRI
and added to the MediaUnit
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |