From 4893e7b5aaae82fe401d786762ec6585fb261345 Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Sat, 14 Jun 2003 02:46:06 +0000 Subject: [PATCH] Added toString. --- .../applecommander/util/ApplesoftToken.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/webcodepro/applecommander/util/ApplesoftToken.java b/src/com/webcodepro/applecommander/util/ApplesoftToken.java index d28cc60..a1234e8 100644 --- a/src/com/webcodepro/applecommander/util/ApplesoftToken.java +++ b/src/com/webcodepro/applecommander/util/ApplesoftToken.java @@ -78,4 +78,16 @@ public class ApplesoftToken { return tokenValue; } + /** + * Render the token as a useful String. + */ + public String toString() { + if (isLineNumber()) { + return Integer.toString(getLineNumber()); + } else if (isToken()) { + return getTokenString() + " " + Integer.toHexString(getTokenValue()); + } else { + return getStringValue(); + } + } }