Class PointImpl

java.lang.Object
de.wwu.scdh.annotation.selection.point.PointImpl
All Implemented Interfaces:
Point
Direct Known Subclasses:
RFC5147CharScheme, XPathRefinedByRFC5147CharScheme

public class PointImpl extends Object implements Point
  • Constructor Details

    • PointImpl

      public PointImpl(Component<?>... components)
      Make a PointImpl from as many Components as you want. Note: When multiple components of the same type are given, only one is used.
      Parameters:
      components - an open number of components
  • Method Details

    • hasComponent

      public <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.
      Specified by:
      hasComponent in interface Point
      Parameters:
      component - the component as Class
    • size

      public int size()
      Returns the number of components.
      Specified by:
      size in interface Point
    • dimensions

      public <C extends Component<?>> Set<Class<C>> dimensions()
      Returns the components of the point as a Set.
      Specified by:
      dimensions in interface Point
    • getComponent

      public <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.
      Specified by:
      getComponent in interface Point
      Parameters:
      component - the requested component as Class
      Returns:
      the value of the component in its type T
      Throws:
      NoSuchComponentException