org.javasimon
Class UnknownSimon

java.lang.Object
  extended by org.javasimon.AbstractSimon
      extended by org.javasimon.UnknownSimon
All Implemented Interfaces:
HasAttributes, Simon

final class UnknownSimon
extends AbstractSimon

UnknownSimon represents Simon node in the hierarchy without known type. It may be replaced in the hierarchy for real Simon in the future.

Author:
Richard "Virgo" Richter

Field Summary
 
Fields inherited from class org.javasimon.AbstractSimon
enabled, firstUsage, lastUsage, manager
 
Constructor Summary
UnknownSimon(String name, Manager manager)
          Construts unknown Simon with a specified name and for the specified manager.
 
Method Summary
 Simon reset()
          Resets the Simon values related to the measuring, timestamps and so on - usage timestamps, state, attributes are not affected.
 Sample sample()
          Samples Simon values and returns them in a Java Bean derived from Sample interface.
 Sample sampleAndReset()
          Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon.
 String toString()
          Returns the label Unknown Simon and basic information for the Simon as a human readable string.
 
Methods inherited from class org.javasimon.AbstractSimon
addChild, getAttribute, getAttribute, getAttributeNames, getCopyAsSortedMap, getFirstUsage, getChildren, getLastReset, getLastUsage, getName, getNote, getParent, getState, isEnabled, removeAttribute, replaceChild, resetCommon, sampleCommon, setAttribute, setNote, setParent, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnknownSimon

UnknownSimon(String name,
             Manager manager)
Construts unknown Simon with a specified name and for the specified manager.

Parameters:
name - Simon's name
manager - owning manager
Method Detail

reset

public Simon reset()
Description copied from interface: Simon
Resets the Simon values related to the measuring, timestamps and so on - usage timestamps, state, attributes are not affected. Timestamp of the last reset can be obtained by the method Simon.getLastReset(). Reset is perfomed even for disabled Simons.

Returns:
returns this

sample

public Sample sample()
Description copied from interface: Simon
Samples Simon values and returns them in a Java Bean derived from Sample interface.

Returns:
sample containing all Simon values

sampleAndReset

public Sample sampleAndReset()
Description copied from interface: Simon
Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon. Operation is synchronized to assure atomicity.

Returns:
sample containing all Simon values

toString

public String toString()
Returns the label Unknown Simon and basic information for the Simon as a human readable string.

Overrides:
toString in class AbstractSimon
Returns:
basic information about unknown Simon
See Also:
AbstractSimon.toString()


Copyright © 2013. All Rights Reserved.