本文整理汇总了Java中org.jdeferred.DonePipe类的典型用法代码示例。如果您正苦于以下问题:Java DonePipe类的具体用法?Java DonePipe怎么用?Java DonePipe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DonePipe类属于org.jdeferred包,在下文中一共展示了DonePipe类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: i2cSendConditionPipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
private <D> DonePipe<D, BluetoothGattCharacteristic, BletiaException, Void> i2cSendConditionPipe(final int condition) {
return new DonePipe<D, BluetoothGattCharacteristic, BletiaException, Void>() {
@Override
public Promise<BluetoothGattCharacteristic, BletiaException, Void> pipeDone(D result) {
return execute(new I2cSendConditionAction(getKonashiService(), condition, mI2cStore));
}
};
}
开发者ID:YUKAI,项目名称:konashi-android-sdk,代码行数:9,代码来源:KonashiManager.java
示例2: i2cWritePipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
/**
* I2Cで指定したアドレスにデータを書き込む
* @param length 書き込むデータ(byte)の長さ。最大 Konashi.I2C_DATA_MAX_LENGTH (19)byteまで
* @param data 書き込むデータの配列
* @param address 書き込み先アドレス
*/
public <D> DonePipe<D, BluetoothGattCharacteristic, BletiaException, Void> i2cWritePipe(final int length, final byte[] data, final byte address) {
return new DonePipe<D, BluetoothGattCharacteristic, BletiaException, Void>() {
@Override
public Promise<BluetoothGattCharacteristic, BletiaException, Void> pipeDone(D result) {
return i2cWrite(length, data, address);
}
};
}
开发者ID:YUKAI,项目名称:konashi-android-sdk,代码行数:15,代码来源:KonashiManager.java
示例3: i2cRead
import org.jdeferred.DonePipe; //导入依赖的package包/类
/**
* I2Cで指定したアドレスからデータを読み込むリクエストを行う
* @param length 読み込むデータの長さ。最大 Konashi.I2C_DATA_MAX_LENGTHs (19)
* @param address 読み込み先のアドレス
*/
public Promise<byte[], BletiaException, Void> i2cRead(int length, byte address) {
return execute(new I2cSetReadParamAction(getKonashiService(), length, address, mI2cStore))
.then(mI2cDispatcher)
.then(new DonePipe<BluetoothGattCharacteristic, BluetoothGattCharacteristic, BletiaException, Void>() {
@Override
public Promise<BluetoothGattCharacteristic, BletiaException, Void> pipeDone(BluetoothGattCharacteristic result) {
return execute(new I2cReadAction(getKonashiService()));
}
})
.then(new I2cReadFilter());
}
开发者ID:YUKAI,项目名称:konashi-android-sdk,代码行数:17,代码来源:KonashiManager.java
示例4: i2cReadPipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
/**
* I2Cで指定したアドレスからデータを読み込むリクエストを行う
* @param length 読み込むデータの長さ。最大 Konashi.I2C_DATA_MAX_LENGTHs (19)
* @param address 読み込み先のアドレス
*/
public <D> DonePipe<D, byte[], BletiaException, Void> i2cReadPipe(final int length, final byte address) {
return new DonePipe<D, byte[], BletiaException, Void>() {
@Override
public Promise<byte[], BletiaException, Void> pipeDone(D result) {
return i2cRead(length, address);
}
};
}
开发者ID:YUKAI,项目名称:konashi-android-sdk,代码行数:14,代码来源:KonashiManager.java
示例5: pushMethod
import org.jdeferred.DonePipe; //导入依赖的package包/类
public Promise pushMethod(final ApiMethod method, final DelayedParams params) {
// With this clear all references to previous onDone, onFail and onAlways callbacks, avoiding possible
// memory leaks
if (! masterPromise.isPending())
masterPromise = new DeferredObject().resolve(model);
if ( ! modelCacheEnable ) {
method.setCacheDuration(DurationInMillis.ALWAYS_EXPIRED);
}
if ( forceNextCacheEnable != null ) {
method.setCacheDuration(forceNextCacheEnable ? ApiMethod.globalCacheDuration.get() : DurationInMillis.ALWAYS_EXPIRED);
forceNextCacheEnable = null;
}
if ( serially ){
serially = false;
return pushPipe(new DonePipe() {
@Override
public Deferred pipeDone(Object result) {
return method.run(params.buildParams(), params.buildUrlExtraSegments());
}
}, new FailPipe() {
@Override
public Deferred pipeFail(Object o) {
return new DeferredObject().reject(o);
}
});
}
else{
return pushDeferred(method.run(params.buildParams(), params.buildUrlExtraSegments()));
}
}
开发者ID:prashant31191,项目名称:meets-android,代码行数:34,代码来源:ApiMethodModelHelper.java
示例6: pushDeferred
import org.jdeferred.DonePipe; //导入依赖的package包/类
public Promise pushDeferred(final Deferred deferred){
masterPromise = (Deferred) masterPromise.then(new DonePipe() {
@Override
public Deferred pipeDone(Object result) {
return deferred;
}
}, new FailPipe() {
@Override
public Deferred pipeFail(Object result) {
return new DeferredObject().reject(result);
}
});
return masterPromise;
}
开发者ID:prashant31191,项目名称:meets-android,代码行数:16,代码来源:ApiMethodModelHelper.java
示例7: then
import org.jdeferred.DonePipe; //导入依赖的package包/类
@Override
public <D_OUT, F_OUT, P_OUT> Promise<D_OUT, F_OUT, P_OUT> then(
DonePipe<D, D_OUT, F_OUT, P_OUT> doneFilter,
FailPipe<F, D_OUT, F_OUT, P_OUT> failFilter,
ProgressPipe<P, D_OUT, F_OUT, P_OUT> progressFilter) {
return new PipedPromise<D, F, P, D_OUT, F_OUT, P_OUT>(this, doneFilter, failFilter, progressFilter);
}
开发者ID:jdeferred,项目名称:jdeferred,代码行数:8,代码来源:AbstractPromise.java
示例8: then
import org.jdeferred.DonePipe; //导入依赖的package包/类
@Override
public <D_OUT, F_OUT, P_OUT> Promise<D_OUT, F_OUT, P_OUT> then(
DonePipe<D, D_OUT, F_OUT, P_OUT> doneFilter,
FailPipe<F, D_OUT, F_OUT, P_OUT> failFilter,
ProgressPipe<P, D_OUT, F_OUT, P_OUT> progressFilter) {
return promise.then(doneFilter, failFilter, progressFilter);
}
开发者ID:jdeferred,项目名称:jdeferred,代码行数:8,代码来源:DeferredPromise.java
示例9: testDoneRewireFilter
import org.jdeferred.DonePipe; //导入依赖的package包/类
@Test
public void testDoneRewireFilter() {
final ValueHolder<Integer> preRewireValue = new ValueHolder<Integer>();
final ValueHolder<Integer> postRewireValue = new ValueHolder<Integer>();
Callable<Integer> task = new Callable<Integer>() {
public Integer call() {
return 100;
}
};
deferredManager.when(task).then(new DonePipe<Integer, Integer, Void, Void>() {
@Override
public Promise<Integer, Void, Void> pipeDone(Integer result) {
preRewireValue.set(result);
return new DeferredObject<Integer, Void, Void>().resolve(1000);
}
}).done(new DoneCallback<Integer>() {
@Override
public void onDone(Integer value) {
postRewireValue.set(value);
}
});
waitForCompletion();
preRewireValue.assertEquals(100);
postRewireValue.assertEquals(1000);
}
开发者ID:jdeferred,项目名称:jdeferred,代码行数:29,代码来源:PipedPromiseTest.java
示例10: then
import org.jdeferred.DonePipe; //导入依赖的package包/类
@Override
public <D_OUT, F_OUT, P_OUT> Promise<D_OUT, F_OUT, P_OUT> then(DonePipe<D, D_OUT, F_OUT, P_OUT> donePipe) {
return getDelegate().then(donePipe);
}
开发者ID:aalmiray,项目名称:javatrove,代码行数:5,代码来源:DelegatingPromise.java
示例11: i2cStartConditionPipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
/**
* I2Cのスタートコンディションを発行する
*/
public <D> DonePipe<D, BluetoothGattCharacteristic, BletiaException, Void> i2cStartConditionPipe() {
return i2cSendConditionPipe(Konashi.I2C_START_CONDITION);
}
开发者ID:YUKAI,项目名称:konashi-android-sdk,代码行数:7,代码来源:KonashiManager.java
示例12: i2cRestartConditionPipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
/**
* I2Cのリスタートコンディションを発行する
*/
public <D> DonePipe<D, BluetoothGattCharacteristic, BletiaException, Void> i2cRestartConditionPipe() {
return i2cSendConditionPipe(Konashi.I2C_RESTART_CONDITION);
}
开发者ID:YUKAI,项目名称:konashi-android-sdk,代码行数:7,代码来源:KonashiManager.java
示例13: i2cStopConditionPipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
/**
* I2Cのストップコンディションを発行する
*/
public <D> DonePipe<D, BluetoothGattCharacteristic, BletiaException, Void> i2cStopConditionPipe() {
return i2cSendConditionPipe(Konashi.I2C_STOP_CONDITION);
}
开发者ID:YUKAI,项目名称:konashi-android-sdk,代码行数:7,代码来源:KonashiManager.java
示例14: pushPipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
public Promise pushPipe(DonePipe donePipe, FailPipe failPipe) {
return apiMethodCtrl.pushPipe(donePipe, failPipe);
}
开发者ID:prashant31191,项目名称:meets-android,代码行数:4,代码来源:MageMeetsCollection.java
示例15: pushPipe
import org.jdeferred.DonePipe; //导入依赖的package包/类
public Promise pushPipe(DonePipe donePipe, FailPipe failPipe){
masterPromise = (Deferred) masterPromise.then(donePipe,failPipe);
return masterPromise;
}
开发者ID:prashant31191,项目名称:meets-android,代码行数:5,代码来源:ApiMethodModelHelper.java
注:本文中的org.jdeferred.DonePipe类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论