Package com.jgalgo.graph
Interface WeightsObj<K,T>
-
- All Superinterfaces:
Weights<K,T>
- All Known Subinterfaces:
IWeightsObj<T>
public interface WeightsObj<K,T> extends Weights<K,T>
Specific weights ofObject
.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description T
defaultWeight()
Get the default weight of this weights container.default T
defaultWeightAsObj()
Deprecated.Please usedefaultWeight()
instead to avoid un/boxing.T
get(K element)
Get the weight associated with the given element.default T
getAsObj(K element)
Deprecated.Please useget(Object)
instead to avoid un/boxing.void
set(K element, T weight)
Set the weight associated with the given element.default void
setAsObj(K element, T weight)
Deprecated.Please useset(Object, Object)
instead to avoid un/boxing.
-
-
-
Method Detail
-
get
T 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 T getAsObj(K element)
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
void set(K element, T 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, T weight)
Deprecated.Please useset(Object, Object)
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
T 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, Object)
.- Returns:
- the default weight of this weights container.
-
defaultWeightAsObj
@Deprecated default T 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:
defaultWeightAsObj
in interfaceWeights<K,T>
- Returns:
- the default weight of this weights container
-
-