Package phase
Class SampleSeg
java.lang.Object
phase.SampleSeg
- All Implemented Interfaces:
IntInterval
,Comparable<SampleSeg>
Class SampleSeg
represents a segment of genotype data in
a sample.
Instances of class SampleSeg
are immutable
-
Constructor Summary
ConstructorsConstructorDescriptionSampleSeg
(int sample, int start, int inclEnd) Constructs a newSampleSeg
instance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares thisSampleSeg
with the specifiedSampleSeg
for order.boolean
Compares the specified object with thisSampleSeg
for equality.int
hashCode()
Returns the hash code value for this object.int
inclEnd()
Returns the end marker index (inclusive).int
sample()
Returns the sample index.static Comparator
<SampleSeg> Returns a comparator that orders first bythis.sample()
, then bythis.start()
, and finally bythis.end()
.int
start()
Returns the start marker index (inclusive).toString()
Returns a string representation ofthis
.
-
Constructor Details
-
SampleSeg
public SampleSeg(int sample, int start, int inclEnd) Constructs a newSampleSeg
instance from the specified data.- Parameters:
sample
- the sample indexstart
- the start marker index (inclusive)inclEnd
- the end marker index (inclusive)- Throws:
IllegalArgumentException
- ifstart > inclEnd
-
-
Method Details
-
sample
public int sample()Returns the sample index.- Returns:
- the sample index
-
start
public int start()Returns the start marker index (inclusive).- Specified by:
start
in interfaceIntInterval
- Returns:
- the start marker index (inclusive)
-
inclEnd
public int inclEnd()Returns the end marker index (inclusive).- Specified by:
inclEnd
in interfaceIntInterval
- Returns:
- the end marker index (inclusive)
-
toString
Returns a string representation ofthis
. The exact details of the representation are unspecified and subject to change. -
hashCode
public int hashCode()Returns the hash code value for this object. The hash code is defined by the following calculation:
int hash = 5; hash = 89 * hash + this.hap(); hash = 89 * hash + this.start(); hash = 89 * hash + this.inclEnd();
-
equals
Compares the specified object with thisSampleSeg
for equality. Returnstrue
if the specified object is aSampleSeg
instance and if thisSampleSeg
is equal to the specifiedSampleSeg
, and returnsfalse
otherwise. TwoSampleSeg
instances are equal if they have equal sample indices, equal start marker indices, and equal end marker indices. -
compareTo
Compares thisSampleSeg
with the specifiedSampleSeg
for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.SampleSeg
instances are ordered first bythis.start()
, then bythis.end()
, and finally by tthis.sample()
.- Specified by:
compareTo
in interfaceComparable<SampleSeg>
- Parameters:
ss
- theSampleSeg
to be compared with thisSampleSeg
- Returns:
- a negative integer, zero, or a positive integer as this
SampleSeg
is less than, equal to, or greater than the specifiedSampleSeg
- Throws:
NullPointerException
- ifss == null
-
sampleComp
Returns a comparator that orders first bythis.sample()
, then bythis.start()
, and finally bythis.end()
.- Returns:
- a comparator that orders first by
this.sample()
, then bythis.start()
, and finally bythis.end()
-