com.silverpeas.pdc.model
Class PdcPosition

java.lang.Object
  extended by com.silverpeas.pdc.model.PdcPosition
All Implemented Interfaces:
Serializable, Cloneable

@Entity
public class PdcPosition
extends Object
implements Serializable, Cloneable

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 Summary
  PdcPosition()
           
protected PdcPosition(long id)
           
 
Method Summary
protected  PdcPosition clone()
           
 boolean equals(Object obj)
           
 String getId()
           
 Set<PdcAxisValue> getValues()
          Gets the values of this position on the axis of the PdC.
 Set<PdcAxisValue> getValuesOfAxis(String axisId)
          Gets the values of the specified axis that are present in this position.
 int hashCode()
           
 boolean isEmpty()
          Is this position on the PdC empty?
 ClassifyPosition toClassifyPosition()
          Converts this position to a ClassifyPosition instance.
 String toString()
           
 PdcPosition withId(String id)
          Sets the specified identifier to this position.
 PdcPosition withValue(PdcAxisValue value)
          Adds the specified value for this position.
 PdcPosition withValues(Collection<PdcAxisValue> values)
          Adds the specified collection of values for this position.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.

clone

protected PdcPosition clone()
Overrides:
clone in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString 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.


Copyright © 2016 Silverpeas. All Rights Reserved.