source: java2python/geniuswebtranslator/geniuswebsrc/geniusweb/profile/utilityspace/ValueSetUtilities.java@ 810

Last change on this file since 810 was 810, checked in by wouter, 6 months ago

#287 adding @Nonnull in geniusweb code

File size: 1.2 KB
Line 
1package geniusweb.profile.utilityspace;
2
3import java.math.BigDecimal;
4
5import org.eclipse.jdt.annotation.NonNull;
6
7import com.fasterxml.jackson.annotation.JsonSubTypes;
8import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
9import com.fasterxml.jackson.annotation.JsonTypeInfo;
10
11import geniusweb.issuevalue.Value;
12import geniusweb.issuevalue.ValueSet;
13
14/**
15 * Provides a mechanism to map {@link Value}s into a utility (value in range
16 * [0,1]).
17 */
18@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
19@JsonSubTypes({ @Type(value = DiscreteValueSetUtilities.class),
20 @Type(value = NumberValueSetUtilities.class) })
21public interface ValueSetUtilities {
22 /**
23 *
24 * @param value the {@link Value} to get the utility for
25 * @return the utility of the given value. MUST be in [0,1]. Should return 0
26 * if the value is unknown.
27 */
28 @NonNull
29 BigDecimal getUtility(@NonNull Value value);
30
31 /**
32 *
33 * @param valueset the valueset that is supposed match with this
34 * @return null if the ValueSetUtilities fits the given set of values , that
35 * means it can give utilities for all possible values in valueset.
36 * Or a string containing an explanation why not.
37 */
38 String isFitting(@NonNull ValueSet valueset);
39
40}
Note: See TracBrowser for help on using the repository browser.