⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timedatarecord.java

📁 A Java Framework for connecting to and exchanging data from GPS units to J2ME Mobile Devices. Serial
💻 JAVA
字号:
package com.libGPS4j2me.devices.StdGPS;import com.libGPS4j2me.ITime;import com.libGPS4j2me.IDate;/** * * @author Loreto Parisi */public class TimeDataRecord implements ITime, IDate {        /** Month (1-12) */	protected short month;	/** Day (1-31) */	protected short day;	/** Year. */	protected int year;	/** Hour of the day. */	protected int hour;	/** Minute of the hour. */	protected short minute;	/** Second of the minute. */	protected short second;    /** Creates a new instance of TimeDataRecord */    public TimeDataRecord(DataRecord record) {		try {			day = Short.parseShort(record.dateTimeOfFix.substring(9,10));			month = Short.parseShort(record.dateTimeOfFix.substring(12,13));			year = Integer.valueOf(record.dateTimeOfFix.substring(15,16)).intValue();			hour = Integer.valueOf(record.dateTimeOfFix.substring(0,1)).intValue();			minute = Short.parseShort(record.dateTimeOfFix.substring(3,4));			second = Short.parseShort(record.dateTimeOfFix.substring(6,7));        } catch(Exception e) {			System.out.println("Exception: "+ e.getMessage());		}    }    /** Returns the day of the month. */	public short getDay() {		return day;	}	/** Returns the month. */	public short getMonth() {		return month;	}	/** returns the year. */	public int getYear() {		return year;	}	/** Returns the hour of the day. */	public int getHours() {		return hour;	}	/** Returns the minute of the hour. */	public short getMinutes() {		return minute;	}	/** Returns the second of the minute.*/	public short getSeconds() {		return second;	}        /**	* Returns the value of this packet in a human-readable format.	*/	public String toString() {		StringBuffer res = new StringBuffer();		if (hour < 10)			res.append("\n0");		res.append("\n" + hour +":");		if (minute < 10)			res.append("0");		res.append(minute +":");		if (second < 10)			res.append("0");		res.append(second + "/");		res.append(day + ".");		res.append(month + "." + year);		return res.toString();	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -