Class UsageTreeController

java.lang.Object
com.ardor3d.bounding.UsageTreeController
All Implemented Interfaces:
CollisionTreeController

public class UsageTreeController extends Object implements CollisionTreeController
UsageTreeController defines a CollisionTreeController implementation that removes cache elements based on the frequency of usage. By default, and implementation in the CollisionTreeManager, the cache's key set will be ordered with the first element being the oldest used. Therefore, UsageTreeController simply removes elements from the cache starting at the first key and working up until the desired size is reached or we run out of elements.
  • Constructor Details

    • UsageTreeController

      public UsageTreeController()
  • Method Details

    • clean

      public void clean(Map<Mesh,CollisionTree> cache, List<Mesh> protectedList, int desiredSize)
      removes elements from cache (that are not in the protectedList) until the desiredSize is reached. It removes elements from the keyset as they are ordered.
      Specified by:
      clean in interface CollisionTreeController
      Parameters:
      cache - the cache to clean.
      protectedList - the list of elements to not remove.
      desiredSize - the final size of the cache to attempt to reach.