PrimitivePair.\* : pair(s) based directly on primitive types. Hail generics.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@148 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
asivache 2009-03-23 14:12:22 +00:00
parent 1f60c70688
commit 0188379174
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package org.broadinstitute.sting.utils;
/** This class is used to group together multiple Pair classes for
* primitive types (thanks to generics shortcomings, these implementations
* are more efficient then generic ones). This class contains no methods and
* no fields, but only declarations of inner classes.
*/
public class PrimitivePair {
/** Pair of two integers */
public static class Int {
// declare public, STL-style for easier and more efficient access:
public int first;
public int second;
public Int(int x, int y) { first = x; second = y; }
public Int() { first = second = 0; }
public void set(int x, int y) { first = x; second = y; }
/** Java-style getter; note that we currently allow direct access to
the member field.
*/
public int getFirst() { return first; }
/** Java-style getter; note that we currently allow direct access to
the member field.
*/
public int getSecond() { return second; }
}
}