本文整理汇总了Java中com.sleepycat.bind.tuple.TupleInput类的典型用法代码示例。如果您正苦于以下问题:Java TupleInput类的具体用法?Java TupleInput怎么用?Java TupleInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TupleInput类属于com.sleepycat.bind.tuple包,在下文中一共展示了TupleInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createSecondaryKeys
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public void createSecondaryKeys(TupleInput primaryKeyInput, TupleInput dataInput, Set<TupleOutput> indexKeys) {
TupleOutput interval;
dataInput.skipFast(13);
startTimeInterval = dataInput.readUnsignedInt();
startTimeInterval >>= 10;
dataInput.skipFast(4);
endTimeInterval = dataInput.readUnsignedInt();
endTimeInterval >>= 10;
for (long i = startTimeInterval; i <= endTimeInterval; ++i) {
interval = getTupleOutput(null);
interval.writeUnsignedInt(i);
indexKeys.add(interval);
}
}
示例3: runReflectField
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
int runReflectField()
throws Exception {
to.reset();
Data data = new Data();
to.writeString((String) fields[0].get(data));
to.writeString((String) fields[1].get(data));
to.writeInt(((Integer) fields[2].get(data)).intValue());
to.writeInt(((Integer) fields[3].get(data)).intValue());
to.writeString((String) fields[4].get(data));
TupleInput ti = new TupleInput(
to.getBufferBytes(), to.getBufferOffset(),
to.getBufferLength());
data = new Data();
fields[0].set(data, ti.readString());
fields[1].set(data, ti.readString());
fields[2].set(data, new Integer(ti.readInt()));
fields[3].set(data, new Integer(ti.readInt()));
fields[4].set(data, ti.readString());
return to.getBufferLength();
}
示例4: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public VLSNRange entryToObject(final TupleInput ti) {
int onDiskVersion = ti.readPackedInt();
if (onDiskVersion != VERSION) {
throw EnvironmentFailureException.unexpectedState
("Don't expect version diff " +
"on_disk=" + onDiskVersion +
" source=" +
VERSION);
}
VLSNRange range =
new VLSNRange(new VLSN(ti.readPackedLong()), // first
new VLSN(ti.readPackedLong()), // last
new VLSN(ti.readPackedLong()), // lastSync
new VLSN(ti.readPackedLong())); // lastTxnEnd
return range;
}
示例5: runReflectMethod
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
int runReflectMethod()
throws Exception {
to.reset();
Data data = new Data();
to.writeString((String) getters[0].invoke(data, (Object[]) null));
to.writeString((String) getters[1].invoke(data, (Object[]) null));
to.writeInt(((Integer) getters[2].invoke(data, (Object[]) null)).intValue());
to.writeInt(((Integer) getters[3].invoke(data, (Object[]) null)).intValue());
to.writeString((String) getters[4].invoke(data, (Object[]) null));
TupleInput ti = new TupleInput(
to.getBufferBytes(), to.getBufferOffset(),
to.getBufferLength());
data = new Data();
setters[0].invoke(data, new Object[] {ti.readString()});
setters[1].invoke(data, new Object[] {ti.readString()});
setters[2].invoke(data, new Object[] {new Integer(ti.readInt())});
setters[3].invoke(data, new Object[] {new Integer(ti.readInt())});
setters[4].invoke(data, new Object[] {ti.readString()});
return to.getBufferLength();
}
示例6: 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;
}
示例7: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public Object entryToObject(TupleInput ti) {
String sku = ti.readString();
String itemName = ti.readString();
String category = ti.readString();
String vendor = ti.readString();
int vendorInventory = ti.readInt();
float vendorPrice = ti.readFloat();
Inventory inventory = new Inventory();
inventory.setSku(sku);
inventory.setItemName(itemName);
inventory.setCategory(category);
inventory.setVendor(vendor);
inventory.setVendorInventory(vendorInventory);
inventory.setVendorPrice(vendorPrice);
return inventory;
}
示例8: createSecondaryKey
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的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;
}
}
示例9: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {
int numberofentries = ti.readInt();
SortedIntList2FloatMap map = new SortedIntList2FloatMap(numberofentries);
//float squarednorm = ti.readFloat();
ti.readFloat();
for (int i = 0; i < numberofentries; i++) {
map.addEntry(ti.readInt(), ti.readFloat());
}
ConceptVector conceptvector = new ConceptVector(ontology, map);
return conceptvector;
}
示例10: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {
ConceptToConceptVectorRecordIndexEntry conceptToRecordIndexEntry = new ConceptToConceptVectorRecordIndexEntry();
conceptToRecordIndexEntry.sumOfValuesInRecords = ti.readFloat();
int numberofentries = ti.readInt();
IntList list = new IntList(numberofentries);
for (int i=0; i<numberofentries;i++){
list.add(ti.readInt());
}
conceptToRecordIndexEntry.conceptVectorRecordIDs = new SortedIntListSet(list);
return conceptToRecordIndexEntry;
}
示例11: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {
int numberofentries = ti.readInt();
IntList list = new IntList(numberofentries);
for (int i = 0; i < numberofentries; i++) {
list.add(ti.readInt());
}
SortedIntListSet set = new SortedIntListSet(list);
return set;
}
示例12: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput arg0) {
BatchwiseIntegerID result = new BatchwiseIntegerID();
result.batchID=arg0.readInt();
result.ID=arg0.readInt();
return result;
}
示例13: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
@Override
public Object entryToObject(TupleInput ti) {
int size = ti.readInt();
SortedIntList2IntMap result = new SortedIntList2IntMap(size);
for (int i=0;i<size;i++){
result.addEntry(ti.readInt(), ti.readInt());
}
return result;
}
示例14: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public HGPersistentHandle[] entryToObject(TupleInput input) {
int size = input.getBufferLength() - input.getBufferOffset();
if (size % handleSize != 0) {
throw new HGException(
"While reading link tuple: the value buffer size is not a multiple of the handle size.");
}
else {
return readHandles(input.getBufferBytes(), 0, size);
}
}
示例15: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入依赖的package包/类
public HGPersistentHandle[] entryToObject(TupleInput input)
{
int size = input.getBufferLength() - input.getBufferOffset();
if (size % handleSize != 0)
throw new HGException("While reading link tuple: the value buffer size is not a multiple of the handle size.");
else
return readHandles(input.getBufferBytes(), 0, size);
}