<commit_before><commit_msg>Add dependency 'SetEvent' from Cosy library.<commit_after>/*
 * Copyright (c) 2003 by Cosylab d.o.o.
 *
 * The full license specifying the redistribution, modification, usage and other
 * rights and obligations is included with the distribution of this project in
 * the file license.html. If the license is not included you may find a copy at
 * http://www.cosylab.com/legal/abeans_license.htm or may write to Cosylab, d.o.o.
 *
 * THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE
 * IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR OF THIS SOFTWARE, ASSUMES
 * _NO_ RESPONSIBILITY FOR ANY CONSEQUENCE RESULTING FROM THE USE, MODIFICATION,
 * OR REDISTRIBUTION OF THIS SOFTWARE.
 */

package com.cosylab.events;

import java.util.EventObject;


/**
 * Notifys listeners that user set action was performed on number displayer.
 *
 * @author <NAME>
 * @version $$id$$
 */
public class SetEvent extends EventObject
{
	private final Number value;

	/**
	 * Constructor for SliderSetEvent.
	 *
	 * @param source Object
	 * @param newValue double
	 */
	public SetEvent(Object source, double newValue)
	{
		super(source);
		value = new Double(newValue);
	}

	/**
	 * Constructor for SliderSetEvent.
	 *
	 * @param source Object
	 * @param newValue Object
	 *
	 * @throws NullPointerException DOCUMENT ME!
	 */
	public SetEvent(Object source, Number newValue)
	{
		super(source);

		if (newValue == null) {
			throw new NullPointerException("newValue == null");
		}

		value = newValue;
	}

	/**
	 * Returns value which was set by user.
	 *
	 * @return Number
	 */
	public Number getValue()
	{
		return value;
	}

	/**
	 * Returns set value as double.
	 *
	 * @return double
	 */
	public double getDoubleValue()
	{
		return value.doubleValue();
	}

	/**
	 * Returns set value as long.
	 *
	 * @return double
	 */
	public long getLongValue()
	{
		return value.longValue();
	}
}

/* __oOo__ */
{'fraction_non_alphanumeric': 0.10175619834710743, 'fraction_numerical': 0.002066115702479339, 'mean_word_length': 3.4022727272727273, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2970828', 'n_tokens_mistral': 636, 'n_tokens_neox': 578, 'n_words': 207}