Package com.jgalgo.graph
Interface IWeightsLong
-
- All Superinterfaces:
Comparator<Integer>
,IntComparator
,IWeightFunction
,IWeights<Long>
,WeightFunction<Integer>
,Weights<Integer,Long>
,WeightsLong<Integer>
public interface IWeightsLong extends IWeights<Long>, WeightsLong<Integer>, IWeightFunction
Specific weights oflong
for int graphs.- Author:
- Barak Ugav
-
-
Field Summary
-
Fields inherited from interface com.jgalgo.graph.IWeightFunction
CardinalityWeightFunction
-
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 default int
compare(Integer e1, Integer e2)
Deprecated.long
get(int element)
Get the weight associated with the given element.default long
get(Integer element)
Deprecated.Please useget(int)
instead to avoid un/boxing.default Long
getAsObj(int element)
Deprecated.Please useget(int)
instead to avoid un/boxing.default Long
getAsObj(Integer element)
Deprecated.Please useget(int)
instead to avoid un/boxing.void
set(int element, long weight)
Set the weight associated with the given element.default void
set(Integer element, long weight)
Deprecated.Please useset(int, long)
instead to avoid un/boxing.default void
setAsObj(int element, Long weight)
Deprecated.Please useset(int, long)
instead to avoid un/boxing.default void
setAsObj(Integer element, Long weight)
Deprecated.Please useset(int, long)
instead to avoid un/boxing.default double
weight(int element)
Get the weight of an element.default double
weight(Integer element)
Deprecated.-
Methods inherited from interface java.util.Comparator
equals, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntComparator
reversed, thenComparing, thenComparing
-
Methods inherited from interface com.jgalgo.graph.IWeightFunction
compare, weightSum
-
Methods inherited from interface com.jgalgo.graph.WeightsLong
defaultWeight, defaultWeightAsObj
-
-
-
-
Method Detail
-
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 default long get(Integer element)
Deprecated.Please useget(int)
instead to avoid un/boxing.Get the weight associated with the given element.- Specified by:
get
in interfaceWeightsLong<Integer>
- Parameters:
element
- an element (edge/vertex).- Returns:
- the weight associated with the given element.
-
getAsObj
@Deprecated default Long getAsObj(int element)
Deprecated.Please useget(int)
instead to avoid un/boxing.Get the weight associated with the given id.
-
getAsObj
@Deprecated default Long getAsObj(Integer element)
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 default void set(Integer element, long weight)
Deprecated.Please useset(int, long)
instead to avoid un/boxing.Set the weight associated with the given element.- Specified by:
set
in interfaceWeightsLong<Integer>
- Parameters:
element
- an element (edge/vertex).weight
- new weight that will be associated with the given element
-
setAsObj
@Deprecated default void setAsObj(int element, Long weight)
Deprecated.Please useset(int, long)
instead to avoid un/boxing.Set the weight associated with the given id.
-
setAsObj
@Deprecated default void setAsObj(Integer element, Long weight)
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
IWeightFunction
interface by using the weights of the container.- Specified by:
weight
in interfaceIWeightFunction
- Parameters:
element
- an element identifier- Returns:
- the weight of the element
-
weight
@Deprecated default double weight(Integer element)
Deprecated.Get the weight of an element.Implement the
WeightFunction
interface by using the weights of the container.Implement the
WeightFunctionInt
interface by using the weights of the container.- Specified by:
weight
in interfaceIWeightFunction
- Specified by:
weight
in interfaceWeightFunction<Integer>
- Specified by:
weight
in interfaceWeightsLong<Integer>
- Parameters:
element
- an element identifier- Returns:
- the weight of the element
-
compare
@Deprecated default int compare(Integer e1, Integer e2)
Deprecated.Description copied from interface:WeightFunction
Compare two elements by their weights.- Specified by:
compare
in interfaceComparator<Integer>
- Specified by:
compare
in interfaceIntComparator
- Specified by:
compare
in interfaceIWeightFunction
- Specified by:
compare
in interfaceWeightFunction<Integer>
-
-