Package org.cip4.jdflib.resource
Class PartitionGetter
java.lang.Object
org.cip4.jdflib.resource.PartitionGetter
- Direct Known Subclasses:
JDFResource.PartitionGetter
class that evaluates the partitions based on the underlying PartitionMap This class will typically return JDFAttributeMaps that exist in the PartitionMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePartitions(VJDFAttributeMap vPartMap, VString vPartIDKeys) Recursively adds the partition leaves defined in vPartMapvoidrefactor a resource to add all sparse partitionsgetCreatePartition(JDFAttributeMap partMap, VString vPartKeys) Recursively adds the partition leaves defined in partMapprotected JDFResourcegetDeepPart(JDFAttributeMap m, JDFResource.EnumPartUsage partUsage) Gets a matching part from somewhere down there,
returns the closest ancestor of all matching elements within the target vectorgetPartition(JDFAttributeMap m, JDFResource.EnumPartUsage partUsage) Gets the first part that matches mAttributegetPartitionMaps(VJDFAttributeMap vm, JDFResource.EnumPartUsage partUsage) Gets the vector of parts (resource leaves or nodes) that match mAttributegetPartitionVector(JDFAttributeMap m, JDFResource.EnumPartUsage partUsage) Gets the vector of parts (resource leaves or nodes) that match mAttributegetPartitionVector(VJDFAttributeMap vm, JDFResource.EnumPartUsage partUsage) Gets the vector of parts (resource leaves or nodes) that match mAttributestatic booleanbooleanGetter for followIdentical attribute.booleanbooleanreorderPartitions(List<String> newPartIDKeys) refactor a resource to new partIDKeysstatic voidsetAlwaysStrictPartVersion(boolean alwaysStrictPartVersion) globally enable/disable matching of single versions to multiple versionsvoidsetFollowIdentical(boolean followIdentical) Setter for followIdentical attribute.voidsetStrictPartVersion(boolean strictPartVersion) if set to true, partversion will only match if the string matches exactly
if set to false (the default) partversions will match if tokens overlaptoString()
-
Constructor Details
-
PartitionGetter
- Parameters:
jdfResource- TODO
-
-
Method Details
-
isAlwaysStrictPartVersion
public static boolean isAlwaysStrictPartVersion() -
setAlwaysStrictPartVersion
public static void setAlwaysStrictPartVersion(boolean alwaysStrictPartVersion) globally enable/disable matching of single versions to multiple versions- Parameters:
alwaysStrictPartVersion-
-
toString
-
isFollowIdentical
public boolean isFollowIdentical()Getter for followIdentical attribute.- Returns:
- the followIdentical
-
setFollowIdentical
public void setFollowIdentical(boolean followIdentical) Setter for followIdentical attribute.- Parameters:
followIdentical- the followIdentical to set
-
getPartitionVector
Gets the vector of parts (resource leaves or nodes) that match mAttribute- Parameters:
vm- the map of key-value partitions (where key - PartIDKey, value - its value)partUsage- also accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified- Returns:
- VElement - the vector of matching resource leaves or nodes
-
getPartitionMaps
Gets the vector of parts (resource leaves or nodes) that match mAttribute- Parameters:
vm- the map of key-value partitions (where key - PartIDKey, value - its value)partUsage- also accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified- Returns:
- VElement - the vector of matching resource leaves or nodes
-
getPartitionVector
Gets the vector of parts (resource leaves or nodes) that match mAttribute- Parameters:
m- the map of key-value partitions (where key - PartIDKey, value - its value)partUsage- also accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified- Returns:
- VElement - the vector of matching resource leaves or nodes
-
getPartition
Gets the first part that matches mAttribute- Parameters:
m- the map of key-value partitions (where key - PartIDKey, value - its value)partUsage- also accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified- Returns:
- JDFResource: the first matching resource leaf or node
-
getDeepPart
Gets a matching part from somewhere down there,
returns the closest ancestor of all matching elements within the target vector- Parameters:
m- map of attributes that should fitpartUsage- lso accept nodes that are are not completely specified in the partmap, e.g. if partitioned by run, RunPage and only Run is specified- Returns:
- the first found matching resource node or leaf
-
getCreatePartition
Recursively adds the partition leaves defined in partMap- Parameters:
partMap- the map of part keysvPartKeys- the vector of partIDKeys strings of the resource. If empty (the default), the Resource PartIDKeys attribute is used- Returns:
- JDFResource the last created partition leaf
- Throws:
JDFException- if there are in the partMap not matching partitionsJDFException- if there is an attempt to fill non-matching partIDKeysJDFException- if by adding of last partition key there is either non-continuous partmap or left more than one key
-
reorderPartitions
refactor a resource to new partIDKeys -
fillSparse
public void fillSparse()refactor a resource to add all sparse partitions -
createPartitions
Recursively adds the partition leaves defined in vPartMap- Parameters:
vPartMap- the vector of maps of part keysvPartIDKeys- the vector of partIDKeys strings of the resource. If empty (the default) the Resource PartIDKeys attribute is used- Returns:
- VElement - vector of newly created partitions
- Throws:
JDFException- if there are in the partMap not matching partitionsJDFException- if there is an attempt to fill non-matching partIDKeysJDFException- if by adding of last partition key there is either non-continuous partmap or left more than one key
-
setStrictPartVersion
public void setStrictPartVersion(boolean strictPartVersion) if set to true, partversion will only match if the string matches exactly
if set to false (the default) partversions will match if tokens overlap- Parameters:
strictPartVersion-
-
isStrictPartVersion
public boolean isStrictPartVersion()
-