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


Java TupleInput.readLong方法代码示例

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


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

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
private static Object readValue(final TupleInput ti) {
	final String type = ti.readString();
	switch (type) {
		case "NULL":
			return null;
		case "F":
			return ti.readFloat();
		case "L":
			return ti.readLong();
		case "I":
			return ti.readInt();
		case "D":
			return ti.readDouble();
		case "S":
			return ti.readString();
		case "*":
			final int size = ti.readInt();
			final Set set = new HashSet();
			for (int i = 0; i < size; i++) {
				set.add(readValue(ti));
			}
			return set;
		default:
			throw new IllegalArgumentException(" type " + type + " non reconnu");
	}
}
 
开发者ID:KleeGroup,项目名称:vertigo-labs,代码行数:27,代码来源:BerkeleyDataBinding.java

示例3: createSecondaryKey

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

示例5: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
@Override
public Beacon entryToObject(TupleInput input) {
   long time = input.readLong();
   int minor = input.readInt();
   Beacon key = new Beacon();
   key.setTime(time);
   key.setMinor(minor);
   return key;
}
 
开发者ID:starksm64,项目名称:RaspberryPiBeaconParser,代码行数:10,代码来源:BeaconEventKeyBinding.java

示例6: doEntryToDocument

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Document doEntryToDocument(final TupleInput ti) throws Exception {
	final DocumentVersion documentVersion = doEntryToDocumentVersion(ti);
	final DocumentBuilder documentBuilder = new DocumentBuilder(documentVersion);
	final Long size = ti.readLong();
	final String name = ti.readString();

	documentBuilder//
			.withName(name)//
			.withSize(size);

	if (!readVersionOnly) {
		final String content = ti.readString();
		final String type = ti.readString();

		final MetaDataContainer extractedMetaDataContainer = doEntryToMdc(ti);
		final MetaDataContainer enhancedMetaDataContainer = doEntryToMdc(ti);
		final MetaDataContainer userDefinedMetaDataContainer = doEntryToMdc(ti);

		documentBuilder//
				.withContent(content)//
				.withType(type)//
				.withExtractedMetaDataContainer(extractedMetaDataContainer)//
				.withEnhancedMetaDataContainer(enhancedMetaDataContainer)//
				.withUserDefinedMetaDataContainer(userDefinedMetaDataContainer);
	}
	return documentBuilder.build();
}
 
开发者ID:KleeGroup,项目名称:vertigo-labs,代码行数:30,代码来源:DocumentBinding.java

示例7: doEntryToDocumentVersion

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
private static DocumentVersion doEntryToDocumentVersion(final TupleInput ti) {
	final String url = ti.readString();
	final String dataSourceId = ti.readString();
	final Date lastModified = new Date(ti.readLong());

	return new DocumentVersionBuilder()//
			.withSourceUrl(url)//
			.withLastModified(lastModified)//
			.withDataSourceId(dataSourceId)//
			.build();
}
 
开发者ID:KleeGroup,项目名称:vertigo-labs,代码行数:12,代码来源:DocumentBinding.java

示例8: doEntryToMdc

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
private static MetaDataContainer doEntryToMdc(final TupleInput ti) {
	final MetaDataContainerBuilder metaDataContainerBuilder = new MetaDataContainerBuilder();
	final int size = ti.readInt();
	for (int i = 0; i < size; i++) {
		final String metaDataClassName = ti.readString();
		final String metaDataName = ti.readString();
		final Class<? extends Enum> metaDataClass = (Class<? extends Enum>) ClassUtil.classForName(metaDataClassName);
		final MetaData metaData = (MetaData) Enum.valueOf(metaDataClass, metaDataName);
		final boolean valueNotNull = ti.readBoolean();
		final Object value;
		if (valueNotNull) {
			switch (metaData.getType()) {
				case DATE:
					value = new Date(ti.readLong());
					break;
				case INTEGER:
					value = ti.readInt();
					break;
				case LONG:
					value = ti.readLong();
					break;
				case STRING:
					value = ti.readString();
					break;
				default:
					throw new IllegalStateException(StringUtil.format("Type de meta-donn�es non g�r� : {0} pour {1}.{2}", metaData.getType(), metaDataClassName, metaDataName));
			}
		} else {
			value = null;
		}
		metaDataContainerBuilder.withMetaData(metaData, value);
	}
	return metaDataContainerBuilder.build();
}
 
开发者ID:KleeGroup,项目名称:vertigo-labs,代码行数:35,代码来源:DocumentBinding.java

示例9: doEntryToMdc

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
protected static final MetaDataContainer doEntryToMdc(final TupleInput ti) {
	final MetaDataContainerBuilder metaDataContainerBuilder = new MetaDataContainerBuilder();
	final int size = ti.readInt();
	for (int i = 0; i < size; i++) {
		final String metaDataClassName = ti.readString();
		final String metaDataName = ti.readString();
		final Class<? extends Enum> metaDataClass = (Class<? extends Enum>) ClassUtil.classForName(metaDataClassName);
		final MetaData metaData = (MetaData) Enum.valueOf(metaDataClass, metaDataName);
		final boolean valueNotNull = ti.readBoolean();
		final Object value;
		if (valueNotNull) {
			switch (metaData.getType()) {
				case DATE:
					value = new Date(ti.readLong());
					break;
				case INTEGER:
					value = ti.readInt();
					break;
				case LONG:
					value = ti.readLong();
					break;
				case STRING:
					value = ti.readString();
					break;
				default:
					throw new RuntimeException(StringUtil.format("Type de meta-donn�es non g�r� : {0} pour {1}.{2}", null, metaData.getType(), metaDataClassName, metaDataName));
			}
		} else {
			value = null;
		}
		metaDataContainerBuilder.withMetaData(metaData, value);
	}
	return metaDataContainerBuilder.build();
}
 
开发者ID:KleeGroup,项目名称:vertigo-labs,代码行数:35,代码来源:AbstractDocumentBindingReader.java

示例10: data2MappingFilter

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
public static Mapping data2MappingFilter(ExecContext context,DatabaseEntry data,Mapping mapping, ArrayList<Var> vars){
	HashMap<Var, Long> hMap=new HashMap<Var, Long>(); 
	TupleInput input= new TupleInput(data.getData());	
	for(int i=0;i<vars.size();i++){
		long tmp=input.readLong();
		if(!mapping.containsKey(vars.get(i))) hMap.put(vars.get(i), tmp);
	}
	return new HashMapping(context, hMap);
}
 
开发者ID:KMax,项目名称:cqels,代码行数:10,代码来源:Utils.java

示例11: outRange

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
public static boolean outRange(DatabaseEntry data, DatabaseEntry range,int idxLen){
	TupleInput in1=new TupleInput(data.getData());
	TupleInput in2=new TupleInput(range.getData());
	for(int i=0;i<idxLen;i++)
		if(in1.readLong()!=in2.readLong()) return true;
	return false;
}
 
开发者ID:KMax,项目名称:cqels,代码行数:8,代码来源:Utils.java

示例12: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
@Override
public RepGroupImpl entryToObject(TupleInput input) {
    return new RepGroupImpl(input.readString(),
                                  new UUID(input.readLong(),
                                           input.readLong()),
                                  input.readInt(),
                                  input.readInt(),
                                  input.readInt(),
                                  null);
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:11,代码来源:RepGroupDB.java

示例13: entryToObject

import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
@Override
public LogChangeSet entryToObject(TupleInput input) {
    LogChangeSet changeSet =
        new LogChangeSet(input.readLong(), input.readLong());

    return changeSet;
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:8,代码来源:LogChangeSet.java


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