nl.chess.it.util.config
Class InstrumentedProperties

java.lang.Object
  extended bynl.chess.it.util.config.InstrumentedProperties

class InstrumentedProperties
extends java.lang.Object

Simple adapter around Properties, used to keep track of which keys in the properties are used during a given interval. The measuring starts when startInstrumenting()is called, and stopped with stopInstrumenting().

Version:
$Revision: 1.1.1.1 $
Author:
Guus Bosman (Chess iT)

Constructor Summary
(package private) InstrumentedProperties(java.util.Properties properties)
           
 
Method Summary
 void clearResult()
           
 java.lang.String getLastUsedKey()
          Returns the last used key (key in property file).
 java.lang.String getLastUsedValue()
          Returns the last used value.
 java.util.Properties getProperties()
          Allows direct access to underlying properties.
 java.lang.String getProperty(java.lang.String key)
           
 java.util.Set getUsedKeys()
           
 void startInstrumenting()
          Start a session to instrument the property file.
 void stopInstrumenting()
          Stops a session instrumenting the property file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentedProperties

InstrumentedProperties(java.util.Properties properties)
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)

startInstrumenting

public void startInstrumenting()
Start a session to instrument the property file.


stopInstrumenting

public void stopInstrumenting()
Stops a session instrumenting the property file.


getUsedKeys

public java.util.Set getUsedKeys()

getProperties

public java.util.Properties getProperties()
Allows direct access to underlying properties. If you use this you are able to divert the instrumenting of course.

Returns:

getLastUsedKey

public java.lang.String getLastUsedKey()
Returns the last used key (key in property file).

Returns:
String. Might be null if no key has been used since the last call to clearResult().

getLastUsedValue

public java.lang.String getLastUsedValue()
Returns the last used value.

Returns:
String. Might be null if a value was really null or if no key has been used since the last call to clearResult().

clearResult

public void clearResult()


Copyright © 2003-2005 Chess-iT. All Rights Reserved.