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 of long for int graphs.
Author:
Barak Ugav
  • Method Details Link icon

    • get Link icon

      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 Link icon

      @Deprecated default long get(Integer element)
      Deprecated.
      Please use get(int) instead to avoid un/boxing.
      Get the weight associated with the given element.
      Specified by:
      get in interface WeightsLong<Integer>
      Parameters:
      element - an element (edge/vertex).
      Returns:
      the weight associated with the given element.
    • getAsObj Link icon

      @Deprecated default Long getAsObj(int element)
      Deprecated.
      Please use get(int) instead to avoid un/boxing.
      Get the weight associated with the given id.
      Specified by:
      getAsObj in interface IWeights<Long>
      Parameters:
      element - an id of edge/vertex
      Returns:
      the weight associated with the given id
    • getAsObj Link icon

      @Deprecated default Long getAsObj(Integer element)
      Deprecated.
      Please use get(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.

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

      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 Link icon

      @Deprecated default void set(Integer element, long weight)
      Deprecated.
      Please use set(int, long) instead to avoid un/boxing.
      Set the weight associated with the given element.
      Specified by:
      set in interface WeightsLong<Integer>
      Parameters:
      element - an element (edge/vertex).
      weight - new weight that will be associated with the given element
    • setAsObj Link icon

      @Deprecated default void setAsObj(int element, Long weight)
      Deprecated.
      Please use set(int, long) instead to avoid un/boxing.
      Set the weight associated with the given id.
      Specified by:
      setAsObj in interface IWeights<Long>
      Parameters:
      element - an id of edge/vertex
      weight - new weight that will be associated with the given id
    • setAsObj Link icon

      @Deprecated default void setAsObj(Integer element, Long weight)
      Deprecated.
      Please use set(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.

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

      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 interface IWeightFunction
      Parameters:
      element - an element identifier
      Returns:
      the weight of the element
    • weight Link icon

      @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 interface IWeightFunction
      Specified by:
      weight in interface WeightFunction<Integer>
      Specified by:
      weight in interface WeightsLong<Integer>
      Parameters:
      element - an element identifier
      Returns:
      the weight of the element
    • compare Link icon

      @Deprecated default int compare(Integer e1, Integer e2)
      Deprecated.
      Description copied from interface: WeightFunction
      Compare two elements by their weights.
      Specified by:
      compare in interface Comparator<Integer>
      Specified by:
      compare in interface IntComparator
      Specified by:
      compare in interface IWeightFunction
      Specified by:
      compare in interface WeightFunction<Integer>