Class Functions<T>
java.lang.Object
java.util.AbstractMap<T,Integer>
java.util.HashMap<T,Integer>
org.tweetyproject.preferences.ranking.Functions<T>
- Type Parameters:
T
- generic preference order type
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<T,
Integer>
- Direct Known Subclasses:
LevelingFunction
,RankingFunction
An abstract class as superclass for two different ranking/leveling functions used to rank elements from preference orders
- Author:
- Bastian Wolf
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(Object key) checks whether the key is present in the entry-set of the mapboolean
containsValue
(Object value) checks whether the value is present in the entry-set of the mapabstract PreferenceOrder
<T> this method returns a preference order made out of an ranking functionreturns the value to a given keygetElementsByValue
(int val) returns an entry set of all elements in this ranking function with the same rank (= value)returns the ranking functiongetPredecessors
(Map.Entry<T, Integer> element) returns a set of predecessor elements for the given entrygetSuccessors
(Map.Entry<T, Integer> element) returns a set of successor elements for the given entryabstract void
strengthenElement
(T element) strengthens the given element in the functiontoString()
returns a string representation for this ranking functionvalues()
returns a collection containing all values of the mapabstract void
weakenElement
(T element) weakens the given element in the functionMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
Methods inherited from class java.util.AbstractMap
equals, hashCode
-
Constructor Details
-
Functions
public Functions()Default Constructor
-
-
Method Details
-
toString
returns a string representation for this ranking function- Overrides:
toString
in classAbstractMap<T,
Integer>
-
getLevelingFunction
-
generatePreferenceOrder
this method returns a preference order made out of an ranking function- Returns:
- a preference order out of a given ranking function
-
containsKey
checks whether the key is present in the entry-set of the map- Specified by:
containsKey
in interfaceMap<T,
Integer> - Overrides:
containsKey
in classHashMap<T,
Integer>
-
containsValue
checks whether the value is present in the entry-set of the map- Specified by:
containsValue
in interfaceMap<T,
Integer> - Overrides:
containsValue
in classHashMap<T,
Integer>
-
get
-
values
-
getElementsByValue
-
getPredecessors
-
getSuccessors
-
weakenElement
weakens the given element in the function- Parameters:
element
- the element being weakened
-
strengthenElement
strengthens the given element in the function- Parameters:
element
- the element being strengthened
-