[Webfunds-commits] java/webfunds/sox AbstractPayment.java AccountId.java Payment.java
Ian Grigg
iang@cypherpunks.ai
Thu, 22 Mar 2001 21:19:58 -0400 (AST)
iang 01/03/22 21:19:58
Modified: webfunds/sox AbstractPayment.java AccountId.java
Payment.java
Log:
changed over methods and strings to use CASH instead of BEARER
Revision Changes Path
1.4 +4 -4 java/webfunds/sox/AbstractPayment.java
Index: AbstractPayment.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/AbstractPayment.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractPayment.java 2001/02/27 14:00:07 1.3
+++ AbstractPayment.java 2001/03/23 01:19:57 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: AbstractPayment.java,v 1.3 2001/02/27 14:00:07 iang Exp $
+ * $Id: AbstractPayment.java,v 1.4 2001/03/23 01:19:57 iang Exp $
*
* Copyright (c) Systemics Inc 1995-2000 on behalf of
* the WebFunds Development Team. All Rights Reserved.
@@ -64,14 +64,14 @@
* Get the account from which the transaction is drawn,
* should be overridden for sourced payments.
*/
- public AccountId getSource() { return AccountId.BEARER; }
+ public AccountId getSource() { return AccountId.CASH; }
/**
* Get the account to which the payment is made,
* should be overridden for targetted payments.
*/
- public AccountId getTarget() { return AccountId.BEARER; }
- public boolean isBearer() { return true; }
+ public AccountId getTarget() { return AccountId.CASH; }
+ public boolean isCash() { return true; }
/**
* The identifer for this payment. This is used locally for
1.23 +13 -8 java/webfunds/sox/AccountId.java
Index: AccountId.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/AccountId.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- AccountId.java 2001/02/27 14:01:27 1.22
+++ AccountId.java 2001/03/23 01:19:57 1.23
@@ -1,4 +1,4 @@
-/* $Id: AccountId.java,v 1.22 2001/02/27 14:01:27 iang Exp $
+/* $Id: AccountId.java,v 1.23 2001/03/23 01:19:57 iang Exp $
*
* Copyright (c) Systemics Inc. 1995-2000 on behalf of
* the WebFunds Development Team. All Rights Reserved.
@@ -14,7 +14,7 @@
* This class represents an Account identifier,
* which is the standard way of referring to an account.
*
- * @version $Revision: 1.22 $
+ * @version $Revision: 1.23 $
*/
public class AccountId extends Id
{
@@ -38,15 +38,18 @@
id = Crypto.fingerprint(pk);
}
- public boolean isBearer()
+ public boolean isCash()
{
// Encodeable currently transfers null to byte[0] ...
return this.id == null || this.id.length == 0;
}
- public static final AccountId BEARER = new AccountId(); // empty is bearer
+ public boolean isBearer() { return isCash(); }
+ public static final AccountId BEARER = new AccountId(); // empty is bearer
+ public static final AccountId CASH = new AccountId(); // empty is open
+
public boolean equals(Object object)
{
if(!(object instanceof AccountId))
@@ -59,18 +62,20 @@
////// Self-Test //////////////////////////////////
+ public static String CASH_STRING = "<CASH>";
+
public String toString()
{
- if (id == null || id.length == 0)
- return "BEARER";
+ if (isCash())
+ return CASH_STRING;
return super.toString();
}
public String fp()
{
- if (id == null || id.length == 0)
- return "<BEARER>";
+ if (isCash())
+ return CASH_STRING;
return super.fp();
}
1.28 +4 -4 java/webfunds/sox/Payment.java
Index: Payment.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Payment.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- Payment.java 2001/03/18 23:22:01 1.27
+++ Payment.java 2001/03/23 01:19:57 1.28
@@ -1,5 +1,5 @@
/*
- * $Id: Payment.java,v 1.27 2001/03/18 23:22:01 iang Exp $
+ * $Id: Payment.java,v 1.28 2001/03/23 01:19:57 iang Exp $
*
* Copyright (c) Systemics Inc 1995-2000 on behalf of
* the WebFunds Development Team. All Rights Reserved.
@@ -38,7 +38,7 @@
/**
* The type of payment of this class
* There is currently only one defined, but future payment
- * types may include things such as bearer payments, coins,
+ * types may include things such as token payments, coins,
* bank transfers and hash chain payments
*/
public static final int TYPE = PaymentFactory.SOX_CHEQUE;
@@ -114,9 +114,9 @@
public AccountId getTarget() { return target; }
/**
- * @return true if the payment is made out to BEARER
+ * @return true if the payment is made out to CASH
*/
- public boolean isBearer() { return target.isBearer(); }
+ public boolean isCash() { return target.isCash(); }
/**
* Get the date from which the payment is valid