Class ITSItems

    • Constructor Detail

      • ITSItems

        public ITSItems()
        Creates an empty ITSItems object.
      • ITSItems

        public ITSItems​(ITSItems original)
        Copy constructor.
        Parameters:
        original - the original object to duplicate.
    • Method Detail

      • add

        public void add​(IITSItem item)
        Adds (or sets) a new ITS data category instance in this collection.
        • If the data category is always single instance (like MT Confidence) this method replaces any existing instance by the new one.
        • If the data category allows for multiple instances (i.e. Provenance or Localization Quality Issue), this methods add the new instance. If an instance is already present, the existing instance is moved to a group and the new one is added to the group.
        Parameters:
        item - the new item to set.
      • isEmpty

        public boolean isEmpty()
        Indicates if there is at least one entry in this collection.
        Returns:
        true if there is at least one entry in this collection, false otherwise.
      • clear

        public void clear()
        Removes all entries in this collection.
      • remove

        public void remove​(IITSItem item)
        Removes a given item from this collection. If the item is not found, nothing is done. For Provenance and Localization Quality Issue the item can be a group or an instance.
        Parameters:
        item - the item to remove.
      • size

        public int size()
        Gets the number of distinct data categories in this collection. Only one entry is counted for LocQualityIssue and Provenance, even if there are several.
        Returns:
        the number of distinct data categories in this collection.
      • get

        public IITSItem get​(String dcName)
        Gets the item for a given data category name. This method calls get(Class) after mapping the name to the class.
        Parameters:
        dcName - the name of the data category (as used in its:annotatorsRef).
        Returns:
        Same as for get(Class).
        Throws:
        InvalidParameterException - if the name is not valid.
      • get

        public <A extends DataCategoryIITSItem get​(Class<A> dcType)
        Gets the item for a given type of data category.
        Type Parameters:
        A - the type of data category.
        Parameters:
        dcType - the data category type.
        Returns:
        the item for the given type of data category, or null if there is none. The item returned is a group if there are several instances for the given data category (i.e. for multiple Provenance or Localization Quality Issue). That is: you may get a Provenances or a LocQualityIssues object when you query for the classes Provenance or LocQualityIssue.