2 * Sixth - System for data storage, computation, exploration and interaction.
3 * Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 3 of the GNU Lesser General Public License
7 * or later as published by the Free Software Foundation.
10 package eu.svjatoslav.sixth.e3d.gui;
12 public class TextPointer implements Comparable<TextPointer> {
17 public TextPointer() {
21 public TextPointer(final int row, final int column) {
26 public TextPointer(final TextPointer parent) {
27 this(parent.row, parent.column);
31 public boolean equals(final Object o) {
32 if (o == null) return false;
34 return o instanceof TextPointer && compareTo((TextPointer) o) == 0;
38 public int hashCode() {
40 result = 31 * result + column;
45 public int compareTo(final TextPointer textPointer) {
47 if (textPointer.row > row)
49 if (textPointer.row < row)
52 if (textPointer.column > column)
54 if (textPointer.column < column)
60 public boolean isBetween(final TextPointer start, final TextPointer end) {
71 if (end.compareTo(start) >= 0) {
79 return (compareTo(smaller) >= 0) && (bigger.compareTo(this) > 0);