Class Functions<T>
java.lang.Object
java.util.AbstractMap<K,V>
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 extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
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, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
Methods inherited from class java.util.AbstractMap
equals, hashCode
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
Constructor Details
-
Functions
public Functions()
-
-
Method Details
-
toString
returns a string representation for this ranking function- Overrides:
toString
in classAbstractMap<T,
Integer>
-
getLevelingFunction
returns the ranking function- Returns:
- ranking function
-
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
returns the value to a given key -
values
returns a collection containing all values of the map -
getElementsByValue
returns an entry set of all elements in this ranking function with the same rank (= value)- Parameters:
val
- the rank of the elements searched- Returns:
- an entry set of all elements in this ranking function with the same rank (= value)
-
getPredecessors
returns a set of predecessor elements for the given entry- Parameters:
element
- the given entry- Returns:
- a set of predecessor elements for the given entry
-
getSuccessors
returns a set of successor elements for the given entry- Parameters:
element
- the given entry- Returns:
- a set of successor elements for the given entry
-
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
-