本文整理汇总了Java中com.sleepycat.bind.tuple.TupleOutput.writeString方法的典型用法代码示例。如果您正苦于以下问题:Java TupleOutput.writeString方法的具体用法?Java TupleOutput.writeString怎么用?Java TupleOutput.writeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sleepycat.bind.tuple.TupleOutput
的用法示例。
在下文中一共展示了TupleOutput.writeString方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: marshalSecondaryKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public boolean marshalSecondaryKey(String keyName, TupleOutput keyOutput) {
if (keyName.equals(PART_KEY)) {
keyOutput.writeString(this.partNumber);
return true;
} else if (keyName.equals(SUPPLIER_KEY)) {
keyOutput.writeString(this.supplierNumber);
return true;
} else {
throw new UnsupportedOperationException(keyName);
}
}
示例2: createSecondaryKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Extract the supplier key from a shipment key/value pair. The
* supplier key is stored in the shipment key, so the shipment value is
* not used.
*/
public boolean createSecondaryKey(TupleInput primaryKeyInput,
Object valueInput,
TupleOutput indexKeyOutput) {
primaryKeyInput.readString(); // skip the partNumber
String supplierNumber = primaryKeyInput.readString();
indexKeyOutput.writeString(supplierNumber);
return true;
}
示例3: primitiveBindingTest
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
private void primitiveBindingTest(Class primitiveCls, Class compareCls,
Object val, int byteSize) {
TupleBinding binding = TupleBinding.getPrimitiveBinding(primitiveCls);
/* Test standard object binding. */
binding.objectToEntry(val, buffer);
assertEquals(byteSize, buffer.getSize());
Object val2 = binding.entryToObject(buffer);
assertSame(compareCls, val2.getClass());
assertEquals(val, val2);
Object valWithWrongCls = (primitiveCls == String.class)
? ((Object) new Integer(0)) : ((Object) new String(""));
try {
binding.objectToEntry(valWithWrongCls, buffer);
}
catch (ClassCastException expected) {}
/* Test nested tuple binding. */
TupleOutput output = new TupleOutput();
output.writeString("abc");
binding.objectToEntry(val, output);
output.writeString("xyz");
TupleInput input = new TupleInput(output);
assertEquals("abc", input.readString());
Object val3 = binding.entryToObject(input);
assertEquals("xyz", input.readString());
assertEquals(0, input.available());
assertSame(compareCls, val3.getClass());
assertEquals(val, val3);
}
示例4: objectToEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Create the stored key tuple entry from the key object.
*/
public void objectToEntry(Object object, TupleOutput output) {
ShipmentKey key = (ShipmentKey) object;
output.writeString(key.getPartNumber());
output.writeString(key.getSupplierNumber());
}
示例5: createSecondaryKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Extract the part key from a shipment key/value pair. The part key
* is stored in the shipment key, so the shipment value is not used.
*/
public boolean createSecondaryKey(TupleInput primaryKeyInput,
Object valueInput,
TupleOutput indexKeyOutput) {
String partNumber = primaryKeyInput.readString();
// don't bother reading the supplierNumber
indexKeyOutput.writeString(partNumber);
return true;
}
示例6: createSecondaryKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Extract the city key from a supplier key/eval pair. The city key
* is stored in the supplier eval, so the supplier key is not used.
*/
public boolean createSecondaryKey(TupleInput primaryKeyInput,
Object valueInput, TupleOutput indexKeyOutput) {
sorcer.core.provider.ProviderRuntime runtime
= (sorcer.core.provider.ProviderRuntime) valueInput;
String providerName;
providerName = runtime.getProviderName();
if (providerName != null) {
indexKeyOutput.writeString(runtime.getProviderName());
return true;
} else {
return false;
}
}
示例7: marshalKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void marshalKey(TupleOutput keyOutput) {
keyOutput.writeString(this.partNumber);
keyOutput.writeString(this.supplierNumber);
}
示例8: objectToKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Create the stored key from the entity.
*/
public void objectToKey(Object object, TupleOutput output) {
Supplier supplier = (Supplier) object;
output.writeString(supplier.getNumber());
}
示例9: objectToEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void objectToEntry(Object object, TupleOutput output) {
assertEquals(bufSize, output.getBufferBytes().length);
output.writeString((String) object);
}
示例10: objectToEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Create the stored key tuple entry from the key object.
*/
public void objectToEntry(Object object, TupleOutput output) {
SupplierKey key = (SupplierKey) object;
output.writeString(key.getNumber());
}
示例11: objectToEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Create the stored key tuple entry from the key object.
*/
public void objectToEntry(Object object, TupleOutput output) {
PartKey key = (PartKey) object;
output.writeString(key.getNumber());
}
示例12: objectToKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Create the stored key from the entity.
*/
public void objectToKey(Object object, TupleOutput output) {
Part part = (Part) object;
output.writeString(part.getNumber());
}
示例13: marshalPrimaryKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void marshalPrimaryKey(TupleOutput keyOutput) {
keyOutput.writeString(this.number);
}
示例14: marshalEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void marshalEntry(TupleOutput keyOutput) {
keyOutput.writeString(this.number);
}