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


Java TupleInput类代码示例

本文整理汇总了Java中com.sleepycat.bind.tuple.TupleInput的典型用法代码示例。如果您正苦于以下问题:Java TupleInput类的具体用法?Java TupleInput怎么用?Java TupleInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TupleInput类属于com.sleepycat.bind.tuple包,在下文中一共展示了TupleInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public Beacon entryToObject(TupleInput ti) {
   String scannerID = ti.readString();
   String uuid = ti.readString();
   int code = ti.readInt();
   int manufacturer = ti.readInt();
   int major = ti.readInt();
   int minor = ti.readInt();
   int power = ti.readInt();
   int calibratedPower = ti.readInt();
   int rssi = ti.readInt();
   long time = ti.readLong();
   int messageType = ti.readInt();

   Beacon beacon = new Beacon(scannerID, uuid, code, manufacturer, major, minor, power, rssi, time);
   beacon.setCalibratedPower(calibratedPower);
   beacon.setMessageType(messageType);

   return beacon;
}
 
开发者ID:starksm64,项目名称:RaspberryPiBeaconParser,代码行数:20,代码来源:BeaconBinding.java

示例2: createSecondaryKeys

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public void createSecondaryKeys(TupleInput primaryKeyInput, TupleInput dataInput, Set<TupleOutput> indexKeys) {
    TupleOutput interval;
    
    dataInput.skipFast(13);
    startTimeInterval = dataInput.readUnsignedInt();
    startTimeInterval >>= 10;
    
    dataInput.skipFast(4);
    endTimeInterval = dataInput.readUnsignedInt();
    endTimeInterval >>= 10;
    
    for (long i = startTimeInterval; i <= endTimeInterval; ++i) {
        interval = getTupleOutput(null);
        interval.writeUnsignedInt(i);
        indexKeys.add(interval);
    }
}
 
开发者ID:nologic,项目名称:nabs,代码行数:19,代码来源:FlowIDExistTimeKeyCreator.java

示例3: runReflectField

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
int runReflectField()
    throws Exception {

    to.reset();
    Data data = new Data();
    to.writeString((String) fields[0].get(data));
    to.writeString((String) fields[1].get(data));
    to.writeInt(((Integer) fields[2].get(data)).intValue());
    to.writeInt(((Integer) fields[3].get(data)).intValue());
    to.writeString((String) fields[4].get(data));

    TupleInput ti = new TupleInput(
                      to.getBufferBytes(), to.getBufferOffset(),
                      to.getBufferLength());
    data = new Data();
    fields[0].set(data, ti.readString());
    fields[1].set(data, ti.readString());
    fields[2].set(data, new Integer(ti.readInt()));
    fields[3].set(data, new Integer(ti.readInt()));
    fields[4].set(data, ti.readString());

    return to.getBufferLength();
}
 
开发者ID:nologic,项目名称:nabs,代码行数:24,代码来源:BindingSpeedTest.java

