org.oddjob.monitor.context
Class AncestorSearch

java.lang.Object
  extended by org.oddjob.monitor.context.AncestorSearch

public class AncestorSearch
extends Object

Helper class to search up an ExplorerContext.

Author:
rob

Constructor Summary
AncestorSearch(ExplorerContext start)
          Constructor.
 
Method Summary
 Object getValue(String key)
          Get the value of a key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AncestorSearch

public AncestorSearch(ExplorerContext start)
Constructor.

Parameters:
start - The context to start the search from.
Method Detail

getValue

public Object getValue(String key)
Get the value of a key. If the start context doesn't contain the value, then the parent value is examined. If that contains null the search continues upwards until a value is found or the root is reached.

Parameters:
key - The key to the value.
Returns:
The first value in the hierarchy, or null if none exists.