Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String compareText;
- public BoomerangCellData(ImageIcon icon, String text, String compareText) {
- super(icon, text);
- this.compareText = compareText;
- }
- public void setCompareText(String compareText) {
- this.compareText = compareText;
- }
- public String getCompareText() {
- return compareText;
- }
- @Override
- public int compareTo(CellData o) {
- BoomerangCellData data = (BoomerangCellData) o;
- if (data!= null) {
- if (compareText == null && data.getCompareText() == null) {
- return 0;
- } else if (compareText == null) {
- return -1;
- } else if (data.getCompareText() == null) {
- return 1;
- } else {
- return compareText.compareTo(data.getCompareText());
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement