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:
parent
1f60c70688
commit
0188379174
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue