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


Java RecordFilter类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:NaikSoftware,项目名称:Blitzkrieg,代码行数:23,代码来源:GameCanvas.java

示例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();
    }
}
 
开发者ID:NaikSoftware,项目名称:Blitzkrieg,代码行数:16,代码来源:GameCanvas.java

示例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);
}
 
开发者ID:BombusMod,项目名称:BombusMod,代码行数:10,代码来源:RecordStoreImpl.java

示例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);
    }
}
 
开发者ID:BombusMod,项目名称:BombusMod,代码行数:14,代码来源:RecordEnumerationImpl.java


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