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


Java TupleOutput类代码示例

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


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

示例1: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
@Override
public void objectToEntry(Object conceptVectorObject, TupleOutput to) {
  ConceptVector conceptvector = (ConceptVector) conceptVectorObject;
  int numberofentries = conceptvector.getStoredValueCount();
  to.writeInt(numberofentries);
  if (conceptvector.isSquaredNormCalculated()) {
    to.writeFloat(conceptvector.getSquaredNorm().floatValue());
  }
  else {
    to.writeFloat(-1f);
  }
  MapCursor<Integer, Float> entrycursor = conceptvector.values.getEntryCursor();
  while (entrycursor.isValid()) {
    to.writeInt(entrycursor.key());
    to.writeFloat(entrycursor.value());
    entrycursor.next();
  }
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:19,代码来源:RecordDataBaseBinding.java

示例2: createSecondaryKeys

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

示例3: createSecondaryKey

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
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;
	//System.out.println("key lenght"+idxList.size());
	for(int l = 0; l < size && p >= 0; l++) {
	   long tmp = dataInput.readLong();
	   //while(p>=0)
		   if(l == idxList.get(p)) {
			  // System.out.print("key "+l+" = "+tmp +" ");
			   indexKeyOutput.writeLong(tmp);
			   p--;
		   }
	}
	 //System.out.println("");
	result.setData(indexKeyOutput.getBufferBytes());
	return true;
}
 
开发者ID:KMax,项目名称:cqels,代码行数:20,代码来源:IndexedOnWindowBuff.java

示例4: createSecondaryKey

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的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

示例5: createSecondaryKey

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的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

示例6: testBufferOverride

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

        TupleOutput out = new TupleOutput(new byte[10]);
        CachedOutputBinding binding = new CachedOutputBinding(out);

        binding.used = false;
        binding.objectToEntry("x", buffer);
        assertEquals("x", binding.entryToObject(buffer));
        assertTrue(binding.used);

        binding.used = false;
        binding.objectToEntry("aaaaaaaaaaaaaaaaaaaaaa", buffer);
        assertEquals("aaaaaaaaaaaaaaaaaaaaaa", binding.entryToObject(buffer));
        assertTrue(binding.used);

        binding.used = false;
        binding.objectToEntry("x", buffer);
        assertEquals("x", binding.entryToObject(buffer));
        assertTrue(binding.used);
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:21,代码来源:TupleBindingTest.java

示例7: marshalSecondaryKey

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
public boolean marshalSecondaryKey(String keyName, TupleOutput keyOutput) {

        if ("1".equals(keyName)) {
            if (indexKey1.length() > 0) {
                keyOutput.writeString(indexKey1);
                return true;
            } else {
                return false;
            }
        } else if ("2".equals(keyName)) {
            if (indexKey1.length() > 0) {
                keyOutput.writeString(indexKey2);
                return true;
            } else {
                return false;
            }
        } else {
            throw new IllegalArgumentException("Unknown keyName: " + keyName);
        }
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:21,代码来源:MarshalledObject.java

示例8: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
@Override
public void objectToEntry(Object object, TupleOutput to) {
  ConceptToConceptVectorRecordIndexEntry conceptToRecordIndexEntry = (ConceptToConceptVectorRecordIndexEntry) object;
  to.writeFloat(conceptToRecordIndexEntry.sumOfValuesInRecords);
  int numberofentries = conceptToRecordIndexEntry.conceptVectorRecordIDs.size();
  to.writeInt(numberofentries);
  Iterator<Integer> iterator = conceptToRecordIndexEntry.conceptVectorRecordIDs.iterator();
  while (iterator.hasNext()){
    to.writeInt(iterator.next());
  }

}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:13,代码来源:ConceptToRecordIndexEntryBinding.java

示例9: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
@Override
public void objectToEntry(Object arg0, TupleOutput to) {
  SortedIntListSet set = (SortedIntListSet) arg0;
  int numberofentries = set.size();
  to.writeInt(numberofentries);
  Iterator<Integer> iterator = set.iterator();
  while (iterator.hasNext()) {
    to.writeInt(iterator.next());
  }
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:11,代码来源:IntegerToSetOfIntegersBinding.java

示例10: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
@Override
public void objectToEntry(Object obj, TupleOutput to) {
  SortedIntList2IntMap map = (SortedIntList2IntMap)obj;
  to.writeInt(map.size());
  Iterator<MapEntry> it = map.entryIterator();
  while(it.hasNext()){
    MapEntry me = it.next();
    to.writeInt(me.getKey());
    to.writeInt(me.getValue());
  }
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:12,代码来源:Integer2Integer2IntegerMapBinding.java

示例11: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
public void objectToEntry(HGPersistentHandle[] link, TupleOutput output) {
	//HGPersistentHandle[] link = (HGPersistentHandle[])x;
	byte[] buffer = new byte[link.length * handleSize];
	for (int i = 0; i < link.length; i++) {
		HGPersistentHandle handle = (HGPersistentHandle)link[i];
		System.arraycopy(handle.toByteArray(), 0, buffer, i * handleSize, handleSize);
	}
	output.writeFast(buffer);
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:10,代码来源:LinkBinding.java

示例12: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
public void objectToEntry(HGPersistentHandle[] link, TupleOutput output)
{
    byte [] buffer = new byte[link.length * handleSize];
    for (int i = 0; i < link.length; i++)
    {
        HGPersistentHandle handle = (HGPersistentHandle)link[i];
        System.arraycopy(handle.toByteArray(), 0, 
                         buffer, i*handleSize, 
                         handleSize);            
    }
    output.writeFast(buffer);
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:13,代码来源:LinkBinding.java

示例13: 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

示例14: intKey

import com.sleepycat.bind.tuple.TupleOutput; //导入依赖的package包/类
private byte[] intKey(long fileNum, long seqNum) {

        TupleOutput out = new TupleOutput();
        out.writeUnsignedInt(fileNum);
        out.writeUnsignedInt(seqNum);
        return out.toByteArray();
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:8,代码来源:SR13061Test.java

示例15: 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


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