Interface WeightsInt<K>

Type Parameters:
K - the elements (vertices/edges) type
All Superinterfaces:
Comparator<K>, WeightFunction<K>, WeightFunctionInt<K>, Weights<K,Integer>
All Known Subinterfaces:
IWeightsInt

public interface WeightsInt<K> extends Weights<K,Integer>, WeightFunctionInt<K>
Specific weights of int.
Author:
Barak Ugav
  • Method Details

    • get

      int 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 Integer getAsObj(K element)
      Deprecated.
      Please use get(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.

      Specified by:
      getAsObj in interface Weights<K,Integer>
      Parameters:
      element - an element (edge/vertex)
      Returns:
      the weight associated with the given element
    • set

      void set(K element, int 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, Integer weight)
      Deprecated.
      Please use set(Object, int) 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.

      Specified by:
      setAsObj in interface Weights<K,Integer>
      Parameters:
      element - an element (edge/vertex)
      weight - new weight that will be associated with the given element
    • defaultWeight

      int 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, int).

      Returns:
      the default weight of this weights container.
    • defaultWeightAsObj

      @Deprecated default Integer defaultWeightAsObj()
      Deprecated.
      Please use defaultWeight() 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 interface Weights<K,Integer>
      Returns:
      the default weight of this weights container
    • weightInt

      default int weightInt(K element)
      Get the integer weight of an element.

      Implement the WeightFunctionInt interface by using the weights of the container.

      Specified by:
      weightInt in interface WeightFunctionInt<K>
      Parameters:
      element - an element identifier
      Returns:
      the weight of the element