/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ /** * eine Klasse Symbol fuer Namen als Atome * * ein Name wird durch einen Java String * repraesentiert */ //-------------------- class Symbol extends Atom { protected final String name; //-------------------- public Symbol(String name) { this.name = name; } //-------------------- // isEqual muss redefiniert werden public SExpr isEqual(SExpr e2) { if ( this == e2 ) return t; if ( ! ( e2 instanceof Symbol ) ) return nil; if ( name.equals( ((Symbol)e2).name ) ) return t; return nil; } //-------------------- public String toString() { return name; } }