本文整理汇总了Java中org.bitcoinj.wallet.listeners.WalletCoinsSentEventListener类的典型用法代码示例。如果您正苦于以下问题:Java WalletCoinsSentEventListener类的具体用法?Java WalletCoinsSentEventListener怎么用?Java WalletCoinsSentEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WalletCoinsSentEventListener类属于org.bitcoinj.wallet.listeners包,在下文中一共展示了WalletCoinsSentEventListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queueOnCoinsSent
import org.bitcoinj.wallet.listeners.WalletCoinsSentEventListener; //导入依赖的package包/类
protected void queueOnCoinsSent(final Transaction tx, final Coin prevBalance, final Coin newBalance) {
checkState(lock.isHeldByCurrentThread());
for (final ListenerRegistration<WalletCoinsSentEventListener> registration : coinsSentListeners) {
registration.executor.execute(new Runnable() {
@Override
public void run() {
registration.listener.onCoinsSent(Wallet.this, tx, prevBalance, newBalance);
}
});
}
}
示例2: addCoinsSentEventListener
import org.bitcoinj.wallet.listeners.WalletCoinsSentEventListener; //导入依赖的package包/类
/**
* Adds an event listener object called when coins are sent.
* The listener is executed by the given executor.
*/
public void addCoinsSentEventListener(Executor executor, WalletCoinsSentEventListener listener) {
// This is thread safe, so we don't need to take the lock.
coinsSentListeners.add(new ListenerRegistration<>(listener, executor));
}
示例3: addCoinsSentEventListener
import org.bitcoinj.wallet.listeners.WalletCoinsSentEventListener; //导入依赖的package包/类
/**
* Adds an event listener object called when coins are sent.
* The listener is executed by the given executor.
*/
public void addCoinsSentEventListener(Executor executor, WalletCoinsSentEventListener listener) {
// This is thread safe, so we don't need to take the lock.
coinsSentListeners.add(new ListenerRegistration<WalletCoinsSentEventListener>(listener, executor));
}
示例4: removeCoinsSentEventListener
import org.bitcoinj.wallet.listeners.WalletCoinsSentEventListener; //导入依赖的package包/类
/**
* Removes the given event listener object. Returns true if the listener was removed, false if that listener
* was never added.
*/
public boolean removeCoinsSentEventListener(WalletCoinsSentEventListener listener) {
return ListenerRegistration.removeFromList(listener, coinsSentListeners);
}