本文整理汇总了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;
}
示例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");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}