| 1 | package uk.ac.manchester.cs.factplusplus; |
| 2 | |
| 3 | /* |
| 4 | * Copyright (C) 2009-2010, University of Manchester |
| 5 | * |
| 6 | * Modifications to the initial code base are copyright of their |
| 7 | * respective authors, or their employers as appropriate. Authorship |
| 8 | * of the modifications may be determined from the ChangeLog placed at |
| 9 | * the end of this file. |
| 10 | * |
| 11 | * This library is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU Lesser General Public |
| 13 | * License as published by the Free Software Foundation; either |
| 14 | * version 2.1 of the License, or (at your option) any later version. |
| 15 | |
| 16 | * This library is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * Lesser General Public License for more details. |
| 20 | |
| 21 | * You should have received a copy of the GNU Lesser General Public |
| 22 | * License along with this library; if not, write to the Free Software |
| 23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 24 | */ |
| 25 | /** |
| 26 | * @author Matthew Horridge, The University Of Manchester, Medical Informatics |
| 27 | * Group, 10-Jul-2006 |
| 28 | */ |
| 29 | public class Pointer { |
| 30 | |
| 31 | private long node = 0; |
| 32 | |
| 33 | /** |
| 34 | * @return node pointer |
| 35 | */ |
| 36 | public long getNode() { |
| 37 | return node; |
| 38 | } |
| 39 | |
| 40 | @Override |
| 41 | public int hashCode() { |
| 42 | return (int) node; |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public boolean equals(Object obj) { |
| 47 | if (obj == null) { |
| 48 | return false; |
| 49 | } |
| 50 | if (this == obj) { |
| 51 | return true; |
| 52 | } |
| 53 | if (!(obj instanceof Pointer)) { |
| 54 | return false; |
| 55 | } |
| 56 | return ((Pointer) obj).node == node; |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public final String toString() { |
| 61 | return this.getClass().getSimpleName() + "[" + node + "]"; |
| 62 | } |
| 63 | } |