Package de.wwu.scdh.annotation.selection
Interface Point
- All Known Implementing Classes:
PointImpl,RFC5147CharScheme,XPathRefinedByRFC5147CharScheme
public interface Point
A
Point is an abstract reference to a resource which offers
parts selectable according some selection specification, for
example the Web Annotation Data Model (WADM) or
XPointers. Regarding the WADM, a Point is a record for the
values of a selector. The type can either be inferred by the kind
of components or the class implementing this interface.
A point has one or multiple Components. E.g., an
oa:XPathSelector has a XPath component;
an oa:XPathSelector, which is refined by a
oa:FragmentSelector conforming RFC5147's character
scheme, has a XPath component and an
RFC5147CHAR component.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the components of the point as aSet.<T,C extends Component<T>>
TgetComponent(Class<C> component) Returns the value of the requested component in a type-safe manner.<C extends Component<?>>
booleanhasComponent(Class<C> component) A predicate, that returns True if and only if the point has the component of the given type.intsize()Returns the number of components.
-
Method Details
-
hasComponent
A predicate, that returns True if and only if the point has the component of the given type.- Parameters:
component- the component asClass
-
size
int size()Returns the number of components. -
dimensions
Returns the components of the point as aSet. -
getComponent
Returns the value of the requested component in a type-safe manner. If the component is not present or if the value does not match the components type, aNoSuchComponentExceptionis thrown.- Parameters:
component- the requested component asClass- Returns:
- the value of the component in its type T
- Throws:
NoSuchComponentException
-