本文整理汇总了Java中javax.microedition.rms.RecordFilter类的典型用法代码示例。如果您正苦于以下问题:Java RecordFilter类的具体用法?Java RecordFilter怎么用?Java RecordFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RecordFilter类属于javax.microedition.rms包,在下文中一共展示了RecordFilter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeRecordStore
import javax.microedition.rms.RecordFilter; //导入依赖的package包/类
public final void writeRecordStore() {
try {
RecordStore store;
RecordEnumeration rEnum = (store = RecordStore.openRecordStore("options", false)).enumerateRecords((RecordFilter) null, (RecordComparator) null, false);
while (rEnum.hasNextElement()) {
store.deleteRecord(rEnum.nextRecordId());
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos;
(dos = new DataOutputStream(baos)).writeBoolean(this.field_30);
dos.writeBoolean(this.field_31);
dos.writeInt(this.field_9);
dos.writeInt(this.field_10);
store.addRecord(baos.toByteArray(), 0, baos.toByteArray().length);
store.closeRecordStore();
} catch (Exception e) {
System.err.println(e);
e.printStackTrace();
}
}
示例2: readRecordStore
import javax.microedition.rms.RecordFilter; //导入依赖的package包/类
public final void readRecordStore() {
try {
RecordStore store;
RecordEnumeration rEnum = (store = RecordStore.openRecordStore("options", true)).enumerateRecords((RecordFilter) null, (RecordComparator) null, false);
ByteArrayInputStream bais = new ByteArrayInputStream(rEnum.nextRecord());
DataInputStream dis = new DataInputStream(bais);
this.field_30 = dis.readBoolean();
this.field_31 = dis.readBoolean();
this.field_9 = dis.readInt();
this.field_10 = dis.readInt();
store.closeRecordStore();
} catch (Exception e) {
e.printStackTrace();
}
}
示例3: enumerateRecords
import javax.microedition.rms.RecordFilter; //导入依赖的package包/类
public RecordEnumeration enumerateRecords(RecordFilter filter, RecordComparator comparator, boolean keepUpdated)
throws RecordStoreNotOpenException
{
if (!open) {
throw new RecordStoreNotOpenException();
}
return new RecordEnumerationImpl(this, filter, comparator, keepUpdated);
}
示例4: RecordEnumerationImpl
import javax.microedition.rms.RecordFilter; //导入依赖的package包/类
public RecordEnumerationImpl(RecordStoreImpl recordStoreImpl, RecordFilter filter, RecordComparator comparator, boolean keepUpdated)
{
this.recordStoreImpl = recordStoreImpl;
this.filter = filter;
this.comparator = comparator;
this.keepUpdated = keepUpdated;
rebuild();
if (keepUpdated) {
recordStoreImpl.addRecordListener(recordListener);
}
}