Package org.cip4.jdflib.pool
Class JDFAmountPool.AmountPoolHelper
java.lang.Object
org.cip4.jdflib.pool.JDFAmountPool.AmountPoolHelper
- Enclosing class:
- JDFAmountPool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublegetAmount(IAmountPoolContainer poolParent, JDFAttributeMap mPart) get double attribute Amount, defaults to the value of Amount for the linked partitionstatic JDFAmountPool.AmountMapgetAmountMap(IAmountPoolContainer poolParent, VString vPartIDKeys) get an amountmap for the Amountpool of poolParentstatic StringgetAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String nameSpaceURI, JDFAttributeMap mPart, int iSkip) returns the attribute occurrence in PartAmount, or the default in the ResourceLinkstatic StringgetAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String nameSpaceURI, VJDFAttributeMap vPart) returns the attribute occurrence in PartAmount, or the default in the ResourceLinkstatic doublegetAmountPoolDouble(IAmountPoolContainer poolParent, String attName, JDFAttributeMap mPart) get the sum of all matching AmountPool/PartAmount/@attName as a double PartAmounts match if all attributes match those in PartAmount, i.e.static doublegetAmountPoolDouble(IAmountPoolContainer poolParent, String attName, VJDFAttributeMap vPart) get the exactly matching AmountPool/PartAmount/@AttName as a doublestatic doublegetAmountPoolMinDouble(IAmountPoolContainer poolParent, String attName, JDFAttributeMap mPart) get the minimum value of all matching AmountPool/PartAmount/@attName as a double PartAmounts match if all attributes match those in PartAmount, i.e.static doublegetAmountPoolSumDouble(IAmountPoolContainer poolParent, String attName, VJDFAttributeMap vPart) gets the sum of all matching tags, with the assumption that no condition defaults to goodstatic doublegetMaxAmount(IAmountPoolContainer poolParent, JDFAttributeMap mPart) get double attribute MaxAmount, defaults to getAmount if MinAmount is not setstatic doublegetMinAmount(IAmountPoolContainer poolParent, JDFAttributeMap mPart) get double attribute MinAmount, defaults to getAmount if MinAmount is not setstatic voidsetAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String value, String nameSpaceURI, JDFAttributeMap mPart) sets the attribute occurence in the appropriate PartAmount when called for a resourceLink and creates the AmountPool and/or PartAmount if it is not yet therestatic voidsetAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String value, String nameSpaceURI, VJDFAttributeMap vPart) sets the attribute occurence in the appropriate PartAmount when called for a resourceLink and creates the AmountPool and/or PartAmount(s) if they are not yet there
-
Constructor Details
-
AmountPoolHelper
public AmountPoolHelper()
-
-
Method Details
-
getAmountPoolAttribute
public static String getAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String nameSpaceURI, JDFAttributeMap mPart, int iSkip) returns the attribute occurrence in PartAmount, or the default in the ResourceLink- Parameters:
poolParent- the pool parentattrib- the attribute namenameSpaceURI- the XML-namespacemPart- defines which part of this ResourceLink the Amount belongs to. If empty get the ResourceLink root attribute.iSkip- the index of the partAmount to check- Returns:
- value of attribute found, null if not available
- Since:
- 071103
-
getAmountPoolAttribute
public static String getAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String nameSpaceURI, VJDFAttributeMap vPart) returns the attribute occurrence in PartAmount, or the default in the ResourceLink- Parameters:
poolParent- the parent pool to work onattrib- the attribute namenameSpaceURI- the XML-namespacevPart- defines which part of this ResourceLink the Amount belongs to. If null get the ResourceLink root attribute.- Returns:
- value of attribute found, null if not available
- Since:
- 071103
-
getAmountPoolMinDouble
public static double getAmountPoolMinDouble(IAmountPoolContainer poolParent, String attName, JDFAttributeMap mPart) get the minimum value of all matching AmountPool/PartAmount/@attName as a double PartAmounts match if all attributes match those in PartAmount, i.e. mPart is a submap of the searched PartAmount elements- Parameters:
poolParent-attName- the Attribute name , e.g Amount, ActualAmountmPart-- Returns:
- double - the element
- Throws:
JDFException- if the element can not be cast to double
-
getAmountPoolDouble
public static double getAmountPoolDouble(IAmountPoolContainer poolParent, String attName, JDFAttributeMap mPart) get the sum of all matching AmountPool/PartAmount/@attName as a double PartAmounts match if all attributes match those in PartAmount, i.e. mPart is a submap of the searched PartAmount elements- Parameters:
poolParent-attName- the Attribute name , e.g Amount, ActualAmountmPart-- Returns:
- double - the element
- Throws:
JDFException- if the element can not be cast to double
-
getAmountPoolDouble
public static double getAmountPoolDouble(IAmountPoolContainer poolParent, String attName, VJDFAttributeMap vPart) get the exactly matching AmountPool/PartAmount/@AttName as a double- Parameters:
poolParent- the parent pool to work onattName-vPart-- Returns:
- double -
- Throws:
JDFException- if the element can not be cast to double
-
getAmountPoolSumDouble
public static double getAmountPoolSumDouble(IAmountPoolContainer poolParent, String attName, VJDFAttributeMap vPart) gets the sum of all matching tags, with the assumption that no condition defaults to good- Parameters:
poolParent-attName-vPart-- Returns:
- the sum
-
getAmountMap
public static JDFAmountPool.AmountMap getAmountMap(IAmountPoolContainer poolParent, VString vPartIDKeys) get an amountmap for the Amountpool of poolParent- Parameters:
poolParent- the pool parentvPartIDKeys-- Returns:
- the AmountMap for the Amountpool, null if no amountpool exists
-
getAmount
get double attribute Amount, defaults to the value of Amount for the linked partition- Parameters:
poolParent- the parent pool to work onmPart- partition map to retrieve Amount for- Returns:
- the amount, -1 if none is specified
-
getMinAmount
get double attribute MinAmount, defaults to getAmount if MinAmount is not set- Parameters:
poolParent- the parent pool to work onmPart- partition map to retrieve MinAmount for- Returns:
- the MinAmount value
-
getMaxAmount
get double attribute MaxAmount, defaults to getAmount if MinAmount is not set- Parameters:
poolParent- the parent pool to work onmPart- partition map to retrieve MinAmount for- Returns:
- the MinAmount value
-
setAmountPoolAttribute
public static void setAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String value, String nameSpaceURI, VJDFAttributeMap vPart) sets the attribute occurence in the appropriate PartAmount when called for a resourceLink and creates the AmountPool and/or PartAmount(s) if they are not yet there- Parameters:
poolParent- the parent pool to work onattrib- the attribute namevalue- value to set in string form.nameSpaceURI- the XML-namespacevPart- defines which part of this ResourceLink the Amount belongs to, if empty set the ResourceLink root attribute.- Throws:
JDFException- when called directly on a PartAmount- Since:
- 060630
-
setAmountPoolAttribute
public static void setAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String value, String nameSpaceURI, JDFAttributeMap mPart) sets the attribute occurence in the appropriate PartAmount when called for a resourceLink and creates the AmountPool and/or PartAmount if it is not yet there- Parameters:
poolParent- the parent pool to work onattrib- the attribute namevalue- value to set in string form.nameSpaceURI- the XML-namespacemPart- defines which part of this ResourceLink the Amount belongs to, if empty set the ResourceLink root attribute- Throws:
JDFException- when called directly on a PartAmount- Since:
- 071103
-