org.cip4.jdflib.pool
Class JDFAmountPool.AmountPoolHelper

java.lang.Object
  extended by org.cip4.jdflib.pool.JDFAmountPool.AmountPoolHelper
Enclosing class:
JDFAmountPool

public static class JDFAmountPool.AmountPoolHelper
extends Object

Author:
Rainer Prosi, Heidelberger Druckmaschinen static helper class that can be delegated from AmountPool containg classes, e.g. ResourceLink

Constructor Summary
JDFAmountPool.AmountPoolHelper()
           
 
Method Summary
static double getAmount(IAmountPoolContainer poolParent, JDFAttributeMap mPart)
          get double attribute Amount, defaults to the value of Amount for the linked partition
static JDFAmountPool.AmountMap getAmountMap(IAmountPoolContainer poolParent, VString vPartIDKeys)
          get an amountmap for the Amountpool of poolParent
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
static String getAmountPoolAttribute(IAmountPoolContainer poolParent, String attrib, String nameSpaceURI, VJDFAttributeMap vPart)
          returns the attribute occurrence in PartAmount, or the default in the ResourceLink
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
static double getAmountPoolDouble(IAmountPoolContainer poolParent, String attName, VJDFAttributeMap vPart)
          get the exactly matching AmountPool/PartAmount/@AttName as a double
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.
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
static double getMaxAmount(IAmountPoolContainer poolParent, JDFAttributeMap mPart)
          get double attribute MaxAmount, defaults to getAmount if MinAmount is not set
static double getMinAmount(IAmountPoolContainer poolParent, JDFAttributeMap mPart)
          get double attribute MinAmount, defaults to getAmount if MinAmount is not set
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
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDFAmountPool.AmountPoolHelper

public JDFAmountPool.AmountPoolHelper()
Method Detail

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 parent
attrib - the attribute name
nameSpaceURI - the XML-namespace
mPart - 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 on
attrib - the attribute name
nameSpaceURI - the XML-namespace
vPart - 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, ActualAmount
mPart -
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, ActualAmount
mPart -
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 on
attName -
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 parent
vPartIDKeys -
Returns:
the AmountMap for the Amountpool, null if no amountpool exists

getAmount

public static double getAmount(IAmountPoolContainer poolParent,
                               JDFAttributeMap mPart)
get double attribute Amount, defaults to the value of Amount for the linked partition

Parameters:
poolParent - the parent pool to work on
mPart - partition map to retrieve Amount for
Returns:
the amount, -1 if none is specified

getMinAmount

public static double getMinAmount(IAmountPoolContainer poolParent,
                                  JDFAttributeMap mPart)
get double attribute MinAmount, defaults to getAmount if MinAmount is not set

Parameters:
poolParent - the parent pool to work on
mPart - partition map to retrieve MinAmount for
Returns:
the MinAmount value

getMaxAmount

public static double getMaxAmount(IAmountPoolContainer poolParent,
                                  JDFAttributeMap mPart)
get double attribute MaxAmount, defaults to getAmount if MinAmount is not set

Parameters:
poolParent - the parent pool to work on
mPart - 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 on
attrib - the attribute name
value - value to set in string form.
nameSpaceURI - the XML-namespace
vPart - 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 on
attrib - the attribute name
value - value to set in string form.
nameSpaceURI - the XML-namespace
mPart - 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


Copyright © 2013. All Rights Reserved.