示例4: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public VLSNRange entryToObject(final TupleInput ti) {
    int onDiskVersion = ti.readPackedInt();
    if (onDiskVersion != VERSION) {
        throw EnvironmentFailureException.unexpectedState
            ("Don't expect version diff " +
             "on_disk=" + onDiskVersion +
             " source=" +
             VERSION);
    }

    VLSNRange range =
        new VLSNRange(new VLSN(ti.readPackedLong()), // first
                      new VLSN(ti.readPackedLong()), // last
                      new VLSN(ti.readPackedLong()), // lastSync
                      new VLSN(ti.readPackedLong())); // lastTxnEnd
    return range;
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:19,代码来源:VLSNRange.java

示例5: runReflectMethod

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
int runReflectMethod()
    throws Exception {

    to.reset();
    Data data = new Data();
    to.writeString((String) getters[0].invoke(data, (Object[]) null));
    to.writeString((String) getters[1].invoke(data, (Object[]) null));
    to.writeInt(((Integer) getters[2].invoke(data, (Object[]) null)).intValue());
    to.writeInt(((Integer) getters[3].invoke(data, (Object[]) null)).intValue());
    to.writeString((String) getters[4].invoke(data, (Object[]) null));

    TupleInput ti = new TupleInput(
                      to.getBufferBytes(), to.getBufferOffset(),
                      to.getBufferLength());
    data = new Data();
    setters[0].invoke(data, new Object[] {ti.readString()});
    setters[1].invoke(data, new Object[] {ti.readString()});
    setters[2].invoke(data, new Object[] {new Integer(ti.readInt())});
    setters[3].invoke(data, new Object[] {new Integer(ti.readInt())});
    setters[4].invoke(data, new Object[] {ti.readString()});

    return to.getBufferLength();
}
 
开发者ID:nologic,项目名称:nabs,代码行数:24,代码来源:BindingSpeedTest.java

示例6: createSecondaryKey

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
/**
 * @param secondary
 * @param key
 * @param data
 * @param result
 */
public boolean createSecondaryKey(SecondaryDatabase secondary,
		DatabaseEntry key, DatabaseEntry data, DatabaseEntry result) {
	TupleInput dataInput = new TupleInput(data.getData());
	TupleOutput indexKeyOutput = new TupleOutput();
	int p = idxList.size() - 1;
	for(int l = 0; l < size && p >= 0; l++) {
	   long tmp = dataInput.readLong();
		   if(l == idxList.get(p)) {
			   indexKeyOutput.writeLong(tmp);
			   p--;
		   }
	}
	result.setData(indexKeyOutput.getBufferBytes());
	return true;
}
 
开发者ID:KMax,项目名称:cqels,代码行数:22,代码来源:BDBGraphPatternRouter.java

示例7: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public Object entryToObject(TupleInput ti) {

        String sku = ti.readString();
        String itemName = ti.readString();
        String category = ti.readString();
        String vendor = ti.readString();
        int vendorInventory = ti.readInt();
        float vendorPrice = ti.readFloat();

        Inventory inventory = new Inventory();
        inventory.setSku(sku);
        inventory.setItemName(itemName);
        inventory.setCategory(category);
        inventory.setVendor(vendor);
        inventory.setVendorInventory(vendorInventory);
        inventory.setVendorPrice(vendorPrice);

        return inventory;
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:20,代码来源:InventoryBinding.java

示例8: createSecondaryKey

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public boolean createSecondaryKey(SecondaryDatabase db,
                                  DatabaseEntry primaryKeyEntry,
                                  DatabaseEntry dataEntry,
                                  DatabaseEntry indexKeyEntry)
    throws DatabaseException {

    TupleOutput output = getTupleOutput(null);
    TupleInput primaryKeyInput = entryToInput(primaryKeyEntry);
    Object dataInput = dataBinding.entryToObject(dataEntry);
    if (createSecondaryKey(primaryKeyInput, dataInput, output)) {
        outputToEntry(output, indexKeyEntry);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:nologic,项目名称:nabs,代码行数:17,代码来源:TupleSerialKeyCreator.java

示例9: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {
  int numberofentries = ti.readInt();
  SortedIntList2FloatMap map = new SortedIntList2FloatMap(numberofentries);
  //float squarednorm = ti.readFloat();
  ti.readFloat();
  for (int i = 0; i < numberofentries; i++) {
    map.addEntry(ti.readInt(), ti.readFloat());
  }
  ConceptVector conceptvector = new ConceptVector(ontology, map);
  return conceptvector;
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:13,代码来源:RecordDataBaseBinding.java

示例10: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {
  ConceptToConceptVectorRecordIndexEntry conceptToRecordIndexEntry = new ConceptToConceptVectorRecordIndexEntry();
  conceptToRecordIndexEntry.sumOfValuesInRecords = ti.readFloat();
  int numberofentries = ti.readInt();
  IntList list = new IntList(numberofentries);
  
  for (int i=0; i<numberofentries;i++){
    list.add(ti.readInt());
  }
  conceptToRecordIndexEntry.conceptVectorRecordIDs = new SortedIntListSet(list);
  
  return conceptToRecordIndexEntry;
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:15,代码来源:ConceptToRecordIndexEntryBinding.java

示例11: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {

  int numberofentries = ti.readInt();
  IntList list = new IntList(numberofentries);

  for (int i = 0; i < numberofentries; i++) {

    list.add(ti.readInt());
  }
  SortedIntListSet set = new SortedIntListSet(list);

  return set;
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:15,代码来源:IntegerToSetOfIntegersBinding.java

示例12: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput arg0) {
  BatchwiseIntegerID result = new BatchwiseIntegerID();
  result.batchID=arg0.readInt();
  result.ID=arg0.readInt();
  return result;
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:8,代码来源:BatchNumberAndIntegerIDBinding.java

示例13: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {
  int size = ti.readInt();
  SortedIntList2IntMap result  = new SortedIntList2IntMap(size);
  for (int i=0;i<size;i++){
    result.addEntry(ti.readInt(), ti.readInt());
  }
  return result;
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:10,代码来源:Integer2Integer2IntegerMapBinding.java

示例14: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public HGPersistentHandle[] entryToObject(TupleInput input) {
	int size = input.getBufferLength() - input.getBufferOffset();
	if (size % handleSize != 0) {
		throw new HGException(
				"While reading link tuple: the value buffer size is not a multiple of the handle size.");
	}
	else {
		return readHandles(input.getBufferBytes(), 0, size);
	}
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:11,代码来源:LinkBinding.java

示例15: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public HGPersistentHandle[] entryToObject(TupleInput input)
{
    int size = input.getBufferLength() - input.getBufferOffset();
    if (size % handleSize != 0)
        throw new HGException("While reading link tuple: the value buffer size is not a multiple of the handle size.");
    else
    	return readHandles(input.getBufferBytes(), 0, size);
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:9,代码来源:LinkBinding.java


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