Package org.cip4.jdflib.extensions
Class SetHelper
- java.lang.Object
-
- org.cip4.jdflib.extensions.BaseXJDFHelper
-
- org.cip4.jdflib.extensions.SetHelper
-
- All Implemented Interfaces:
IMatches
public class SetHelper extends BaseXJDFHelper implements IMatches
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSetHelper.EnumFamily
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAMETER_SETstatic java.lang.StringRESOURCE_SETstatic java.lang.StringSET-
Fields inherited from class org.cip4.jdflib.extensions.BaseXJDFHelper
log, theElement
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTypeToCPI(int pos)add a CPI processResourceHelperappendPartition(java.lang.String partKey, java.lang.String partValue, boolean addRes)convenience ...ResourceHelperappendPartition(JDFAttributeMap partMap, boolean addRes)ResourceHelperappendResource(java.lang.String partKey, java.lang.String partValue, boolean addRes)convenience ...ResourceHelperappendResource(JDFAttributeMap partMap, boolean addRes)ResourceHelperappendResource(VJDFAttributeMap partMaps, boolean addRes)voidcleanUp()generic cleanup routinevoidensureReference(KElement src, java.lang.String key)ensure a reference *FROM* srcdoublegetAmountSum(boolean bGood)JDFIntegerListgetCombinedProcessIndex()ResourceHelpergetCreateExactPartition(JDFAttributeMap map, boolean addRes)get an existing partition with at least a matching partmapResourceHelpergetCreatePartition(int index, boolean addRes)ResourceHelpergetCreatePartition(java.lang.String partKey, java.lang.String partValue, boolean addRes)convenience ...ResourceHelpergetCreatePartition(JDFAttributeMap map, boolean addRes)java.util.Vector<ResourceHelper>getCreatePartitions(VJDFAttributeMap vmap, boolean addRes)creates 1 partition for each entry in the mapResourceHelpergetCreateResource()ResourceHelpergetCreateResource(int index, boolean addRes)ResourceHelpergetCreateResource(JDFAttributeMap map, boolean addRes)ResourceHelpergetCreateVPartition(VJDFAttributeMap vmap, boolean addRes)get an existing partition with at least a matching partmapVStringgetDependentJobParts()java.lang.StringgetDescriptiveName()ResourceHelpergetExactPartition(JDFAttributeMap map)java.lang.StringgetExternalID()SetHelper.EnumFamilygetFamily()static SetHelpergetHelper(KElement e)factory to create a helper from an elementjava.lang.StringgetName()ResourceHelpergetPartition(int index)ResourceHelpergetPartition(java.lang.String id)get a partition by idResourceHelpergetPartition(java.lang.String key, java.lang.String value)ResourceHelpergetPartition(JDFAttributeMap map)ResourceHelpergetPartition(VJDFAttributeMap vmap)java.util.List<ResourceHelper>getPartitionList()java.lang.StringgetPartitionName()java.util.Vector<ResourceHelper>getPartitions()java.util.Vector<ResourceHelper>getPartitions(JDFAttributeMap map)java.util.Vector<ResourceHelper>getPartitions(VJDFAttributeMap vmap)java.util.List<JDFAttributeMap>getPartMapList()returns the unified partmapsjava.util.Collection<java.util.List<JDFAttributeMap>>getPartMapLists()VJDFAttributeMapgetPartMapVector()returns the unified partmapsjava.util.Collection<VJDFAttributeMap>getPartMapVectors()java.lang.StringgetProcessUsage()ResourceHelpergetResource(int index)ResourceHelpergetResource(java.lang.String key, java.lang.String value)ResourceHelpergetResource(JDFAttributeMap map)java.util.List<ResourceHelper>getResourceList()KElementgetSet()static java.lang.StringgetSetName(java.lang.String setName)static java.lang.StringgetSetName(KElement e)java.util.Vector<ResourceHelper>getSuperPartitions(JDFAttributeMap map)returns all partitions that are a superset of mapJDFResourceLink.EnumUsagegetUsage()XJDFHelpergetXJDF()intindexOf(ResourceHelper bsHelper)ResourceHelperinsertPartitionBefore(ResourceHelper e, JDFAttributeMap map, boolean addRes)static booleanisSet(java.lang.String localName)is the element name a set?static booleanisSet(KElement e)is the element a set?booleanmatches(java.lang.Object subset)returns 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.voidremoveIDs()voidremovePartitions()remove all partitions in this setvoidremoveTypeFromCPI(int pos)remove a CPI processvoidsetCombinedProcessIndex(JDFIntegerList cpi)voidsetDescriptiveName(java.lang.String description)voidsetExternalID(java.lang.String newID)voidsetGeneralID(java.lang.String idUsage, java.lang.String idValue)voidsetID(java.lang.String newID)voidsetName(java.lang.String name)voidsetProcessUsage(java.lang.String processUsage)voidsetUsage(JDFResourceLink.EnumUsage value)intsize()the number of partitions (resource elements)java.lang.StringtoString()-
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, getXJDFRoot, getXPathElement, getXPathValue, getXRoot, hasAttribute, hashCode, isEqual, removeAttribute, setAttribute, setAttribute, setComment, setDefaultVersion, setXPathValue
-
-
-
-
Field Detail
-
SET
public static final java.lang.String SET
- See Also:
- Constant Field Values
-
PARAMETER_SET
public static final java.lang.String PARAMETER_SET
-
RESOURCE_SET
public static final java.lang.String RESOURCE_SET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SetHelper
public SetHelper(KElement set)
- Parameters:
set- the set to help on
-
-
Method Detail
-
getAmountSum
public double getAmountSum(boolean bGood)
- Parameters:
bGood- good=true- Returns:
-
ensureReference
public void ensureReference(KElement src, java.lang.String key)
ensure a reference *FROM* src- Parameters:
src-key- the reference key in src
-
isSet
public static boolean isSet(KElement e)
is the element a set?- Parameters:
e-- Returns:
-
isSet
public static boolean isSet(java.lang.String localName)
is the element name a set?- Parameters:
localName-- Returns:
-
getPartition
public ResourceHelper getPartition(JDFAttributeMap map)
- Parameters:
map-- Returns:
-
getResource
public ResourceHelper getResource(JDFAttributeMap map)
- Parameters:
map-- Returns:
-
getPartition
public ResourceHelper getPartition(java.lang.String key, java.lang.String value)
- Parameters:
map-- Returns:
-
getResource
public ResourceHelper getResource(java.lang.String key, java.lang.String value)
- Parameters:
map-- Returns:
-
getPartition
public ResourceHelper getPartition(int index)
- Parameters:
index-- Returns:
-
getResource
public ResourceHelper getResource(int index)
- Parameters:
index-- Returns:
-
getCreatePartition
public ResourceHelper getCreatePartition(JDFAttributeMap map, boolean addRes)
- Parameters:
map-addRes-- Returns:
-
getCreateResource
public ResourceHelper getCreateResource(JDFAttributeMap map, boolean addRes)
- Parameters:
map-addRes-- Returns:
-
getCreateVPartition
public ResourceHelper getCreateVPartition(VJDFAttributeMap vmap, boolean addRes)
get an existing partition with at least a matching partmap- Parameters:
vmap-addRes-- Returns:
-
getCreateExactPartition
public ResourceHelper getCreateExactPartition(JDFAttributeMap map, boolean addRes)
get an existing partition with at least a matching partmap- Parameters:
vmap-addRes-- Returns:
-
getExactPartition
public ResourceHelper getExactPartition(JDFAttributeMap map)
- Parameters:
map-- Returns:
-
insertPartitionBefore
public ResourceHelper insertPartitionBefore(ResourceHelper e, JDFAttributeMap map, boolean addRes)
- Parameters:
e-map-addRes-- Returns:
-
getCreatePartitions
public java.util.Vector<ResourceHelper> getCreatePartitions(VJDFAttributeMap vmap, boolean addRes)
creates 1 partition for each entry in the map- Parameters:
vmap-addRes-- Returns:
-
getCreatePartition
public ResourceHelper getCreatePartition(int index, boolean addRes)
- Parameters:
index-addRes-- Returns:
-
getCreateResource
public ResourceHelper getCreateResource()
-
getCreateResource
public ResourceHelper getCreateResource(int index, boolean addRes)
- Parameters:
index-addRes-- Returns:
-
removePartitions
public void removePartitions()
remove all partitions in this set
-
appendResource
public ResourceHelper appendResource(java.lang.String partKey, java.lang.String partValue, boolean addRes)
convenience ... @seeappendPartition(JDFAttributeMap, boolean)- Parameters:
partKey-partValue-addRes-- Returns:
-
appendPartition
public ResourceHelper appendPartition(java.lang.String partKey, java.lang.String partValue, boolean addRes)
convenience ... @seeappendPartition(JDFAttributeMap, boolean)- Parameters:
partKey-partValue-addRes-- Returns:
-
getCreatePartition
public ResourceHelper getCreatePartition(java.lang.String partKey, java.lang.String partValue, boolean addRes)
convenience ... @seegetCreatePartition(JDFAttributeMap, boolean)- Parameters:
partKey-partValue-addRes-- Returns:
-
appendResource
public ResourceHelper appendResource(JDFAttributeMap partMap, boolean addRes)
- Parameters:
partMap-addRes- if true, also add the detailed resource element, e.g. Layout- Returns:
-
appendPartition
public ResourceHelper appendPartition(JDFAttributeMap partMap, boolean addRes)
- Parameters:
partMap-addRes- if true, also add the detailed resource element, e.g. Layout- Returns:
-
appendResource
public ResourceHelper appendResource(VJDFAttributeMap partMaps, boolean addRes)
- Parameters:
partMap-addRes- if true, also add the detailed resource element, e.g. Layout- Returns:
-
getXJDF
public XJDFHelper getXJDF()
- Returns:
-
getPartitions
public java.util.Vector<ResourceHelper> getPartitions()
- Returns:
- the vector of partition helpers
-
getPartitionList
public java.util.List<ResourceHelper> getPartitionList()
- Returns:
- the list of partition helpers - never null
-
getResourceList
public java.util.List<ResourceHelper> getResourceList()
- Returns:
- the list of partition helpers - never null
-
cleanUp
public void cleanUp()
Description copied from class:BaseXJDFHelpergeneric cleanup routine- Overrides:
cleanUpin classBaseXJDFHelper
-
getName
public java.lang.String getName()
- Returns:
- the name of the resource set also fixes it in case it needs to be calculated from kids
-
getPartitionName
public java.lang.String getPartitionName()
- Returns:
-
getSetName
public static java.lang.String getSetName(KElement e)
- Parameters:
e- the element to test- Returns:
- then asset type name (Parameter, Resource etc)
-
getSetName
public static java.lang.String getSetName(java.lang.String setName)
- Parameters:
setName- the name of the set element- Returns:
- then asset type name (Parameter, Resource etc)
-
getPartition
public ResourceHelper getPartition(VJDFAttributeMap vmap)
- Parameters:
vmap-- Returns:
-
getPartitions
public java.util.Vector<ResourceHelper> getPartitions(VJDFAttributeMap vmap)
- Parameters:
vmap-- Returns:
-
getPartitions
public java.util.Vector<ResourceHelper> getPartitions(JDFAttributeMap map)
- Parameters:
map-- Returns:
-
getSuperPartitions
public java.util.Vector<ResourceHelper> getSuperPartitions(JDFAttributeMap map)
returns all partitions that are a superset of map- Parameters:
map-- Returns:
-
getSet
public KElement getSet()
- Returns:
-
setUsage
public void setUsage(JDFResourceLink.EnumUsage value)
- Parameters:
value-
-
getUsage
public JDFResourceLink.EnumUsage getUsage()
- Returns:
-
getProcessUsage
public java.lang.String getProcessUsage()
- Returns:
-
getCombinedProcessIndex
public JDFIntegerList getCombinedProcessIndex()
- Returns:
-
removeTypeFromCPI
public void removeTypeFromCPI(int pos)
remove a CPI process- Parameters:
typ-pos-
-
addTypeToCPI
public void addTypeToCPI(int pos)
add a CPI process- Parameters:
typ-pos-
-
setCombinedProcessIndex
public void setCombinedProcessIndex(JDFIntegerList cpi)
-
setProcessUsage
public void setProcessUsage(java.lang.String processUsage)
-
getDescriptiveName
public java.lang.String getDescriptiveName()
- Overrides:
getDescriptiveNamein classBaseXJDFHelper- Returns:
-
getExternalID
public java.lang.String getExternalID()
- Overrides:
getExternalIDin classBaseXJDFHelper- Returns:
- the productID of the product
-
toString
public java.lang.String toString()
- Overrides:
toStringin classBaseXJDFHelper- Returns:
- See Also:
Object.toString()
-
getPartition
public ResourceHelper getPartition(java.lang.String id)
get a partition by id- Parameters:
id-- Returns:
-
getFamily
public SetHelper.EnumFamily getFamily()
- Returns:
-
setID
public void setID(java.lang.String newID)
- Overrides:
setIDin classBaseXJDFHelper- See Also:
BaseXJDFHelper.setID(java.lang.String)
-
getPartMapVector
public VJDFAttributeMap getPartMapVector()
returns the unified partmaps- Returns:
-
getPartMapList
public java.util.List<JDFAttributeMap> getPartMapList()
returns the unified partmaps- Returns:
-
getPartMapVectors
public java.util.Collection<VJDFAttributeMap> getPartMapVectors()
- Returns:
- the ordered collection of PartMapVectors of each child resource
-
getPartMapLists
public java.util.Collection<java.util.List<JDFAttributeMap>> getPartMapLists()
- Returns:
- the ordered collection of PartMapVectors of each child resource
-
getDependentJobParts
public VString getDependentJobParts()
- Returns:
-
setName
public void setName(java.lang.String name)
- Parameters:
name-
-
removeIDs
public void removeIDs()
-
indexOf
public int indexOf(ResourceHelper bsHelper)
- Parameters:
bsHelper-- Returns:
-
getHelper
public static SetHelper getHelper(KElement e)
factory to create a helper from an element- Parameters:
root- the element to parse- Returns:
- the helper
-
setExternalID
public void setExternalID(java.lang.String newID)
- See Also:
BaseXJDFHelper.setExternalID(java.lang.String)
-
setDescriptiveName
public void setDescriptiveName(java.lang.String description)
- See Also:
BaseXJDFHelper.setDescriptiveName(java.lang.String)
-
setGeneralID
public void setGeneralID(java.lang.String idUsage, java.lang.String idValue)- See Also:
BaseXJDFHelper.setGeneralID(java.lang.String, java.lang.String)
-
matches
public boolean matches(java.lang.Object subset)
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:
-
-