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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) checks whether the key is present in the entry-set of the mapbooleancontainsValue(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 voidstrengthenElement(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 voidweakenElement(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, sizeMethods 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:
toStringin 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:
containsKeyin interfaceMap<T,Integer> - Overrides:
containsKeyin classHashMap<T,Integer>
-
containsValue
checks whether the value is present in the entry-set of the map- Specified by:
containsValuein interfaceMap<T,Integer> - Overrides:
containsValuein 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
-