类 Pair<F,S>

java.lang.Object
org.beetl.core.util.Pair<F,S>

public class Pair<F,S> extends Object
Container to ease passing around a tuple of two objects. This object provides a sensible implementation of equals(), returning true if equals() is true on each of the contained objects.
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    final F
     
    final S
     
  • 构造器概要

    构造器
    构造器
    说明
    Pair(F first, S second)
    Constructor for a Pair.
  • 方法概要

    修饰符和类型
    方法
    说明
    static <A, B> Pair<A,B>
    create(A a, B b)
    Convenience method for creating an appropriately typed pair.
    boolean
    Checks the two objects for equality by delegating to their respective Object.equals(Object) methods.
    int
    Compute a hash code using the hash codes of the underlying objects
     

    从类继承的方法 java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 字段详细资料

    • first

      public final F first
    • second

      public final S second
  • 构造器详细资料

    • Pair

      public Pair(F first, S second)
      Constructor for a Pair.
      参数:
      first - the first object in the Pair
      second - the second object in the pair
  • 方法详细资料

    • equals

      public boolean equals(Object o)
      Checks the two objects for equality by delegating to their respective Object.equals(Object) methods.
      覆盖:
      equals 在类中 Object
      参数:
      o - the Pair to which this one is to be checked for equality
      返回:
      true if the underlying objects of the Pair are both considered equal
    • hashCode

      public int hashCode()
      Compute a hash code using the hash codes of the underlying objects
      覆盖:
      hashCode 在类中 Object
      返回:
      a hashcode of the Pair
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • create

      public static <A, B> Pair<A,B> create(A a, B b)
      Convenience method for creating an appropriately typed pair.
      参数:
      a - the first object in the Pair
      b - the second object in the pair
      返回:
      a Pair that is templatized with the types of a and b