public class TransactionHandler extends com.google.common.collect.ForwardingCollection<Transaction> implements Transactions
| Constructor and Description |
|---|
TransactionHandler()
Do not instantiate.
|
| Modifier and Type | Method and Description |
|---|---|
int |
amount(int account,
Object person,
Object type)
Obtains the amount of an item as indicated by the amount field in each transaction
|
protected Collection<Transaction> |
delegate() |
void |
deposit(int account,
Transaction transaction)
Performs a transaction from the transaction's sender to the transaction's receiver
|
int |
globalEconomy()
The global economy ID to be used as the transaction ID
|
int |
globalExchange()
The global exchange ID to be used as the transaction ID
|
int |
newAcount()
Creates a new account from the internal account clock
|
boolean |
withdraw(int account,
Transaction transaction)
Withdraws an item from the account
|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRemoveAll, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArraypublic TransactionHandler()
To access this handler, use this code:
Transactions handler = Registered.transactions();
public int newAcount()
TransactionsnewAcount in interface Transactionspublic int globalEconomy()
TransactionsThis is just a recommendation to use for plugins. You do not need to use this.
globalEconomy in interface Transactionspublic int globalExchange()
TransactionsThis is just a recommendation to use for plugins. You do not need to use this.
globalExchange in interface Transactionspublic void deposit(int account, Transaction transaction)
Transactionsdeposit in interface Transactionsaccount - the account ID to be usedtransaction - the transaction to performpublic boolean withdraw(int account, Transaction transaction)
TransactionsIMPORTANT: The sender is the person withdrawing from the account. The receiver is not taken into
consideration, so that is allowed to be null.
withdraw in interface Transactionsaccount - the account ID to be usedtransaction - the transaction to performfalse if the account for the withdrawer does not exist, true if the transaction completes
successfullypublic int amount(int account, Object person, Object type)
Transactionsamount in interface Transactionsaccount - the account ID to be usedperson - the object which the transactions were sent to that is checked by this amountingtype - the types to find the amount of. Also the parameter in
Transaction.item()type found the account of person,
or Integer.MIN_VALUE if the account for person does not exist, or the accound ID is not
used for that personprotected Collection<Transaction> delegate()
delegate in class com.google.common.collect.ForwardingCollection<Transaction>Copyright © 2016. All rights reserved.