Package org.cip4.lib.xjdf.util
Class Resources
- java.lang.Object
-
- org.cip4.lib.xjdf.util.Resources
-
public class Resources extends java.lang.ObjectThis class provides access to Resources within ResourceSets.
-
-
Constructor Summary
Constructors Constructor Description Resources()Constructor.Resources(@NotNull java.util.List<ResourceSet> resourceSets)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResource(@NotNull Resource resource, @Nullable java.lang.String processUsage)Add an Resource to the corresponding ResourceSet.voidaddResource(@NotNull SpecificResource specificResource, @Nullable Part part, @Nullable java.lang.String processUsage)Add an Resource to the corresponding ResourceSet.voidaddResourceSet(ResourceSet resourceSet)Add an ResourceSet to the known resources.<T extends SpecificResource>
java.util.List<T>findSpecificResource(java.lang.Class<T> findClass, Part part, java.lang.String processUsage)Returns a list of parameter types matching the selection.java.util.List<ResourceSet>getResourceSets()Getter for the ResourceSets.
-
-
-
Constructor Detail
-
Resources
public Resources()
Constructor.
-
Resources
public Resources(@NotNull @NotNull java.util.List<ResourceSet> resourceSets)Constructor.- Parameters:
resourceSets- List of ResourceSets to operate on.
-
-
Method Detail
-
addResource
public final void addResource(@NotNull @NotNull Resource resource, @Nullable @Nullable java.lang.String processUsage)Add an Resource to the corresponding ResourceSet. If the corresponding ResourceSet does not exist it will be created. New ResourceSets are added in lexicographic order of their attribute "name" while adding new entries after existing entries with the same "name". This method assumes that the ResourceSets are already ordered in lexicographic order of their "name"-attributes.- Parameters:
resource- Resource to addprocessUsage- Process usage of the resource
-
addResource
public final void addResource(@NotNull @NotNull SpecificResource specificResource, @Nullable @Nullable Part part, @Nullable @Nullable java.lang.String processUsage)Add an Resource to the corresponding ResourceSet.- Parameters:
specificResource- Resource to addpart- Partition to add the resource toprocessUsage- Process usage of the resource
-
findSpecificResource
public <T extends SpecificResource> java.util.List<T> findSpecificResource(java.lang.Class<T> findClass, Part part, java.lang.String processUsage)
Returns a list of parameter types matching the selection.- Parameters:
findClass- The class to search for in the list.part- The part to search for in the list.processUsage- ProcessUsage to search for.- Returns:
- A list of parameter types that matches the input parameters.
-
addResourceSet
public final void addResourceSet(ResourceSet resourceSet)
Add an ResourceSet to the known resources. This method will insert the resources in lexicographic order while adding new sets with the same name after existing elements with the same name.- Parameters:
resourceSet- Set of resources to add.
-
getResourceSets
public java.util.List<ResourceSet> getResourceSets()
Getter for the ResourceSets.- Returns:
- List of ResourceSets.
-
-