Package com.jgalgo.graph
Interface WeightsShort<K>
-
- All Superinterfaces:
Comparator<K>,WeightFunction<K>,WeightFunctionInt<K>,Weights<K,Short>
- All Known Subinterfaces:
IWeightsShort
public interface WeightsShort<K> extends Weights<K,Short>, WeightFunctionInt<K>
Specific weights ofshort.- 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 shortdefaultWeight()Get the default weight of this weights container.default ShortdefaultWeightAsObj()Deprecated.Please usedefaultWeight()instead to avoid un/boxing.shortget(K element)Get the weight associated with the given element.default ShortgetAsObj(K element)Deprecated.Please useget(Object)instead to avoid un/boxing.voidset(K element, short weight)Set the weight associated with the given element.default voidsetAsObj(K element, Short weight)Deprecated.Please useset(Object, short)instead to avoid un/boxing.default intweightInt(K element)Get the integer 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.WeightFunctionInt
compare, weight, weightSum
-
-
-
-
Method Detail
-
get
short 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 Short 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, short 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, Short weight)
Deprecated.Please useset(Object, short)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
short 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, short).- Returns:
- the default weight of this weights container.
-
defaultWeightAsObj
@Deprecated default Short 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,Short>- Returns:
- the default weight of this weights container
-
weightInt
default int weightInt(K element)
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
-
-