Package com.jgalgo.graph
Interface WeightsDouble<K>
-
- All Superinterfaces:
Comparator<K>
,WeightFunction<K>
,Weights<K,Double>
- All Known Subinterfaces:
IWeightsDouble
public interface WeightsDouble<K> extends Weights<K,Double>, WeightFunction<K>
Specific weights ofdouble
.- Author:
- Barak Ugav
-
-
Field Summary
-
Fields inherited from interface com.jgalgo.graph.WeightFunction
CardinalityWeightFunction
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description double
defaultWeight()
Get the default weight of this weights container.default Double
defaultWeightAsObj()
Deprecated.double
get(K element)
Get the weight associated with the given element.default Double
getAsObj(K element)
Deprecated.void
set(K element, double weight)
Set the weight associated with the given element.default void
setAsObj(K element, Double weight)
Deprecated.default double
weight(K element)
Get the weight of an element.-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface com.jgalgo.graph.WeightFunction
compare, weightSum
-
-
-
-
Method Detail
-
get
double get(K element)
Get the weight associated with the given element.- Parameters:
element
- an element (edge/vertex).- Returns:
- the weight associated with the given element.
-
getAsObj
@Deprecated default Double getAsObj(K element)
Deprecated.Description copied from interface:Weights
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
void set(K element, double weight)
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 default void setAsObj(K element, Double weight)
Deprecated.Description copied from interface:Weights
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
double 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, double)
.- Returns:
- the default weight of this weights container.
-
defaultWeightAsObj
@Deprecated default Double defaultWeightAsObj()
Deprecated.Description copied from interface:Weights
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:
defaultWeightAsObj
in interfaceWeights<K,Double>
- Returns:
- the default weight of this weights container
-
weight
default double weight(K element)
Get the weight of an element.Implement the
WeightFunction
interface by using the weights of the container.- Specified by:
weight
in interfaceWeightFunction<K>
- Parameters:
element
- an element identifier- Returns:
- the weight of the element
-
-