📄 datarecordbuffer.java
字号:
package com.libGPS4j2me.devices.StdGPS;
import com.libGPS4j2me.devices.StdGPS.DataRecord;
import com.libGPS4j2me.devices.StdGPS.exceptions.EmptyBufferException;
/**
* Stores a single record (GPS data).
*
* @author Loreto Parisi
*/
public class DataRecordBuffer {
private DataRecord record;
private static final long WAIT = 1000;
/**
*
* Creates a new instance of DataRecordBuffer
*/
public DataRecordBuffer() {
record = null;
}
/**
* Gets stored record.
*
* @return Stored record
* @throws EmptyBufferException If buffer is empty
*/
public synchronized DataRecord getRecord() throws EmptyBufferException {
if(record == null)
throw new EmptyBufferException("Record buffer is empty.");
return record;
}
/**
* Puts record in buffer.
*
*
* @param record DataRecord to be stored
*/
public synchronized void putRecord(DataRecord record) {
this.record = record;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -