2 * Sixth 3D engine. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
5 package eu.svjatoslav.sixth.e3d.gui;
7 public class TextPointer implements Comparable<TextPointer> {
12 public TextPointer() {
16 public TextPointer(final int row, final int column) {
21 public TextPointer(final TextPointer parent) {
22 this(parent.row, parent.column);
26 public boolean equals(final Object o) {
27 if (o == null) return false;
29 return o instanceof TextPointer && compareTo((TextPointer) o) == 0;
33 public int hashCode() {
35 result = 31 * result + column;
40 public int compareTo(final TextPointer textPointer) {
42 if (textPointer.row > row)
44 if (textPointer.row < row)
47 return Integer.compare(column, textPointer.column);
51 public boolean isBetween(final TextPointer start, final TextPointer end) {
62 if (end.compareTo(start) >= 0) {
70 return (compareTo(smaller) >= 0) && (bigger.compareTo(this) > 0);