net.craftforge.essential.controller.allocation
Class ResourceTree

java.lang.Object
  extended by net.craftforge.essential.controller.allocation.ResourceTree

public class ResourceTree
extends Object

A resource tree is a tree of ResourceNodes. A resource tree is created from all resource classes and their methods contained in a package. It holds the relationship between the external resource view and the internal implementations and structures.

Since:
30.07.11
Author:
Christian Bick

Method Summary
 ResourceNode findResourceNode(String path)
          Finds the resource node matching the given (real) path.
 List<ResourceNode> findResourceNodesAlongPath(String path)
          Finds all resource nodes along a (real) path
 List<ResourceNode> findResourceNodesInPathSkippingRoot(String path)
          Finds all resource nodes in a (real) path except of the base resource node representing the path.
static ResourceTree getInstance(String packageName)
          Gets an instance of a resource tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ResourceTree getInstance(String packageName)
Gets an instance of a resource tree. Each package is represented by a single resource tree instance.

Parameters:
packageName - THe package name
Returns:
The resource tree instance

findResourceNode

public ResourceNode findResourceNode(String path)
Finds the resource node matching the given (real) path.

Parameters:
path - The path
Returns:
The matching resource node or null if not found

findResourceNodesAlongPath

public List<ResourceNode> findResourceNodesAlongPath(String path)
Finds all resource nodes along a (real) path

Parameters:
path - The (real) path
Returns:
The resource nodes along this path

findResourceNodesInPathSkippingRoot

public List<ResourceNode> findResourceNodesInPathSkippingRoot(String path)
Finds all resource nodes in a (real) path except of the base resource node representing the path. In other words: Finds a resource node matching path and then gets all its direct and indirect sub resources.

Parameters:
path - The (real) path
Returns:
The resources in the path


Copyright © 2011. All Rights Reserved.