Skip to main content
summaryrefslogtreecommitdiffstats
blob: 03e8607364f576e9901371efdbdc5183cf0acecd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// RelativeValueProvider.java
package org.eclipse.stem.definitions.adapters.relativevalue;

/*******************************************************************************
 * Copyright (c) 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.util.List;

import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;

/**
 * This interface is implemented by classes that have properties and can map the
 * value of the property to a value between 0.0 (zero) and 1.0 (one), inclusive.
 */
public interface RelativeValueProvider {

	/**
	 * @return the properties of the provider
	 */
	List<IItemPropertyDescriptor> getProperties();

	/**
	 * Determine the relative (0.0 to 1.0) value of the property as compared to
	 * the other properties.
	 * 
	 * @param property
	 *            the property whose relative value is to be determined
	 * @return relative (0.0-1.0) value of the property as compared to the other
	 *         properties.
	 */
	double getRelativeValue(final ItemPropertyDescriptor property);

	/**
	 * Determine the relative (0.0 to 1.0) value of the property as compared to
	 * the other properties.
	 * 
	 * @param feature
	 *            feature of the property whose relative value is to be
	 *            determined
	 * @return relative (0.0-1.0) value of the property as compared to the other
	 *         properties.
	 */
	double getRelativeValue(final EStructuralFeature feature);
	
	/**
	 * This method returns the denominator or scale used to convert to relative
	 * values in the range 0-1. For example, in an Epidemic Compartment model
	 * the state values are normalized by population.
	 * It is required whenever we need to switch between relative and absolute values
	 * or can be used to create a label showing the maximum scale for any relative value.
	 * @return the denominator or scale used to normalize the relative value
	 */
	double getDenominator(final EStructuralFeature feature) ;
}// RelativeValueProvider

Back to the top