Interface WeightsInt<K>
- Type Parameters:
K- the elements (vertices/edges) type
- All Superinterfaces:
Comparator<K>,WeightFunction<K>,WeightFunctionInt<K>,Weights<K,Integer>
- All Known Subinterfaces:
IWeightsInt
Specific weights of
int.- Author:
- Barak Ugav
-
Field Summary
Fields inherited from interface com.jgalgo.graph.WeightFunction
CardinalityWeightFunction -
Method Summary
Modifier and TypeMethodDescriptionintGet the default weight of this weights container.default IntegerDeprecated.intGet the weight associated with the given element.default IntegerDeprecated.Please useget(Object)instead to avoid un/boxing.voidSet the weight associated with the given element.default voidDeprecated.Please useset(Object, int)instead to avoid un/boxing.default intGet the integer weight of an element.Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface com.jgalgo.graph.WeightFunctionInt
compare, weight, weightSum
-
Method Details
-
get
Get the weight associated with the given element.- Parameters:
element- an element (edge/vertex).- Returns:
- the weight associated with the given element.
-
getAsObj
Deprecated.Please useget(Object)instead to avoid un/boxing.Get the weight associated with the given element.This method return the weight as an object, and should not be used when its known what type the weights are.
-
set
Set the weight associated with the given element.- Parameters:
element- an element (edge/vertex).weight- new weight that will be associated with the given element
-
setAsObj
Deprecated.Please useset(Object, int)instead to avoid un/boxing.Set the weight associated with the given element.This method accept the weight as an object, and should not be used when its known what type the weights are.
-
defaultWeight
int defaultWeight()Get the default weight of this weights container.The default weight is the weight associated with all elements that were not explicitly set using
set(Object, int).- Returns:
- the default weight of this weights container.
-
defaultWeightAsObj
Deprecated.Please usedefaultWeight()instead to avoid un/boxing.Get the default weight of this weights container.The default weight is the weight associated with all ids that were not explicitly set. This method return the default weight as an object, and should not be used when its known what type the weights are.
- Specified by:
defaultWeightAsObjin interfaceWeights<K,Integer> - Returns:
- the default weight of this weights container
-
weightInt
Get the integer weight of an element.Implement the
WeightFunctionIntinterface by using the weights of the container.- Specified by:
weightIntin interfaceWeightFunctionInt<K>- Parameters:
element- an element identifier- Returns:
- the weight of the element
-
defaultWeight()instead to avoid un/boxing.