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