[Webfunds-commits] java/webfunds/sox AbstractPayment.java

Ian Grigg iang@cypherpunks.ai
Tue, 27 Feb 2001 10:00:10 -0400 (AST)


iang        01/02/27 10:00:08

  Modified:    webfunds/sox AbstractPayment.java
  Log:
  toString() only

Revision  Changes    Path
1.3       +11 -7     java/webfunds/sox/AbstractPayment.java

Index: AbstractPayment.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/AbstractPayment.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AbstractPayment.java	2000/11/09 13:13:49	1.2
+++ AbstractPayment.java	2001/02/27 14:00:07	1.3
@@ -1,5 +1,5 @@
 /*
- * $Id: AbstractPayment.java,v 1.2 2000/11/09 13:13:49 iang Exp $
+ * $Id: AbstractPayment.java,v 1.3 2001/02/27 14:00:07 iang Exp $
  *
  * Copyright (c) Systemics Inc 1995-2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -33,7 +33,6 @@
  * so developers of this class should be sure to cater
  * for derived classes.
  */
-    // this will become Abstract, later on when we add Payment
 public abstract class AbstractPayment
     extends Encodable implements Value
 {
@@ -43,7 +42,7 @@
      *         1:     AbstractPayment / PaymentFactory {cheque; token; wagner}
      */
     public static final int SINGLETON_VERSION = 0,   // sox 2 cheque only
-                            PF_VERSION = 1;          // PaymentFactory
+                            PF_VERSION = 1;          // use PaymentFactory
 
     protected int version;
     public int getVersion()               { return version; }
@@ -223,17 +222,22 @@
     {
         String s = "";     /* does not say what object, leave to subclass */
        
-        s += "  Q: " + qty;
-        s += "  of " + item.fp();
+        s += "  Q=" + qty;
+        s += "  of " + item.fp() + "  ";
+
         if (desc != null && desc.length > 0)
-            s += "  desc: " + Hex.printable(desc) +"\n";
+        {
+            if ((desc.length + s.length()) > 50)
+                s += "\n\t\t";
+            s += "desc: " + Hex.printable(desc) +"\n";
+        }
       
         return s;
     }  
        
     public String vString()
     {  
-        return "V" + subversion + " (" + version + ")";
+        return "subV" + subversion + " (v" + version + ")";
     }
 
     public boolean equals(java.lang.Object obj)