com.silverpeas.pdc.web
Class PdcAxisValueEntity

java.lang.Object
  extended by com.silverpeas.pdc.web.PdcValueEntity
      extended by com.silverpeas.pdc.web.PdcAxisValueEntity
All Implemented Interfaces:
Serializable

public class PdcAxisValueEntity
extends PdcValueEntity

A value of a PdC's axis. A value of an axis is a term in the vocabulary of the concept represented by the axis, and it is related to the base value of the axis; It can be either a parent or a child of the axis base value. As the axis is a tree, its values can be refined by its branches. As such, the value can also be a part of an axis branch whose its level attribute indicates its position in the tree from the root.

See Also:
Serialized Form

Constructor Summary
protected PdcAxisValueEntity()
           
 
Method Summary
 boolean equals(Object obj)
           
static PdcAxisValueEntity fromValue(Value value, String inLanguage)
          Creates a new value of a PdC axis from the specified business PdC value and expressed in the specified language.
 int getClassifiedContentsCount()
          Gets the count of contents that are classified with this value.
 int getLevel()
          Gets the position level of this value in the semantic tree or 0. 0 means its level is at the axis.
 String getTerm()
          Gets the translated term represented by this value.
 int hashCode()
           
 boolean isAscendant()
          Is this value is ascendant from the axis origin ?
 boolean isOrigin()
          Is this value the origin of the axis?
 boolean isRootValue()
          Is this value is the root one of the axis?
protected  void setAsAscendant()
          Sets this axis value as ascendant to the axis origin value.
protected  void setAsOriginValue()
          Sets this axis value as the origin of the axis.
 String toString()
           
 
Methods inherited from class com.silverpeas.pdc.web.PdcValueEntity
belongToATree, getAxisId, getId, getSynonyms, getTermId, getTreeId, setSynonyms, setTreeId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PdcAxisValueEntity

protected PdcAxisValueEntity()
Method Detail

fromValue

public static PdcAxisValueEntity fromValue(Value value,
                                           String inLanguage)
Creates a new value of a PdC axis from the specified business PdC value and expressed in the specified language.

Parameters:
value - the business PdC value.
inLanguage - the language of the user.
Returns:
a PdcAxisValue instance.

getTerm

public String getTerm()
Gets the translated term represented by this value.

Returns:
the term translated into the user language.

getLevel

public int getLevel()
Gets the position level of this value in the semantic tree or 0. 0 means its level is at the axis.

Returns:
the position level or 0 if it doesn't belong to a tree.

isAscendant

public boolean isAscendant()
Is this value is ascendant from the axis origin ? When a PdC is parameterized for a given Silverpeas component instance, the origin of each axis can be refined. As such, values between the default and the new axis origin become ascendant to the latter.

Returns:
true if this value is ascendant to the configured axis origin.

getClassifiedContentsCount

public int getClassifiedContentsCount()
Gets the count of contents that are classified with this value.

Returns:
the count of contents classified with this value.

isRootValue

public boolean isRootValue()
Is this value is the root one of the axis? A value is the root of an axis when its identifier is equal to /0/ where 0 is the node identifier of the root in an axis.

Returns:
true if this value is a root one, false otherwise.

isOrigin

public boolean isOrigin()
Is this value the origin of the axis?

Returns:
true if this axis value is the origin of the axis, false otherwise.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class PdcValueEntity

toString

public String toString()
Overrides:
toString in class Object

setAsOriginValue

protected void setAsOriginValue()
Sets this axis value as the origin of the axis.


setAsAscendant

protected void setAsAscendant()
Sets this axis value as ascendant to the axis origin value.



Copyright © 2016 Silverpeas. All Rights Reserved.