Package com.jgalgo.graph
Interface IWeightsLong
- All Superinterfaces:
Comparator<Integer>,IntComparator,IWeightFunction,IWeights<Long>,WeightFunction<Integer>,Weights<Integer,,Long> WeightsLong<Integer>
Specific weights of
long for int graphs.- Author:
- Barak Ugav
-
Field Summary
Fields inherited from interface com.jgalgo.graph.IWeightFunction
CardinalityWeightFunctionFields inherited from interface com.jgalgo.graph.WeightFunction
CardinalityWeightFunction -
Method Summary
Modifier and TypeMethodDescriptiondefault intDeprecated.longget(int element) Get the weight associated with the given element.default longDeprecated.default LonggetAsObj(int element) Deprecated.Please useget(int)instead to avoid un/boxing.default LongDeprecated.Please useget(int)instead to avoid un/boxing.voidset(int element, long weight) Set the weight associated with the given element.default voidDeprecated.Please useset(int, long)instead to avoid un/boxing.default voidDeprecated.Please useset(int, long)instead to avoid un/boxing.default voidDeprecated.Please useset(int, long)instead to avoid un/boxing.default doubleweight(int element) Get the weight of an element.default doubleDeprecated.Methods inherited from interface java.util.Comparator
equals, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface it.unimi.dsi.fastutil.ints.IntComparator
reversed, thenComparing, thenComparingMethods inherited from interface com.jgalgo.graph.IWeightFunction
compare, weightSumMethods inherited from interface com.jgalgo.graph.WeightsLong
defaultWeight, defaultWeightAsObj
-
Method Details
-
get
long get(int element) Get the weight associated with the given element.- Parameters:
element- an element (edge/vertex.)- Returns:
- the weight associated with the given element.
-
get
Deprecated.Please useget(int)instead to avoid un/boxing.Get the weight associated with the given element.- Specified by:
getin interfaceWeightsLong<Integer>- Parameters:
element- an element (edge/vertex).- Returns:
- the weight associated with the given element.
-
getAsObj
Deprecated.Please useget(int)instead to avoid un/boxing.Get the weight associated with the given id. -
getAsObj
Deprecated.Please useget(int)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
void set(int element, long 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
-
set
Deprecated.Please useset(int, long)instead to avoid un/boxing.Set the weight associated with the given element.- Specified by:
setin interfaceWeightsLong<Integer>- Parameters:
element- an element (edge/vertex).weight- new weight that will be associated with the given element
-
setAsObj
Deprecated.Please useset(int, long)instead to avoid un/boxing.Set the weight associated with the given id. -
setAsObj
Deprecated.Please useset(int, long)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.
-
weight
default double weight(int element) Get the weight of an element.Implement the
IWeightFunctioninterface by using the weights of the container.- Specified by:
weightin interfaceIWeightFunction- Parameters:
element- an element identifier- Returns:
- the weight of the element
-
weight
Deprecated.Get the weight of an element.Implement the
WeightFunctioninterface by using the weights of the container.Implement the
WeightFunctionIntinterface by using the weights of the container.- Specified by:
weightin interfaceIWeightFunction- Specified by:
weightin interfaceWeightFunction<Integer>- Specified by:
weightin interfaceWeightsLong<Integer>- Parameters:
element- an element identifier- Returns:
- the weight of the element
-
compare
Deprecated.Description copied from interface:WeightFunctionCompare two elements by their weights.- Specified by:
comparein interfaceComparator<Integer>- Specified by:
comparein interfaceIntComparator- Specified by:
comparein interfaceIWeightFunction- Specified by:
comparein interfaceWeightFunction<Integer>
-
get(int)instead to avoid un/boxing.