Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Create Position.java
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,34 @@ | |||
public class Position implements Comparable{ | |||
|
|||
private Contig contig; | |||
private int startingPosition; | |||
|
|||
public Contig getContig() { | |||
return contig; | |||
} | |||
|
|||
public void setContig(Contig contig) { | |||
this.contig = contig; | |||
} | |||
|
|||
public int getStartingPosition() { | |||
return startingPosition; | |||
} | |||
|
|||
public void setStartingPosition(int startingPosition) { | |||
this.startingPosition = startingPosition; | |||
} | |||
|
|||
public int compareTo(Object obj) { | |||
Position tmp = (Position) obj; | |||
if ((this.startingPosition) < (tmp.startingPosition)) { | |||
/* instance lt received */ | |||
return -1; | |||
} else if ((this.startingPosition) > (tmp.startingPosition)) { | |||
/* instance gt received */ | |||
return 1; | |||
} | |||
/* instance == received */ | |||
return 0; | |||
} | |||
} |