Package org.cip4.jdflib.extensions
Class SetHelper
java.lang.Object
org.cip4.jdflib.extensions.BaseXJDFHelper
org.cip4.jdflib.extensions.SetHelper
- All Implemented Interfaces:
IMatches
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
log, theElement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTypeToCPI(int pos) voidaddTypeToCPI(int pos, boolean insert) add a CPI processappendPartition(String partKey, String partValue, boolean addRes) convenience ...appendPartition(JDFAttributeMap partMap, boolean addRes) appendResource(String partKey, String partValue, boolean addRes) convenience ...appendResource(JDFAttributeMap partMap, boolean addRes) appendResource(VJDFAttributeMap partMaps, boolean addRes) static SetHelperappendSet(KElement parent, String name, JDFResourceLink.EnumUsage usage) voidcleanUp()generic cleanup routinevoidensureReference(KElement src, String key) ensure a reference *FROM* srcdoublegetAmountSum(boolean bGood) getCreateExactPartition(JDFAttributeMap map, boolean addRes) get an existing partition with at least a matching partmapgetCreatePartition(int index, boolean addRes) getCreatePartition(String partKey, String partValue, boolean addRes) convenience ...getCreatePartition(JDFAttributeMap map, boolean addRes) getCreatePartitions(VJDFAttributeMap vmap, boolean addRes) creates 1 partition for each entry in the mapgetCreateResource(int index, boolean addRes) getCreateResource(JDFAttributeMap map, boolean addRes) static SetHelpergetCreateSet(KElement parent, String name, JDFResourceLink.EnumUsage usage) static SetHelpergetCreateSet(KElement parent, String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) getCreateVPartition(VJDFAttributeMap vmap, boolean addRes) get an existing partition with at least a matching partmapstatic SetHelperfactory to create a helper from an elementgetName()getPartition(int index) getPartition(String id) get a partition by idgetPartition(String key, String value) getPartition(VJDFAttributeMap vmap) returns the unified partmapsreturns the unified partmapsgetResource(int index) getResource(String key, String value) static StringgetSet()static SetHelpergetSet(KElement parent, String name, JDFResourceLink.EnumUsage usage) static SetHelpergetSet(KElement parent, String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) static StringgetSetName(String setName) static Stringreturns all partitions that are a superset of mapgetUnit()getUsage()getXJDF()intindexOf(ResourceHelper bsHelper) insertPartitionBefore(ResourceHelper e, JDFAttributeMap map, boolean addRes) booleanisEmpty()static booleanis the element name a set?static booleanis the element a set?booleanreturns true if subset somehow matches this the semantics are defined by the filtering algorithm, thus it could be a filter or a subset i.e.voidvoidremove all partitions in this setvoidremoveTypeFromCPI(int pos) remove a CPI processvoidvoidsetDescriptiveName(String description) voidsetExternalID(String newID) setGeneralID(String idUsage, String idValue) voidvoidvoidsetProcessUsage(String processUsage) voidsetUnit(JDFElement.eUnit unit) voidintsize()the number of partitions (resource elements)toString()Methods inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
appendElement, appendElement, copyHelper, deleteNode, ensureID, equals, getAttribute, getAttributeMap, getBaseHelper, getBaseHelper, getComment, getCreateElement, getDefaultVersion, getGeneralID, getID, getLocalName, getRoot, getRootDoc, getVersion, getXJDFRoot, getXJMFRoot, getXPathElement, getXPathValue, getXRoot, hasAttribute, hashCode, isEqual, removeAttribute, setAttribute, setAttribute, setComment, setDefaultVersion, setXPathValue
-
Field Details
-
SET
- See Also:
-
PARAMETER_SET
-
RESOURCE_SET
- See Also:
-
-
Constructor Details
-
SetHelper
- Parameters:
set- the set to help on
-
-
Method Details
-
getAmountSum
public double getAmountSum(boolean bGood) - Parameters:
bGood- good=true- Returns:
-
ensureReference
ensure a reference *FROM* src- Parameters:
src-key- the reference key in src
-
isSet
is the element a set?- Parameters:
e-- Returns:
-
isSet
is the element name a set?- Parameters:
localName-- Returns:
-
getPartition
- Parameters:
map-- Returns:
-
getResource
- Parameters:
map-- Returns:
-
getPartition
- Parameters:
map-- Returns:
-
getResource
- Parameters:
map-- Returns:
-
getPartition
- Parameters:
index-- Returns:
-
getResource
- Parameters:
index-- Returns:
-
getCreatePartition
- Parameters:
map-addRes-- Returns:
-
getCreateResource
- Parameters:
map-addRes-- Returns:
-
getCreateVPartition
get an existing partition with at least a matching partmap- Parameters:
vmap-addRes-- Returns:
-
getCreateExactPartition
get an existing partition with at least a matching partmap- Parameters:
vmap-addRes-- Returns:
-
getExactPartition
- Parameters:
map-- Returns:
-
insertPartitionBefore
- Parameters:
e-map-addRes-- Returns:
-
getCreatePartitions
creates 1 partition for each entry in the map- Parameters:
vmap-addRes-- Returns:
-
getCreatePartition
- Parameters:
index-addRes-- Returns:
-
getCreateResource
-
getCreateResource
- Parameters:
index-addRes-- Returns:
-
removePartitions
public void removePartitions()remove all partitions in this set -
appendResource
convenience ... @seeappendPartition(JDFAttributeMap, boolean)- Parameters:
partKey-partValue-addRes-- Returns:
-
appendPartition
convenience ... @seeappendPartition(JDFAttributeMap, boolean)- Parameters:
partKey-partValue-addRes-- Returns:
-
getCreatePartition
convenience ... @seegetCreatePartition(JDFAttributeMap, boolean)- Parameters:
partKey-partValue-addRes-- Returns:
-
appendResource
- Parameters:
partMap-addRes- if true, also add the detailed resource element, e.g. Layout- Returns:
-
appendPartition
- Parameters:
partMap-addRes- if true, also add the detailed resource element, e.g. Layout- Returns:
-
appendResource
- Parameters:
partMap-addRes- if true, also add the detailed resource element, e.g. Layout- Returns:
-
getXJDF
- Returns:
-
getPartitions
- Returns:
- the vector of partition helpers
-
getPartitionList
- Returns:
- the list of partition helpers - never null
-
getResourceList
- Returns:
- the list of partition helpers - never null
-
cleanUp
public void cleanUp()Description copied from class:BaseXJDFHelpergeneric cleanup routine- Overrides:
cleanUpin classBaseXJDFHelper
-
getName
- Returns:
- the name of the resource set also fixes it in case it needs to be calculated from kids
-
getPartitionName
- Returns:
-
getSetName
- Parameters:
e- the element to test- Returns:
- the asset type name (Parameter, Resource etc)
-
getResourceName
- Parameters:
e- the element to test- Returns:
- then resourceset @Name (RunList, Layout etc)
-
getSetName
- Parameters:
setName- the name of the set element- Returns:
- then asset type name (Parameter, Resource etc)
-
getSet
public static SetHelper getSet(KElement parent, String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) - Parameters:
name-usage-processUsage-- Returns:
- the SetHelper for the vector of resourcesets
-
getSet
- Parameters:
name-usage-- Returns:
- the SetHelper for the vector of resourcesets
-
getCreateSet
- Parameters:
name-usage-- Returns:
- a new set element
-
getCreateSet
public static SetHelper getCreateSet(KElement parent, String name, JDFResourceLink.EnumUsage usage, String processUsage, JDFIntegerList cpi) - Parameters:
name-usage-processUsage-- Returns:
- the SetHelper
-
appendSet
- Parameters:
family- - always RESOURCE better use appendResourceSetname-usage-- Returns:
- a new set element
-
getPartition
- Parameters:
vmap-- Returns:
-
getPartitions
- Parameters:
vmap-- Returns:
-
getPartitions
- Parameters:
map-- Returns:
-
getSuperPartitions
returns all partitions that are a superset of map- Parameters:
map-- Returns:
-
getSet
- Returns:
-
setUsage
- Parameters:
value-
-
getUsage
- Returns:
-
getProcessUsage
- Returns:
-
getCombinedProcessIndex
- Returns:
-
removeTypeFromCPI
public void removeTypeFromCPI(int pos) remove a CPI process- Parameters:
typ-pos-
-
addTypeToCPI
public void addTypeToCPI(int pos) -
addTypeToCPI
public void addTypeToCPI(int pos, boolean insert) add a CPI process- Parameters:
typ-pos-
-
setCombinedProcessIndex
-
setProcessUsage
-
setUnit
-
getUnit
- Returns:
-
getDescriptiveName
- Overrides:
getDescriptiveNamein classBaseXJDFHelper- Returns:
-
getExternalID
- Overrides:
getExternalIDin classBaseXJDFHelper- Returns:
- the productID of the product
-
toString
- Overrides:
toStringin classBaseXJDFHelper- Returns:
- See Also:
-
getPartition
get a partition by id- Parameters:
id-- Returns:
-
getFamily
- Returns:
-
setID
- Overrides:
setIDin classBaseXJDFHelper- See Also:
-
getPartMapVector
returns the unified partmaps- Returns:
-
getPartMapList
returns the unified partmaps- Returns:
-
getPartMapVectors
- Returns:
- the ordered collection of PartMapVectors of each child resource
-
getPartMapLists
- Returns:
- the ordered collection of PartMapVectors of each child resource
-
getDependentJobParts
- Returns:
-
setName
- Parameters:
name-
-
removeIDs
public void removeIDs() -
indexOf
- Parameters:
bsHelper-- Returns:
-
getHelper
factory to create a helper from an element- Parameters:
root- the element to parse- Returns:
- the helper
-
setExternalID
- See Also:
-
BaseXJDFHelper.setExternalID(java.lang.String)
-
setDescriptiveName
- See Also:
-
BaseXJDFHelper.setDescriptiveName(java.lang.String)
-
setGeneralID
- See Also:
-
BaseXJDFHelper.setGeneralID(java.lang.String, java.lang.String)
-
matches
Description copied from interface:IMatchesreturns true if subset somehow matches this the semantics are defined by the filtering algorithm, thus it could be a filter or a subset i.e. subset contains either equivalent elements or null and no non-matching elements matches(null) always returns true -
size
public int size()the number of partitions (resource elements)- Returns:
-
isEmpty
public boolean isEmpty()
-