00001 /* 00002 ** Author(s): Miguel Calejo 00003 ** Contact: interprolog@declarativa.com, http://www.declarativa.com 00004 ** Copyright (C) Declarativa, Portugal, 2000-2002 00005 ** Use and distribution, without any warranties, under the terms of the 00006 ** GNU Library General Public License, readable in http://www.fsf.org/copyleft/lgpl.html 00007 */ 00008 package com.declarativa.interprolog.util; 00009 import java.io.Serializable; 00010 import com.declarativa.interprolog.*; 00014 public class VariableNode implements Serializable{ 00015 Integer number; 00016 public static ObjectExamplePair example(){ 00017 return new ObjectExamplePair("VariableNode", 00018 new VariableNode(1), 00019 new VariableNode(2) 00020 ); 00021 } 00022 VariableNode(int n){ 00023 number = new Integer(n); 00024 } 00025 00026 public String toString(){ 00027 return "Var"+number; 00028 } 00029 public boolean equals(Object x){ 00030 return (x.getClass()==getClass() && number.equals( ((VariableNode)x).number )); 00031 } 00032 }