Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ensembl.util
Class Pair

    java.lang.Object
      org.ensembl.util.Pair

All Implemented Interfaces:
  java.lang.Comparable

public class Pair
extends java.lang.Object
implements java.lang.Comparable

A simple "record" data structure representing a pair of strings. An int can be associated with each string. Instances of this class have a natural ordering making them easy to sort (Arrays.sort(), Collections.sort()). hashCode() and equals are also implemented making it suitable for use in hashes where hash by value rather than identity is required.

Field Summary
`java.lang.String` | `left`
`int` | `leftInt`
`java.lang.String` | `right`
`int` | `rightInt`
`java.lang.String` | `type`

Constructor Summary
`Pair(java.lang.String left, int leftInt, java.lang.String right, int rightInt, java.lang.String type)`
`Pair(java.lang.String left, java.lang.String right)` leftInt and rightInt default to 0.

Method Summary
`int` | `compareTo(java.lang.Object o)`
`boolean` | `equals(java.lang.Object o)`
`int` | `hashCode()`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### left

    public final java.lang.String left

### right

    public final java.lang.String right

### leftInt

    public final int leftInt

### rightInt

    public final int rightInt

### type

    public final java.lang.String type

Constructor Detail

### Pair

    public Pair(java.lang.String left,
                java.lang.String right)

  leftInt and rightInt default to 0.

Parameters:
  `left` -
  `right` -

### Pair

    public Pair(java.lang.String left,
                int leftInt,
                java.lang.String right,
                int rightInt,
                java.lang.String type)

Method Detail

### toString

    public java.lang.String toString()

### equals

    public boolean equals(java.lang.Object o)

### hashCode

    public int hashCode()

### compareTo

    public int compareTo(java.lang.Object o)

  Specified by:
    `compareTo` in interface `java.lang.Comparable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD