Esempio n. 1
0
  /**
   * @param hexEdge ...
   * @param weight ...
   */
  public void merge(HexEdge<D, W> hexEdge, W weight) {
    int oldIndex = DOMAIN.labelOf(hexEdge.weight());

    hexEdge.mergeWeightWith(weight);

    int newIndex = DOMAIN.labelOf(hexEdge.weight());

    if (oldIndex != newIndex) {
      updateUsedIndexExtrema(newIndex);

      INDEX[oldIndex] = hexEdge.removeFromEqualWeightLabelList(INDEX[oldIndex]);

      hexEdge.addToEqualWeightLabelList(INDEX[newIndex]);
      INDEX[newIndex] = hexEdge;
    }
  }
Esempio n. 2
0
 /** @param hexEdge ... */
 public void remove(HexEdge<D, W> hexEdge) {
   int index = DOMAIN.labelOf(hexEdge.weight());
   INDEX[index] = hexEdge.removeFromEqualWeightLabelList(INDEX[index]);
 }