|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.TreeSet
ag.AGSet
public class AGSet
AGSet is a set of AG objets. It provides an interface to the developer for managing AGs and their associated annotations, timelines, signals and anchors. The developer accesses all AG elements from within AGSet by calling the relevant methods with an Id argument of type String. Consequently, the developer has no direct access to the objects themselves. The AGSet contains a HashMap, timelines, indexed by timelineId, containing Timelines. This allows for a Timeline to be available to multiple AGs. AGSet also contains two Identifiers objects, timelineIds and agIds which are used for indexing AGs and Ids. The Identifiers class is a central storage space containing HashMaps which are class variables.
| Constructor Summary | |
|---|---|
AGSet(org.w3c.dom.Element element)
|
|
AGSet(java.lang.String id)
Class constructor, initializing all timelines, timelineIds, and agIds; |
|
| Method Summary | |
|---|---|
java.lang.String |
copyAnnotation(java.lang.String annotationId)
Creates a copy of a specified annotation but assigns it a new id. |
java.lang.String |
createAG(java.lang.String id,
java.lang.String timelineId,
java.lang.String type)
Creates a new AG. |
java.lang.String |
createAnchor(java.lang.String id,
float offset,
java.lang.String unit,
java.lang.String signalIds)
Creates an anchor with specified offset, unit and signals. |
java.lang.String |
createAnchor(java.lang.String id,
java.lang.String unit,
java.lang.String signalIds)
Creates an anchor with specified unit and signals. |
java.lang.String |
createAnnotation(java.lang.String id,
java.lang.String anchorId1,
java.lang.String anchorId2,
java.lang.String annotationType)
Creates a new annotation and adds it to specified AG. |
java.lang.String |
createSignal(java.lang.String id,
java.lang.String uri,
java.lang.String mimeClass,
java.lang.String mimeType,
java.lang.String encoding,
java.lang.String unit,
java.lang.String track)
Creates a new Signal and add it to Timeline specified by the id. |
java.lang.String |
createTimeline(java.lang.String id)
Creates a new Timeline and add it to this AGSet. |
void |
deleteAG(java.lang.String agId)
Removes an AG from this AGSet. |
void |
deleteAnchor(java.lang.String anchorId)
Deletes an anchor from the AG in the namespace of its id. |
void |
deleteAnnotation(java.lang.String annotationId)
Deletes an annotation from its corresponding AG. |
void |
deleteFeature(java.lang.String id,
java.lang.String featureName)
Deletes the specified feature from the metadata or annotation. |
void |
deleteSignal(java.lang.String signalId)
Deletes a signal from its Timeline. |
void |
deleteTimeline(java.lang.String timelineId)
Removes a Timeline from this AGSet. |
boolean |
existsAG(java.lang.String agId)
Check if an AG exists in this AGSet. |
boolean |
existsAnchor(java.lang.String anchorId)
Checks if an anchor exists in this AGSet. |
boolean |
existsAnnotation(java.lang.String annotationId)
Checks if an Annotation exists in this AGSet. |
boolean |
existsFeature(java.lang.String id,
java.lang.String featureName)
Checks if a Feature exists in the AG or Annotation specified by id. |
boolean |
existsSignal(java.lang.String signalId)
Checks if a Signal exists in this AGSet. |
boolean |
existsTimeline(java.lang.String timelineId)
Checks if a Timeline exists in this AGSet. |
java.lang.String |
getAGId(java.lang.String id)
Gets the AGId given an annotationId or anchorId. |
java.util.Set |
getAGIds()
Gets a Set of Strings containg the ids all AGs in this AGSet. |
float |
getAnchorOffset(java.lang.String anchorId)
Gets the offset of the specified anchor. |
java.util.Set |
getAnchorSet(java.lang.String agId)
Get the Set of anchors for the specified AG. |
java.util.Set |
getAnchorSetByOffset(java.lang.String agId,
float offset,
float epsilon)
Gets a set containing those anchors with offset between offset +/- epsilon. |
java.util.Set |
getAnchorSetNearestOffset(java.lang.String agId,
float offset)
Gets a set containing those anchors with offset nearest to a specified offset in the specified AG. |
java.lang.String |
getAnchorSignalIds(java.lang.String anchorId)
Gets the signals of the specified anchor. |
java.lang.String |
getAnnotationByOffset(java.lang.String agId,
float offset)
Gets the first annotation which spans over a specified offset in the specified AG. |
java.util.Set |
getAnnotationSeqByOffset(java.lang.String agId,
float begin,
float end)
Gets all annotations with its start anchor offset in between the specified values from the specified AG. |
java.util.Set |
getAnnotationSetByFeature(java.lang.String agId,
java.lang.String featureName)
Gets the set of annotations with a specified feature from the specified AG. |
java.util.Set |
getAnnotationSetByOffset(java.lang.String agId,
float offset)
Gets the annotations that span across the specified time offset from the specified AG. |
java.util.Set |
getAnnotationSetByType(java.lang.String agId,
java.lang.String annotationType)
Gets the set of annotations with a specified type from the specified AG. |
java.lang.String |
getAnnotationType(java.lang.String annotationId)
Gets the type of the specified annotation. |
java.lang.String |
getEndAnchor(java.lang.String annotationId)
Gets the id of the end anchor of the specified annotation. |
float |
getEndOffset(java.lang.String annotationId)
Gets the id of the end anchor of the specified annotation. |
java.lang.String |
getFeature(java.lang.String id,
java.lang.String featureName)
Gets the value of the specified feature in the metadata or annotation. |
java.util.Set |
getFeatureNames(java.lang.String id)
Gets all feature names from the metadata or annotation. |
java.util.Set |
getFeatures(java.lang.String id)
Gets all the feature values in the specified metadata or annotation. |
java.lang.String |
getID()
|
java.util.Set |
getIncomingAnnotationSet(java.lang.String anchorId)
Gets the set of annotations which have the specified anchor as an end anchor. |
java.lang.String |
getOffsetUnit(java.lang.String anchorId)
Gets the unit of the specified anchor. |
java.util.Set |
getOutgoingAnnotationSet(java.lang.String anchorId)
Gets the set of annotations which have the specified anchor as a start anchor. |
java.lang.String |
getSignalEncoding(java.lang.String signalId)
Gets the type of encoding of the specified signal. |
java.lang.String |
getSignalMimeClass(java.lang.String signalId)
Gets the mimeclass of the specified signal. |
java.lang.String |
getSignalMimeType(java.lang.String signalId)
Gets the mimetype of the specified signal. |
java.util.HashSet |
getSignals(java.lang.String timelineId)
Gets all the signalIds for the signals contained in a Timeline. |
java.lang.String |
getSignalTrack(java.lang.String signalId)
Gets the track of the specified signal. |
java.lang.String |
getSignalUnit(java.lang.String signalId)
Gets the time unit of the specified signal. |
java.lang.String |
getSignalXlinkHref(java.lang.String signalId)
Gets the Xlinkref of the specified signal. |
java.lang.String |
getSignalXlinkType(java.lang.String signalId)
Gets the Xlinktype of the specified signal. |
java.lang.String |
getStartAnchor(java.lang.String annotationId)
Gets the id of the start anchor of the specified annotation. |
float |
getStartOffset(java.lang.String annotationId)
Gets the offset of the start anchor of the specified annotation. |
java.lang.String |
getTimelineId(java.lang.String id)
Gets the timelineId give an AgId or SignalId. |
java.util.Set |
getTimelineIds()
Returns a set including all the timelineIds in this AGSet. |
java.util.Set |
nSplitAnnotation(java.lang.String annotationId,
int n)
Split an annotation n times. |
void |
printAGSetInfo()
|
void |
printAnchorSetInfo(java.lang.String agId)
|
void |
printAnnotationSetInfo(java.lang.String agId)
|
void |
printSignalSetInfo(java.lang.String timelineId)
|
void |
setAnchorOffset(java.lang.String anchorId,
float offset)
Sets the specified anchor's offset to the specified offset. |
void |
setAnchorSignalIds(java.lang.String anchorId,
java.lang.String signalIds)
Sets the signals of the specified anchor. |
void |
setEndAnchor(java.lang.String annotationId,
java.lang.String anchorId)
Sets the end anchor of the specified annotation to the specified anchor. |
void |
setEndOffset(java.lang.String annotationId,
float offset)
Sets the specified annotation's end anchor's offset to the specified offset. |
void |
setFeature(java.lang.String id,
java.lang.String featureName,
java.lang.String featureValue)
Set feature value of the metadata or annotation. |
void |
setFeatures(java.lang.String id,
java.lang.String features)
Set multiple features in a single string. |
void |
setOffsetUnit(java.lang.String anchorId,
java.lang.String unit)
Sets the unit of the specified anchor. |
void |
setStartAnchor(java.lang.String annotationId,
java.lang.String anchorId)
Sets the start anchor of the specified annotation to the specified anchor. |
void |
setStartOffset(java.lang.String annotationId,
float offset)
Sets the start offset of an annotation to the specified offset. |
java.lang.String |
splitAnchor(java.lang.String anchorId)
Split an anchor in two. |
java.lang.String |
splitAnnotation(java.lang.String annotationId)
Split an annotation a in two. |
java.lang.String |
toString()
Creates a string representation of this AGSet. |
void |
unsetAnchorOffset(java.lang.String anchorId)
Sets the specified anchor's offset to -1. |
void |
unsetFeature(java.lang.String id,
java.lang.String featureName)
Sets a feature's value to "", an empty String. |
void |
unsetFeatures(java.lang.String id)
Unsets all features in the metadata or annotation. |
| Methods inherited from class java.util.TreeSet |
|---|
add, addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, remove, size, subSet, tailSet |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public AGSet(java.lang.String id)
public AGSet(org.w3c.dom.Element element)
throws AGException
AGException| Method Detail |
|---|
public java.lang.String getID()
public java.lang.String createAG(java.lang.String id,
java.lang.String timelineId,
java.lang.String type)
throws AGException
id, - the id of the new AG. If the id has already been assigned,
the ag gets a new id. The id can be either an AG id or AGSet id.timelineId, - the id of the timeline to be assigned to the new AG.type, - the type of the new AG.
AGException, - if the id is invalid.
AGException
public boolean existsAG(java.lang.String agId)
throws AGException
agId, - the id of the AG.
AGException
public void deleteAG(java.lang.String agId)
throws AGException
timelineId, - the id of the timeline to be deleted.
AGException, - if the AG does not exist in this AGSet.
AGExceptionIdentifiers.getTimeline.
public java.util.Set getAGIds()
throws AGException
AGException
public void printAGSetInfo()
throws AGException
AGException
public java.lang.String createTimeline(java.lang.String id)
throws AGException
id - might be AGSetId or TimelineId.
AGException - IF (the id given is invalid)public boolean existsTimeline(java.lang.String timelineId)
timelineId, - the id of the Timeline.
public void deleteTimeline(java.lang.String timelineId)
throws AGException
timelineId, - the id of the timeline to be deleted.
AGException, - if the AG does not exist in this AGSet.
AGExceptionIdentifierspublic java.util.Set getTimelineIds()
public java.lang.String createSignal(java.lang.String id,
java.lang.String uri,
java.lang.String mimeClass,
java.lang.String mimeType,
java.lang.String encoding,
java.lang.String unit,
java.lang.String track)
throws AGException
id, - might be AGSetId or TimelineId.uri, - the "physical" location of the signal.mimeClass, - the mimeclass of the signal.mimeType, - the mimeType of the signal.encoding, - the encoding of the signal.unit, - the time unit of the signal.track, - the track of the signal.
AGException - IF (the id given is invalid)
public boolean existsSignal(java.lang.String signalId)
throws AGException
signalId, - the id of the Signal.
AGException
public void deleteSignal(java.lang.String signalId)
throws AGException
signalId, - the id of the signal to be deleted.
AGException, - if the signalId is invalid.
AGExceptionTimeline.deleteSignal().
public java.util.HashSet getSignals(java.lang.String timelineId)
throws AGException
timelineId, - the id of the timeline.
AGException
public java.lang.String getSignalMimeClass(java.lang.String signalId)
throws AGException
signalId, - the id of the signal.
AGException
public java.lang.String getSignalMimeType(java.lang.String signalId)
throws AGException
signalId, - the id of the signal.
AGException
public java.lang.String getSignalEncoding(java.lang.String signalId)
throws AGException
signalId, - the id of the signal.
AGException
public java.lang.String getSignalXlinkType(java.lang.String signalId)
throws AGException
signalId, - the id of the signal.
AGException
public java.lang.String getSignalXlinkHref(java.lang.String signalId)
throws AGException
signalId, - the id of the signal.
AGException
public java.lang.String getSignalUnit(java.lang.String signalId)
throws AGException
signalId, - the id of the signal.
AGException
public java.lang.String getSignalTrack(java.lang.String signalId)
throws AGException
signalId, - the id of the signal.
AGException
public void printSignalSetInfo(java.lang.String timelineId)
throws AGException
AGException
public java.lang.String createAnnotation(java.lang.String id,
java.lang.String anchorId1,
java.lang.String anchorId2,
java.lang.String annotationType)
throws AGException
id - might be agId or annotationId.
AGException - IF (the id given is invalid)
public java.lang.String copyAnnotation(java.lang.String annotationId)
throws AGException
id, - an the id of the annotation to be copied.
AGException - IF (the id given is invalid)
public void deleteAnnotation(java.lang.String annotationId)
throws AGException
annotationId, - the id of the annotation to be deleted.
AGException, - if the id is invalid.
AGException
public void setStartAnchor(java.lang.String annotationId,
java.lang.String anchorId)
throws AGException
annotationId, - the annotation being assigned a new start anchor.anchorId, - the new start anchor.
AGException, - if either id is invalid.
AGException
public void setEndAnchor(java.lang.String annotationId,
java.lang.String anchorId)
throws AGException
annotationId, - the annotation being assigned a new end anchor.anchorId, - the new start anchor.
AGException, - if either id is invalid.
AGException
public void setStartOffset(java.lang.String annotationId,
float offset)
throws AGException
annotationId, - the annotation getting a new offset.offset, - the new offset value.
AGException
public void setEndOffset(java.lang.String annotationId,
float offset)
throws AGException
ann, - the id of the specified annotation.offset, - the new offset for the end anchor of ann.
AGException - if the annotation doesn't exist in the AG.AG.setEndOffset.
public java.lang.String splitAnnotation(java.lang.String annotationId)
throws AGException
annotationId, - the annotation to be split.
AGExceptionAG.splitAnnotation.
public java.util.Set nSplitAnnotation(java.lang.String annotationId,
int n)
throws AGException
annotationId, - the id of the annotation to be split n times.n, - the number of times original annotation will be split.
AGExceptionsplitAnnotationpublic boolean existsAnnotation(java.lang.String annotationId)
annotationId, - the id of the Annotation.
public java.lang.String getAnnotationType(java.lang.String annotationId)
throws AGException
AGException
public java.lang.String getStartAnchor(java.lang.String annotationId)
throws AGException
annotationId, - the specified annotation.
AGException - if the annotationId does not exist in this AGSet.
public java.lang.String getEndAnchor(java.lang.String annotationId)
throws AGException
annotationId, - the specified annotation.
AGException - if the annotationId does not exist in this AGSet.
public float getStartOffset(java.lang.String annotationId)
throws AGException
annotationId, - the specified annotation.
AGException - if the annotationId does not exist in this AGSet.
public float getEndOffset(java.lang.String annotationId)
throws AGException
annotationId, - the specified annotation.
AGException - if the annotationId does not exist in this AGSet.
public void printAnnotationSetInfo(java.lang.String agId)
throws AGException
AGException
public void setFeature(java.lang.String id,
java.lang.String featureName,
java.lang.String featureValue)
throws AGException
id - could be AGId or AnnotationId.featureName, - the name of the feature.featureValue, - the value of the feature.
AGException - if the id does not refer to an object in this AGSet.
public void setFeatures(java.lang.String id,
java.lang.String features)
throws AGException
id, - either an annotationid or agid.features, - the features to be added.
AGException - if the id does not refer to an object in this AGSet.
public void unsetFeature(java.lang.String id,
java.lang.String featureName)
throws AGException
id - could be AGId or AnnotationId.
AGExceptionAG.setFeature.
public void unsetFeatures(java.lang.String id)
throws AGException
id - could be AGId or AnnotationId.
AGExceptionMetadata.unsetFeatures.,
Annotation.unsetFeatures.
public void deleteFeature(java.lang.String id,
java.lang.String featureName)
throws AGException
id - could be AGId or AnnotationId.featureName, - the name of the feature.
AGExceptionindex.deleteFeauture.,
unsetFeature.
public boolean existsFeature(java.lang.String id,
java.lang.String featureName)
throws AGException
timelineId, - the id of the Timeline.
AGException
public java.lang.String getFeature(java.lang.String id,
java.lang.String featureName)
throws AGException
id - could be AGId or AnnotationId.
AGException - if either the id is invalid or the object
does not contain the feature.
public java.util.Set getFeatures(java.lang.String id)
throws AGException
id, - could be the id of an annotation or metadata.
AGException - if the id does not refer to an object in this AGSet.
public java.util.Set getFeatureNames(java.lang.String id)
throws AGException
id, - could be AGId or AnnotationId.
AGException, - if the id does not refer to an object in this AG.
AGException
public java.lang.String createAnchor(java.lang.String id,
float offset,
java.lang.String unit,
java.lang.String signalIds)
throws AGException
id, - might be AGId or AnchorId.
AGException - IF (the id given is invalid)
public java.lang.String createAnchor(java.lang.String id,
java.lang.String unit,
java.lang.String signalIds)
throws AGException
id - might be AGId or AnchorId.
AGException - IF (the id given is invalid)public boolean existsAnchor(java.lang.String anchorId)
anchorId, - the id of the anchor.
public void deleteAnchor(java.lang.String anchorId)
throws AGException
a, - the anchor to be deleted.
AGException - if the anchor does not exist in the AG.AnnotationIndex.deleteAnchor.
public void setAnchorOffset(java.lang.String anchorId,
float offset)
throws AGException
a, - the id of the specified anchor.o, - the new offset for the specified anchor.
AGException, - if the anchor does not exist in the AG.
AGExceptionAnnotationIndex.changeOffsetMaps.
public float getAnchorOffset(java.lang.String anchorId)
throws AGException
anchorId, - the id of the specified anchor.
AGException - if the anchor does not exist in
namespace of its id.
public void setOffsetUnit(java.lang.String anchorId,
java.lang.String unit)
throws AGException
anchorId, - the id of the specified anchor.unit, - the new unit.
AGException - if the anchor does not exist in
namespace of its id.
public java.lang.String getOffsetUnit(java.lang.String anchorId)
throws AGException
anchorId, - the id of the specified anchor.
AGException - if the anchor does not exist in
namespace of its id.
public void setAnchorSignalIds(java.lang.String anchorId,
java.lang.String signalIds)
throws AGException
anchorId, - the id of the specified anchor.signalIds, - the new signalIds for the specified anchor.
AGException - if the anchor does not exist in
namespace of its id.
public java.lang.String getAnchorSignalIds(java.lang.String anchorId)
throws AGException
anchorId, - the id of the specified anchor.
AGException - if the anchor does not exist in
namespace of its id.
public void unsetAnchorOffset(java.lang.String anchorId)
throws AGException
a, - the specified anchor.
AGException, - if the anchor does not exist in the AG.
AGExceptionAG.unsetAnchorOffset,
AnnotationIndex.changeOffsetMaps.
public java.lang.String splitAnchor(java.lang.String anchorId)
throws AGException
a1, - the id of the anchor to be split.
AGException, - if the anchor does not exist in this AG.
AGException
public java.util.Set getIncomingAnnotationSet(java.lang.String anchorId)
throws AGException
a, - the id of the specified anchor.
AGExceptionAnnotationIndex.getIncomingAnnotations.
public java.util.Set getOutgoingAnnotationSet(java.lang.String anchorId)
throws AGException
a, - the id of the specified anchor.
AGExceptionAnnotationIndex.getOutgoingAnnotations.
public void printAnchorSetInfo(java.lang.String agId)
throws AGException
AGException
public java.util.Set getAnchorSet(java.lang.String agId)
throws AGException
agId, - the id of the specified AG.
AGException
public java.util.Set getAnchorSetByOffset(java.lang.String agId,
float offset,
float epsilon)
throws AGException
offset, - the center offset.epsilon, - the range.
AGException
public java.util.Set getAnchorSetNearestOffset(java.lang.String agId,
float offset)
throws AGException
agId, - the id of the specified AG.offset, - the center offset.
AGException
public java.util.Set getAnnotationSetByFeature(java.lang.String agId,
java.lang.String featureName)
throws AGException
agId, - the id of the specified AG.feature, - the specified feature name.
AGException
public java.util.Set getAnnotationSetByOffset(java.lang.String agId,
float offset)
throws AGException
agId, - the id of the specified AG.o, - the specified offset.
AGExceptionAnnotationIndex.getAnnotationSetByOffset.
public java.util.Set getAnnotationSetByType(java.lang.String agId,
java.lang.String annotationType)
throws AGException
agId, - the specified AG.type, - the specified type.
AGException
public java.util.Set getAnnotationSeqByOffset(java.lang.String agId,
float begin,
float end)
throws AGException
begin, - the lower bound.end, - the upper bound.
AGException
public java.lang.String getAnnotationByOffset(java.lang.String agId,
float offset)
throws AGException
agId, - the specified AG.offset, - the specified offset.
AGExceptionAnnotationIndex.getAnnotationByOffset.
public java.lang.String getAGId(java.lang.String id)
throws AGException
id, - may be AnnotationId or AnchorId.
AGException
public java.lang.String getTimelineId(java.lang.String id)
throws AGException
id, - may be AGId or SignalId.
AGExceptionpublic java.lang.String toString()
toString in class java.util.AbstractCollection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||