All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javasimon.UnknownSimon Maven / Gradle / Ivy

There is a newer version: 4.2.0
Show newest version
package org.javasimon;

/**
 * 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
 */
final class UnknownSimon extends AbstractSimon {

	/**
	 * Constructs unknown Simon with a specified name and for the specified manager.
	 *
	 * @param name Simon's name
	 * @param manager owning manager
	 */
	UnknownSimon(String name, Manager manager) {
		super(name, manager);
	}

	@Override
	@Deprecated
	void concreteReset() {
		// nothing to do
	}

	@Override
	public synchronized Sample sample() {
		UnknownSample sample = new UnknownSample();
		sampleCommon(sample);
		return sample;

	}

	@Override
	@Deprecated
	public synchronized Sample sampleAndReset() {
		// reset is not needed
		return sample();
	}

	@Override
	public Sample sampleIncrement(Object key) {
		return sample();
	}

	@Override
	public boolean stopIncrementalSampling(Object key) {
		return false;
	}

	/**
	 * Returns the label {@code Unknown Simon} and basic information for the Simon as a human readable string.
	 *
	 * @return basic information about unknown Simon
	 * @see AbstractSimon#toString()
	 */
	@Override
	public String toString() {
		return "Unknown Simon: " + super.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy