Class Resources


  • public class Resources
    extends java.lang.Object
    Resources utility class providing Resources management functionality.
    • 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 add
        processUsage - 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 add
        part - Partition to add the resource to
        processUsage - 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.
      • createResource

        @NotNull
        public static <V extends SpecificResource> @NotNull Resource createResource​(@NotNull
                                                                                    V resourceType,
                                                                                    @Nullable
                                                                                    @Nullable Part partition)
        Getter for the factory for xjdf nodes.
        Returns:
        Factory for creating xjdf nodes.
      • getResourceSets

        public java.util.List<ResourceSet> getResourceSets()
        Getter for the ResourceSets.
        Returns:
        List of ResourceSets.