Class Resources

java.lang.Object
org.cip4.lib.xjdf.util.Resources

public class Resources extends Object
This class provides access to Resources within ResourceSets.
  • Constructor Details

    • Resources

      public Resources()
      Constructor.
    • Resources

      public Resources(@NotNull @NotNull List<ResourceSet> resourceSets)
      Constructor.
      Parameters:
      resourceSets - List of ResourceSets to operate on.
  • Method Details

    • addResource

      public final void addResource(@NotNull @NotNull Resource resource, @Nullable @Nullable 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 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> List<T> findSpecificResource(Class<T> findClass, Part part, 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 List<ResourceSet> getResourceSets()
      Getter for the ResourceSets.
      Returns:
      List of ResourceSets.