All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.uci.ics.jung.visualization.spatial.rtree.Pair Maven / Gradle / Ivy

package edu.uci.ics.jung.visualization.spatial.rtree;

import com.google.common.base.Preconditions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A collection of two items. Used for pairs of lists during R*-Tree split
 *
 * @author Tom Nelson
 */
public class Pair {

  private static final Logger log = LoggerFactory.getLogger(Pair.class);

  public final T left;
  public final T right;

  public static  Pair of(T left, T right) {
    return new Pair(left, right);
  }

  public Pair(T left, T right) {
    Preconditions.checkArgument(left != right, "Attempt to create pair with 2 equal elements");
    this.left = left;
    this.right = right;
  }

  @Override
  public String toString() {
    return "Pair{" + "left=" + left + ", right=" + right + '}';
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy