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 Type
    Method
    Description
    <C extends Component<?>>
    Set<Class<C>>
    Returns the components of the point as a Set.
    <T, C extends Component<T>>
    T
    getComponent(Class<C> component)
    Returns the value of the requested component in a type-safe manner.
    <C extends Component<?>>
    boolean
    hasComponent(Class<C> component)
    A predicate, that returns True if and only if the point has the component of the given type.
    int
    Returns the number of components.
  • Method Details

    • hasComponent

      <C extends Component<?>> boolean hasComponent(Class<C> component)
      A predicate, that returns True if and only if the point has the component of the given type.
      Parameters:
      component - the component as Class
    • size

      int size()
      Returns the number of components.
    • dimensions

      <C extends Component<?>> Set<Class<C>> dimensions()
      Returns the components of the point as a Set.
    • getComponent

      <T, C extends Component<T>> T getComponent(Class<C> component) throws NoSuchComponentException
      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, a NoSuchComponentException is thrown.
      Parameters:
      component - the requested component as Class
      Returns:
      the value of the component in its type T
      Throws:
      NoSuchComponentException