public class AccountLedger
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AccountLedger.Event
Account ledger listener events
|
static class |
AccountLedger.LedgerEntry
Ledger entry
|
static class |
AccountLedger.LedgerEvent
Ledger events
There must be a ledger event defined for each transaction (type,subtype) pair.
|
static class |
AccountLedger.LedgerHolding
Ledger holdings
When adding a new holding, do not change the existing code assignments since
they are stored in the holding_type field of the account_ledger table.
|
Constructor and Description |
---|
AccountLedger() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addListener(Listener<AccountLedger.LedgerEntry> listener,
AccountLedger.Event eventType)
Add a listener
|
static java.util.List<AccountLedger.LedgerEntry> |
getEntries(long accountId,
AccountLedger.LedgerEvent event,
long eventId,
AccountLedger.LedgerHolding holding,
long holdingId,
int firstIndex,
int lastIndex)
Return the ledger entries sorted in descending insert order
If an account identifier is supplied, then firstIndex and lastIndex are relative
to entries for that account where index 0 is the latest entry for the account.
|
static AccountLedger.LedgerEntry |
getEntry(long ledgerId)
Return a single entry identified by the ledger entry identifier
|
static void |
init()
Initialization
We don't do anything but we need to be called from Nxt.init() in order to
register our table
|
static boolean |
removeListener(Listener<AccountLedger.LedgerEntry> listener,
AccountLedger.Event eventType)
Remove a listener
|
public static void init()
public static boolean addListener(Listener<AccountLedger.LedgerEntry> listener, AccountLedger.Event eventType)
listener
- ListenereventType
- Event to listen forpublic static boolean removeListener(Listener<AccountLedger.LedgerEntry> listener, AccountLedger.Event eventType)
listener
- ListenereventType
- Event to listen forpublic static AccountLedger.LedgerEntry getEntry(long ledgerId)
ledgerId
- Ledger entry identifierpublic static java.util.List<AccountLedger.LedgerEntry> getEntries(long accountId, AccountLedger.LedgerEvent event, long eventId, AccountLedger.LedgerHolding holding, long holdingId, int firstIndex, int lastIndex)
accountId
- Account identifier or zero if no account identifierevent
- Ledger event or nulleventId
- Ledger event identifier or zero if no event identifierholding
- Ledger holding or nullholdingId
- Ledger holding identifier or zero if no holding identifierfirstIndex
- First entry indexlastIndex
- Last entry index