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


Java TupleOutput.writeInt方法代码示例

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


在下文中一共展示了TupleOutput.writeInt方法的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: 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

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

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

示例5: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToEntry(WebURL url, TupleOutput output) {		
	output.writeString(url.getURL());
	output.writeInt(url.getDocid());
	output.writeInt(url.getParentDocid());
	output.writeString(url.getParentUrl());
	output.writeShort(url.getDepth());
	output.writeByte(url.getPriority());
	output.writeString(url.getAnchor());
}
 
开发者ID:Chaiavi,项目名称:Crawler4j,代码行数:11,代码来源:WebURLTupleBinding.java

示例6: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void objectToEntry(Object object, TupleOutput to) {

        Inventory inventory = (Inventory)object;

        to.writeString(inventory.getSku());
        to.writeString(inventory.getItemName());
        to.writeString(inventory.getCategory());
        to.writeString(inventory.getVendor());
        to.writeInt(inventory.getVendorInventory());
        to.writeFloat(inventory.getVendorPrice());
    }
 
开发者ID:nologic,项目名称:nabs,代码行数:12,代码来源:InventoryBinding.java

示例7: setKey

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
 * Outputs an integer followed by pad bytes.
 */
private void setKey(DatabaseEntry entry, int val, int len) {
    TupleOutput out = new TupleOutput();
    out.writeInt(val);
    for (int i = 0; i < len - 4; i += 1) {
        out.writeByte(0);
    }
    TupleBase.outputToEntry(out, entry);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:12,代码来源:BackgroundIOTest.java

示例8: make2PartEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
 * Writes two integers to the byte array.
 */
private void make2PartEntry(int p1, int p2, DatabaseEntry entry) {
    TupleOutput output = new TupleOutput();
    output.writeInt(p1);
    output.writeInt(p2);
    TupleBase.outputToEntry(output, entry);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:10,代码来源:DatabaseComparatorsTest.java

示例9: doInserts

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

    DatabaseEntry data = new DatabaseEntry(new byte[dataSize]);
    DatabaseEntry key = new DatabaseEntry();
    byte[] keyBuffer = new byte[keySize];
    byte[] keyPadding = new byte[keySize - 4];

    Transaction txn = null;

    for (int i = 1; i <= records; i += 1) {

        TupleOutput keyOutput = new TupleOutput(keyBuffer);
        keyOutput.writeInt(i);
        keyOutput.writeFast(keyPadding);
        TupleBinding.outputToEntry(keyOutput, key);

        if (isTransactional() && txn == null) {
            txn = env.beginTransaction(null, null);
        }

        db.put(txn, key, data);

        if (txn != null && i % insertsPerTxn == 0) {
            txn.commit();
            txn = null;
        }
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:30,代码来源:MeasureInsertSize.java

示例10: writeTuple

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

            _output.writeString(field1);
            _output.writeString(field2);
            _output.writeInt(field3);
            _output.writeInt(field4);
            _output.writeString(field5);
        }
 
开发者ID:nologic,项目名称:nabs,代码行数:9,代码来源:BindingSpeedTest.java

示例11: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToEntry(RepGroupImpl group, TupleOutput output) {
  output.writeString(group.getName());
  output.writeLong(group.getUUID().getMostSignificantBits());
  output.writeLong(group.getUUID().getLeastSignificantBits());
  output.writeInt(group.getVersion());
  output.writeInt(group.getChangeVersion());
  output.writeInt(group.getNodeIdSequence());
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:10,代码来源:RepGroupDB.java

示例12: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
public void objectToEntry(Beacon beacon, TupleOutput to) {
   to.writeString(beacon.getScannerID());
   to.writeString(beacon.getUUID());
   to.writeInt(beacon.getCode());
   to.writeInt(beacon.getManufacturer());
   to.writeInt(beacon.getMajor());
   to.writeInt(beacon.getMinor());
   to.writeInt(beacon.getPower());
   to.writeInt(beacon.getPower());
   to.writeInt(beacon.getRssi());
   to.writeLong(beacon.getTime());
   to.writeInt(beacon.getMessageType());
}
 
开发者ID:starksm64,项目名称:RaspberryPiBeaconParser,代码行数:14,代码来源:BeaconBinding.java

示例13: doMdcToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
private static void doMdcToEntry(final MetaDataContainer metaDataContainer, final TupleOutput to) {
	to.writeInt(metaDataContainer.getMetaDataSet().size());
	for (final MetaData metaData : metaDataContainer.getMetaDataSet()) {
		Assertion.checkArgument(metaData instanceof Enum, "Les MetaData doivent �tre des enums pour �tre serializable !! {0} est une {1}", metaData, metaData.getClass().getName());
		//-----------------------------------------------------------------
		to.writeString(metaData.getClass().getName());
		to.writeString(metaData.toString());//TODO :WARN ne marche que parceque ce sont des enums !!
		final Object value = metaDataContainer.getValue(metaData);
		to.writeBoolean(value != null);
		if (value != null) {
			switch (metaData.getType()) {
				case DATE:
					to.writeLong(((Date) value).getTime());
					break;
				case INTEGER:
					to.writeInt((Integer) value);
					break;
				case LONG:
					to.writeLong((Long) value);
					break;
				case STRING:
					to.writeString((String) value);
					break;
				default:
					throw new IllegalStateException();
			}
		}
	}
}
 
开发者ID:KleeGroup,项目名称:vertigo-labs,代码行数:30,代码来源:DocumentBinding.java

示例14: writeValue

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
private static void writeValue(final TupleOutput to, final Object value) {
	if (value == null) {
		to.writeString("NULL");
	} else if (value instanceof Float) {
		to.writeString("F");
		to.writeFloat(Float.class.cast(value));
	} else if (value instanceof Long) {
		to.writeString("L");
		to.writeLong(Long.class.cast(value));
	} else if (value instanceof Integer) {
		to.writeString("I");
		to.writeInt(Integer.class.cast(value));
	} else if (value instanceof Double) {
		to.writeString("D");
		to.writeDouble(Double.class.cast(value));
	} else if (value instanceof String) {
		to.writeString("S");
		to.writeString(String.class.cast(value));
	} else if (value instanceof Set) {
		to.writeString("*");
		to.writeInt(Set.class.cast(value).size());
		for (final Object item : Set.class.cast(value)) {
			writeValue(to, item);
		}
	} else {
		throw new IllegalArgumentException(" type " + value.getClass() + " non reconnu");
	}
}
 
开发者ID:KleeGroup,项目名称:vertigo-labs,代码行数:29,代码来源:BerkeleyDataBinding.java

示例15: objectToEntry

import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToEntry(Object arg0, TupleOutput arg1) {
  BatchwiseIntegerID entry = (BatchwiseIntegerID)arg0;
  arg1.writeInt(entry.batchID);
  arg1.writeInt(entry.ID);
}
 
开发者ID:BiosemanticsDotOrg,项目名称:GeneDiseasePaper,代码行数:7,代码来源:BatchNumberAndIntegerIDBinding.java


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