Class PdcPosition

  • All Implemented Interfaces:
    Serializable

    @Entity
    public class PdcPosition
    extends Object
    implements Serializable
    A position of a content on some axis of the classification plan (named PdC). The positions of a given content define its classification on the PdC. A position on the PdC's axis represents an atomic semantic information about its content. As such, it can be made up of one or more values of axis. As a PdC axis is defined by an hierarchic tree of terms, each of them being a value in the concept represented by the axis, a value in a position is defined by its path in the tree from the root; the root being one of the base value of the axis. For example, for a position on the axis representing the concept of geography, a possible value can be "France / Rhônes-Alpes / Isère / Grenoble" where Grenoble is the last term of the axis valuation.
    See Also:
    Serialized Form
    • Constructor Detail

      • PdcPosition

        public PdcPosition()
      • PdcPosition

        protected PdcPosition​(long id)
    • Method Detail

      • getId

        public String getId()
      • withId

        public PdcPosition withId​(String id)
        Sets the specified identifier to this position. If the identifier is null or empty, no identifier is set.
        Parameters:
        id - the unique identifier of the position.
        Returns:
        itself.
      • isEmpty

        public boolean isEmpty()
        Is this position on the PdC empty?
        Returns:
        true if this positions has no valuation in at least one of the PdC'axis, false otherwise.
      • getValues

        public Set<PdcAxisValue> getValues()
        Gets the values of this position on the axis of the PdC. You can add or remove any values from the returned set.
        Returns:
        a set of PdC axis values.
      • withValue

        public PdcPosition withValue​(PdcAxisValue value)
        Adds the specified value for this position.
        Parameters:
        value - the value to add.
        Returns:
        itself.
      • withValues

        public PdcPosition withValues​(Collection<PdcAxisValue> values)
        Adds the specified collection of values for this position.
        Parameters:
        values - the collection of values to add.
        Returns:
        itself.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toClassifyPosition

        public ClassifyPosition toClassifyPosition()
                                            throws PdcException
        Converts this position to a ClassifyPosition instance. This method is for compatibility with the old way to manage the classification.
        Returns:
        a ClassifyPosition instance.
        Throws:
        PdcException - if an error occurs while transforming this position.
      • getValuesOfAxis

        public Set<PdcAxisValue> getValuesOfAxis​(String axisId)
        Gets the values of the specified axis that are present in this position.
        Parameters:
        axisId - the unique identifier of the axis.
        Returns:
        a set of values of the specified axis in this position.