当前位置: 首页>>代码示例>>Java>>正文


Java TupleOutput.writeString方法代码示例

本文整理汇总了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);
        }
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:13,代码来源:Shipment.java

示例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;
}
 
开发者ID:nologic,项目名称:nabs,代码行数:15,代码来源:SampleDatabase.java

示例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);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:38,代码来源:TupleBindingTest.java

示例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());
}
 
开发者ID:nologic,项目名称:nabs,代码行数:10,代码来源:SampleViews.java

示例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;
}
 
开发者ID:nologic,项目名称:nabs,代码行数:14,代码来源:SampleDatabase.java

示例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;
		}
}
 
开发者ID:mwsobol,项目名称:SORCER,代码行数:19,代码来源:SorcerDatabase.java

示例7: marshalKey

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void marshalKey(TupleOutput keyOutput) {

        keyOutput.writeString(this.partNumber);
        keyOutput.writeString(this.supplierNumber);
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:6,代码来源:ShipmentKey.java

示例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());
}
 
开发者ID:nologic,项目名称:nabs,代码行数:9,代码来源:SampleViews.java

示例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);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:5,代码来源:TupleBindingTest.java

示例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());
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:9,代码来源:SampleViews.java

示例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());
}
 
开发者ID:nologic,项目名称:nabs,代码行数:9,代码来源:SampleViews.java

示例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());
}
 
开发者ID:nologic,项目名称:nabs,代码行数:9,代码来源:SampleViews.java

示例13: marshalPrimaryKey

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void marshalPrimaryKey(TupleOutput keyOutput) {

        keyOutput.writeString(this.number);
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:5,代码来源:Part.java

示例14: marshalEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void marshalEntry(TupleOutput keyOutput) {

        keyOutput.writeString(this.number);
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:5,代码来源:SupplierKey.java


注:本文中的com.sleepycat.bind.tuple.TupleOutput.writeString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。