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


Java TupleOutput.writeFloat方法代码示例

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


在下文中一共展示了TupleOutput.writeFloat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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包/类
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

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


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