??xml version="1.0" encoding="utf-8" standalone="yes"?>av在线电影网,国产精品一区二区三区av麻,久久综合久久综合久久http://www.aygfsteel.com/iwinyeah/archive/2008/03/25/188611.htmliwinyeahiwinyeahTue, 25 Mar 2008 14:56:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/25/188611.htmlhttp://www.aygfsteel.com/iwinyeah/comments/188611.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/25/188611.html#Feedback1http://www.aygfsteel.com/iwinyeah/comments/commentRss/188611.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/188611.htmlj2me如何d|上资源文g例如文本文gQ图形文件?/p>

例如Q读取www.kingdart.cn/jaccount/imobile.png 转换为Image
又例如:dwww.kingdart.cn/jaccount/readme.txt 转换为String

只在模拟器上成功我也会,要求是真Z成功Q?br />



iwinyeah 2008-03-25 22:56 发表评论
]]>
[导入]WTK模拟器之RMS(5 q是有可能在手机上做出文件式RMS?http://www.aygfsteel.com/iwinyeah/archive/2008/03/22/187969.htmliwinyeahiwinyeahSat, 22 Mar 2008 09:01:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/22/187969.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187969.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/22/187969.html#Feedback3http://www.aygfsteel.com/iwinyeah/comments/commentRss/187969.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187969.html |站: JavaEye  作? iwinyeah  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/174850  发表旉: 2008q?3?2?

声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任!

我的?在没有认真阅读FileConnection文档之后妄下结?最q下载了fileconnection_spec_1.00文档,发现其中有一个方?
public java.io.OutputStream openOutputStream(long byteOffset)
throws java.io.IOException
该方法在打开输出时可指定写入的位置,写入的数据将覆盖旧数?利用q个Ҏ,q是有可能在手机上实现文件式RMS?

现在我正在做手机理胦JAccount的文件备份和恢复,q分不出w来试,有兴的朋友可以自已试一下如果OK?别忘了告诉我一声哦!
本文的讨Z很精彩,览讨论>>


JavaEye推荐




文章来源:http://iwinyeah.javaeye.com/blog/174850

iwinyeah 2008-03-22 17:01 发表评论
]]>
[导入]FileConnection如何使用?http://www.aygfsteel.com/iwinyeah/archive/2008/03/22/187970.htmliwinyeahiwinyeahSat, 22 Mar 2008 02:55:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/22/187970.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187970.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/22/187970.html#Feedback0http://www.aygfsteel.com/iwinyeah/comments/commentRss/187970.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187970.html |站: JavaEye  作? iwinyeah  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/174754  发表旉: 2008q?3?2?

声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任!

׃要ؓ手机理胦JAccount增加数据导出到文本文件功?我ؓ其增加了exportToFile(String fileName)Ҏ,使用Moto模拟?A630)时发现装入JAR阶段已出?错误的信息是:
ALERT: Unable to load class javax/microedition/io/file/FileConnection,RAZR_V3则正?要知?我从未打ؓ不同的手机制作不同的JAR,我计划是在代码中查该手机是否支持FileConnection,若支持的?菜单Ҏ增加备䆾和恢复命令项.
如果所有不支持FileConnection的手机都不能装入的话,那不是只能ؓ支持的开发一个版?不支持的又开发另一个版?
本文的讨Z很精彩,览讨论>>


JavaEye推荐




文章来源:http://iwinyeah.javaeye.com/blog/174754

iwinyeah 2008-03-22 10:55 发表评论
]]>
[导入]字段输入FieldInuptStreamhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/21/187971.htmliwinyeahiwinyeahFri, 21 Mar 2008 14:19:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/21/187971.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187971.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/21/187971.html#Feedback0http://www.aygfsteel.com/iwinyeah/comments/commentRss/187971.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187971.html |站: JavaEye  作? iwinyeah  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/174645  发表旉: 2008q?3?1?

声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任!

/**
 * --------------------------------------------------
 * 字段输入?
 * --------------------------------------------------
 * 从DataInputStreaml承
 * 主要增加了从文本格式输入中d数据字段的能?
 * --------------------------------------------------
 * 
 * @author iwinyeah 李永?
 * @version 1.0.0
 * */

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

public class FieldInputStream extends DataInputStream {
	public final static int BIN_MODE = 0;

	public final static int TXT_MODE = 1;

	int mode;

	public FieldInputStream(InputStream in, int mode) {
		super(in);
		this.mode = mode;
	}

	public boolean getBoolean() throws IOException {
		if (mode == 0) {
			return readBoolean();
		} else {
			if ("1".equals(next())) {
				return true;
			}
			return false;
		}
	}

	public byte getByte() throws IOException {
		if (mode == 0) {
			return readByte();
		} else {
			return (byte) Integer.parseInt(next());
		}
	}

	public short getShort() throws IOException {
		if (mode == 0) {
			return readShort();
		} else {
			return (short) Integer.parseInt(next());
		}
	}

	public int getInt() throws IOException {
		if (mode == 0) {
			return readInt();
		} else {
			return Integer.parseInt(next());
		}
	}

	public long getLong() throws IOException {
		if (mode == 0) {
			return readLong();
		} else {
			return Long.parseLong(next());
		}
	}

	public String getString() throws IOException {
		if (mode == 0) {
			if (read() == 0) {
				return null;
			} else {
				return readUTF();
			}
		} else {
			return next();
		}
	}

	// 取下一标识W?
	private byte[] buffer = new byte[255];

	private int length = 0;

	private boolean eos = false;

	private final static int INITIAL = 0;

	private final static int ESCAPE = 1;

	private final static int COMMENT_START = 2;

	private final static int LINE_COMMENT = 3;

	private final static String WHITESPACE = "\n\r\t";

	public String next() throws IOException {
		length = 0;
		int c = in.read();
		int status = INITIAL;
		READWHILE: while (c != -1) { // 一直读到文件尾

			switch (status) {
			case INITIAL:
				if (c == '\n' || c == '\t') { // 如果是分隔符
					break READWHILE;
				} else if (c == '\\') {
					status = ESCAPE; // 设{义字W标?
				} else if (c == '/') {
					status = COMMENT_START; // 设注释标?
				} else {
					if (WHITESPACE.indexOf(c) < 0) {
						append(c);
					}
				}
				break;

			case ESCAPE: // 处理转义字符
				switch (c) {
				case 'n':
					append('\n');
					break;

				case 'r':
					append('\r');
					break;

				case 't':
					append('\t');
					break;

				case 'b':
					append('\b');
					break;

				case 'f':
					append('\f');
					break;

				default:
					append(c);
					break;
				}
				status = INITIAL; // 设正常情冉|?
				break;

			case COMMENT_START: // 处理注释
				if (c == '/') {
					status = LINE_COMMENT; // 是行式注?
				} else {
					status = INITIAL;
					// 如果都不是则把注释v始符和刚d的字W都加入到标识符?
					append('/');
					append(c);
				}
				break;

			case LINE_COMMENT:
				if (c == '\n') {
					status = INITIAL; // 如果当前注释状态则要一直读到行才恢复正常情况标志
					break READWHILE;
				}
				break;
			}
			c = in.read(); // d下一字符
		}

		if (c == -1) {
			eos = true;
		}

		// 如果d文g时Q标识符长度大于Ӟ则返回标识符Q否则返回NULL?
		if (length <= 0) {
			return null;
		} else {
			return new String(buffer, 0, length, "UTF-8");
		}
	}

	// 读入的字符加入~冲?
	private void append(int c) {
		// ~冲Zx自动扩展
		if (length >= buffer.length) {
			byte[] xBuffer = new byte[buffer.length + 16];
			System.arraycopy(buffer, 0, xBuffer, 0, buffer.length);
			buffer = null;
			buffer = xBuffer;
		}

		buffer[length++] = (byte) c;
	}

	public boolean eos() {
		return eos;
	}
}

请参看我的另一文章:字段输出FieldOutputStreamhttp://iwinyeah.javaeye.com/admin/blogs/174644
本文的讨Z很精彩,览讨论>>


JavaEye推荐




文章来源:http://iwinyeah.javaeye.com/blog/174645

iwinyeah 2008-03-21 22:19 发表评论
]]>
[导入]字段输出FieldOutputStreamhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/21/187972.htmliwinyeahiwinyeahFri, 21 Mar 2008 14:16:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/21/187972.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187972.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/21/187972.html#Feedback0http://www.aygfsteel.com/iwinyeah/comments/commentRss/187972.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187972.html |站: JavaEye  作? iwinyeah  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/174644  发表旉: 2008q?3?1?

声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任!

我的FieldOutputStreaml承了DataOutputStreamQ这样就可以只更改很量的代码就实现了既支持原生格式又支持文本方式输Z,E候一D|间手机理财将可以实现备䆾和恢复(文本格式Q功能了.
package util;
/**
 * --------------------------------------------------
 * 字段输出?
 * --------------------------------------------------
 * 从DataOutputStreaml承
 * 主要增加了向输出写入文本格式的数据字段的能?
 * 文本格式将由TAB分隔字段Q回车换行符分隔记录
 * --------------------------------------------------
 * 
 * @author iwinyeah 李永?
 * @version 1.0.0
 * */

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class FieldOutputStream extends DataOutputStream {
	public final static int BIN_MODE = 0;

	public final static int TXT_MODE = 1;

	private final static byte[] fieldSplit = {'\t'};

	private final static byte[] recordSplit = {'\r','\n'};

	private int mode;
	
	private boolean nextEnd = false;

	public FieldOutputStream(OutputStream out, int mode) {
		super(out);
		this.mode = mode;
	}

	// 接着写入的是否最后一个字D?
	// 写第一个字D前以参数false调用?
	// 写最后一个字D前以参数false调用?
	public void setNextEnd(boolean end){
		nextEnd = end;
	}
	
	public void putBoolean(boolean value) throws IOException {
		if (mode == 0) {
			writeBoolean(value);
		} else {
			out.write(value ? '1' : '0');
			out.write(nextEnd ? recordSplit : fieldSplit);
		}
	}

	public void putByte(byte value) throws IOException {
		if (mode == 0) {
			writeByte(value);
		} else {
			out.write(String.valueOf(value).getBytes("UTF-8"));
			out.write(nextEnd ? recordSplit : fieldSplit);
		}
	}

	public void putShort(short value) throws IOException {
		if (mode == 0) {
			writeShort(value);
		} else {
			out.write(String.valueOf(value).getBytes("UTF-8"));
			out.write(nextEnd ? recordSplit : fieldSplit);
		}
	}

	public void putInt(int value) throws IOException {
		if (mode == 0) {
			writeInt(value);
		} else {
			out.write(String.valueOf(value).getBytes("UTF-8"));
			out.write(nextEnd ? recordSplit : fieldSplit);
		}
	}

	public void putLong(long value) throws IOException {
		if (mode == 0) {
			writeLong(value);
		} else {
			out.write(String.valueOf(value).getBytes("UTF-8"));
			out.write(nextEnd ? recordSplit : fieldSplit);
		}
	}

	public void putString(String value) throws IOException {
		if (mode == 0) {
			if (value == null) {
				writeByte(0);
			} else {
				writeByte(1);
				writeUTF(value);
			}
		} else {
			if(value != null){
				byte[] b = value.getBytes("UTF-8");
				for(int i = 0; i < b.length; i++){
					if(b[i] == '\n'){
						out.write('\\');
						out.write('n');
					}
					else if(b[i] == '\r'){
						out.write('\\');
						out.write('r');
					}
					else if(b[i] == '\t'){
						out.write('\\');
						out.write('t');}
					else if(b[i] == '\b'){
						out.write('\\');
						out.write('b');}
					else if(b[i] == '\f'){
						out.write('\\');
						out.write('f');
					}else{
						out.write(b[i]);
					}
				}				
			}
			out.write(nextEnd ? recordSplit : fieldSplit);
		}
	}

}


d请参看另一?字段输入FieldInputStream.http://iwinyeah.javaeye.com/admin/blogs/174645
本文的讨Z很精彩,览讨论>>


JavaEye推荐




文章来源:http://iwinyeah.javaeye.com/blog/174644

iwinyeah 2008-03-21 22:16 发表评论
]]>
[导入]日期处理c(忽略旉Q?/title><link>http://www.aygfsteel.com/iwinyeah/archive/2008/03/19/187973.html</link><dc:creator>iwinyeah</dc:creator><author>iwinyeah</author><pubDate>Wed, 19 Mar 2008 04:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/iwinyeah/archive/2008/03/19/187973.html</guid><wfw:comment>http://www.aygfsteel.com/iwinyeah/comments/187973.html</wfw:comment><comments>http://www.aygfsteel.com/iwinyeah/archive/2008/03/19/187973.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/iwinyeah/comments/commentRss/187973.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/iwinyeah/services/trackbacks/187973.html</trackback:ping><description><![CDATA[ <br/> |站: <a >JavaEye</a>  作? <a >iwinyeah</a>  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/173704</a>  发表旉: 2008q?3?9? <br/><br/> 声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任! <br/><br/> 我的一个日期处理类Q解决了时区问题Q给有需要的人? <br /><pre name="code" class="java"> package util; /** * -------------------------------------------------- * 日期转换对象 * -------------------------------------------------- * 主要提供日期?970-01-01后的天数的{换和到字W串的{? * -------------------------------------------------- * * @author iwinyeah 李永? * @version 1.0.0 * */ import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class DateUtil { private static Calendar _calendar = Calendar.getInstance(); // 用于日期计算 private static long MSEC_EVERYDAY = 86400000L; // 一天的微秒? private static int rawOffset = TimeZone.getDefault().getRawOffset(); /** * 日期{换ؓ1970-01-01后的天数 * * @param Date * theDate 要计天数的日期 * @return int 所传入日期?970-01-01相差的天? */ public static int dateToDay(Date theDate) { return (int) ((theDate.getTime() + rawOffset) / MSEC_EVERYDAY); } /** * ?970-01-01后的天数转换为日? * * @param int * 要取的日期与1970-01-01相差的天? * @return Date theDate ?970-01-01相差相应天数的日? */ public static Date dayToDate(int day) { return new Date(day * MSEC_EVERYDAY); } /** * 取今天与1970-01-01相差的天? * * @return int 取今天与1970-01-01相差的天? */ public static int toDay() { return (int) ((System.currentTimeMillis() + rawOffset) / MSEC_EVERYDAY); } /** * 日期{换ؓq月日字W串 * * @param int * theDay ?970-01-01相差的天? * @return String 对应日期q月日Ş式的字符? */ public static String getYMD(int theDay) { _calendar.setTime(dayToDate(theDay)); return _calendar.get(Calendar.YEAR) % 100 + "/" + (_calendar.get(Calendar.MONTH) + 1 > 9 ? "" : "0") + (_calendar.get(Calendar.MONTH) + 1) + "/" + (_calendar.get(Calendar.DATE) > 9 ? "" : "0") + _calendar.get(Calendar.DATE); } /** * 日期{换ؓq月字符? * * @param int * theDay ?970-01-01相差的天? * @return String 对应日期q月形式的字W串 */ public static String getYM(int theDay) { _calendar.setTime(dayToDate(theDay)); return _calendar.get(Calendar.YEAR) + "/" + (_calendar.get(Calendar.MONTH) + 1 > 9 ? "" : "0") + (_calendar.get(Calendar.MONTH) + 1); } /** * 日期{换ؓ月日字符? * * @param int * theDay ?970-01-01相差的天? * @return String 对应日期月日形式的字W串 */ public static String getMD(int theDay) { _calendar.setTime(dayToDate(theDay)); return (_calendar.get(Calendar.MONTH) + 1 > 9 ? "" : "0") + (_calendar.get(Calendar.MONTH) + 1) + "/" + (_calendar.get(Calendar.DATE) > 9 ? "" : "0") + _calendar.get(Calendar.DATE); } /** * 日期{换ؓ当月一? * * @param int * theDay ?970-01-01相差的天? * @return int 对应日期所在月份第一天与1970-01-01相差的天? */ public static int getMonthFirstDay(int theDay) { _calendar.setTime(dayToDate(theDay)); _calendar.set(Calendar.DAY_OF_MONTH, 1); return (int) (dateToDay(_calendar.getTime())); } /** * 取日期所在年? * * @param int * theDay ?970-01-01相差的天? * @return int 对应日期所在年? */ public static int getYear(int theDay) { _calendar.setTime(dayToDate(theDay)); return _calendar.get(Calendar.YEAR); } /** * 取日期所在月? * * @param int * theDay ?970-01-01相差的天? * @return int 对应日期所在月? */ public static int getMonth(int theDay) { _calendar.setTime(dayToDate(theDay)); return _calendar.get(Calendar.MONTH); } /** * 取日期所在周? * * @param int * theDay ?970-01-01相差的天? * @return int 对应日期所在周? */ public static int getWeek(int theDay) { // 1971-01-03是星期日,从该日开始计周? _calendar.setTime(dayToDate(theDay)); return (int) ((_calendar.getTime().getTime() - 172800000L) / 604800000L); } } </pre> <br/> <span style="color:red;"> <a style="color:red;">本文的讨Z很精彩,览讨论>></a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye推荐</span> <br/> <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">中科院Y件、计机工程士;中港软g士、管理类士博士招生</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">WebSphere 产品家族新特性系列经典推?/span></a></li></ul> <br/><br/><br/> <br>文章来源:<a >http://iwinyeah.javaeye.com/blog/173704</a> <img src ="http://www.aygfsteel.com/iwinyeah/aggbug/187973.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/iwinyeah/" target="_blank">iwinyeah</a> 2008-03-19 12:32 <a href="http://www.aygfsteel.com/iwinyeah/archive/2008/03/19/187973.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[导入]OpenBaseMovil Action <--> View <--> Controllerhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/17/187974.htmliwinyeahiwinyeahMon, 17 Mar 2008 06:06:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/17/187974.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187974.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/17/187974.html#Feedback0http://www.aygfsteel.com/iwinyeah/comments/commentRss/187974.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187974.html |站: JavaEye  作? iwinyeah  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/172974  发表旉: 2008q?3?7?

声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任!

Action: 规定了与用户交互的View可以触发的动?在某个View新徏之后昄之前,应先为其指定具体的Action,当用h下了相应的Command按钮之后QView该Command对应的Action发送到该View的Controllerq行处理?
//
public class Action{
    String name; // 名称 
    Command command; // 命o 
    int code; // 代码 (由该View的传递到其Controller使用)
    Item item; // 数据?
    boolean defaultAction; // 是否是默认的Action 
    //...省略
}


LView的基cȝ代码节?
public abstract class AbstractView{

    //...省略

    // View增加Action
    public void addAction( final Action action, final boolean active )
    {
        if( !actions.containsKey( action.getName() ) )
        {
            // Action存入Actions表中
            actions.put( action.getName(), action );
            if( active )
            {
                activateAction( action );
            }
        }
    }

    // 使Action生效可用
    private void activateAction( final Action action )
    {
        final Command command = action.getCommand();
        activeActions.put( command, action );
        final Item item = action.getItem();
        if( item == null )
        {
            addCommand( command ); // 该Action是屏q相关的命o
        }
        else
        {
            item.addCommand( command ); // 该Action是数据项相关的命?
            if( action.isDefaultAction() )
            {
                item.setDefaultCommand( command );
            }
        }
    }

    //...省略

    // 用户按下相应的命令键?触发执行与其兌的Action
    public void commandAction(
            final Command       command,
            final Displayable   displayable
    )
    {
        if( !handleAction( command ) )
        {
            if( displayable instanceof Choice )
            {
                AbstractController.commandAction(
                        this,
                        command,
                        (Choice) displayable
                );
            }
            else
            {
                AbstractController.commandAction( this, command );
            }
        }
    }

    // 用户在某个指定了命o的Item按下了命令按钮时触发执行与其兌的Action
    public void commandAction( final Command command, final Item item )
    {
        if( !handleAction( command ) )
        {
            AbstractController.commandAction( this, command );
        }
    }

    // Ҏ所触发的命令查扑օ联的Action,q新它发送到Controllerq行处理
    public boolean handleAction( final Command command )
    {
        if( activeActions.containsKey( command ) )
        {
            final Action action = (Action) activeActions.get( command );
            // 以Action代码为参数生成ControllerEventq传递到controller处理
            final ControllerEvent event = new ControllerEvent(
                    action.getCode(),
                    this
            );
            controller.handle( event );
            return true;
        }
        else
        {
            return false;
        }
    }

    //...省略

}

本文的讨Z很精彩,览讨论>>


JavaEye推荐




文章来源:http://iwinyeah.javaeye.com/blog/172974

iwinyeah 2008-03-17 14:06 发表评论
]]>
[导入]Nokia 6070 报表问题解决http://www.aygfsteel.com/iwinyeah/archive/2008/03/15/187975.htmliwinyeahiwinyeahSat, 15 Mar 2008 13:43:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/15/187975.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187975.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/15/187975.html#Feedback0http://www.aygfsteel.com/iwinyeah/comments/commentRss/187975.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187975.html |站: JavaEye  作? iwinyeah  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/172237  发表旉: 2008q?3?5?

声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任!

l过多次的尝?l于解决了手机理财JAccount在Nokia 6070反复l计收支表和余额表时出错的问?
原来我有两个报表上分别用了incomeVector 和balanceVector来保存所生成的统计资?每次l计前检查Vector是否为null,否则先置I?再重新new一?
我尝试过new之后加了runtime.gc(),未能解决问题;
我又试q不|空Vector,而用vector.removeallelements(),也不?
我又试q两个报表共用一个Vector也不?

最?我用两个报表共用数l来保存l果,才解决了问题,有点开?
cMNokia6070q种机器的JVM的内存管理的存在很大的问题,明明有内存也用不?真郁?
不过q是有点开?毕竟解决了一个问?
本文的讨Z很精彩,览讨论>>


JavaEye推荐




文章来源:http://iwinyeah.javaeye.com/blog/172237

iwinyeah 2008-03-15 21:43 发表评论
]]>
[导入]我在J2ME中用q的几种后台U程Ҏ(如何选择?)http://www.aygfsteel.com/iwinyeah/archive/2008/03/15/187976.htmliwinyeahiwinyeahSat, 15 Mar 2008 09:47:00 GMThttp://www.aygfsteel.com/iwinyeah/archive/2008/03/15/187976.htmlhttp://www.aygfsteel.com/iwinyeah/comments/187976.htmlhttp://www.aygfsteel.com/iwinyeah/archive/2008/03/15/187976.html#Feedback0http://www.aygfsteel.com/iwinyeah/comments/commentRss/187976.htmlhttp://www.aygfsteel.com/iwinyeah/services/trackbacks/187976.html |站: JavaEye  作? iwinyeah  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/172200  发表旉: 2008q?3?5?

声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任!

我以前在其他地方发过的脓?q几U方式都没问?哪种较好或者说在什么情况下用哪U方法较好呢?
// Ҏ一
public class firstManager implements Runnable {
  public void runTask() {
   (new Thread(this)).start();
  }
  public void run() {
   System.out.println("\nfirst thread method!");
   // Do some thing ...
  }
}
// Ҏ?
public class secondManager {
  private BackTask backTask;
  private Timer timer;
  public secondManager() {
   backTask = new BackTask();
   timer = new Timer();
  }
  public void runTask() {
   timer.schedule(backTask, 0);
  }
  private class BackTask extends TimerTask {
   public void run() {
    System.out.println("\nsecond thread method!");
    // Do some thing ...
   }
  }
}
// Ҏ?
public class thirdManager {
  private BackTask backTask;
  private int cmd = 0;
  public thirdManager() {
   backTask = new BackTask();
   backTask.start();
  }
  public void runTask() {
   synchronized (backTask) {
    cmd = 1;
    backTask.notify();
   }
  }
  private class BackTask extends Thread {
   public void run() {
    while (true) {
     try {
      if (cmd == 0) {
       synchronized (this) {
        wait();
       }
       continue;
      }
      System.out.println("\nthird thread method!");
      // Do some thing ...
     } catch (Exception e) {
     }
     cmd = 0;
    }
   }
  }
}

// 用例
public void main(){
  firstManager man1 = new firstManager();
  secondManager man2 = new secondManager();
  thirdManager man3 = new thirdManager();
  man1.runTask();
  man2.runTask();
  man3.runTask();
}

本文的讨Z很精彩,览讨论>>


JavaEye推荐




文章来源:http://iwinyeah.javaeye.com/blog/172200

iwinyeah 2008-03-15 17:47 发表评论
]]>
[导入]OpenBaseMovil StreamParser 标识符分段?/title><link>http://www.aygfsteel.com/iwinyeah/archive/2008/03/12/187977.html</link><dc:creator>iwinyeah</dc:creator><author>iwinyeah</author><pubDate>Tue, 11 Mar 2008 23:03:00 GMT</pubDate><guid>http://www.aygfsteel.com/iwinyeah/archive/2008/03/12/187977.html</guid><wfw:comment>http://www.aygfsteel.com/iwinyeah/comments/187977.html</wfw:comment><comments>http://www.aygfsteel.com/iwinyeah/archive/2008/03/12/187977.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/iwinyeah/comments/commentRss/187977.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/iwinyeah/services/trackbacks/187977.html</trackback:ping><description><![CDATA[ <br/> |站: <a >JavaEye</a>  作? <a >iwinyeah</a>  链接Q?a style="color:red;">http://iwinyeah.javaeye.com/blog/170335</a>  发表旉: 2008q?3?2? <br/><br/> 声明Q本文系JavaEye|站发布的原创博客文章,未经作者书面许可,严禁M|站转蝲本文Q否则必追I法律责任! <br/><br/> 在处理资源文件时Q我以前的做法是一ơ性读入资源文Ӟ然后再进行处理,在处理大文gӞq种Ҏ对由于对机器内存消耗较大而存在隐患,刚想它改ؓ逐字d的方式,在OpenBaseMovil中发Cq个c,很符合我的要求。关键代码如下: <br /><pre name="code" class="java"> //... 省略 public static final String WHITESPACE = "\r\n\t "; public String next(final String delimiters, final boolean keepWhitespace, final boolean allowComments, final boolean reuseDelimiter, final boolean processEscape) throws IOException { try { final StringBuffer token = new StringBuffer(); startLine = endLine; startChar = endChar; int c = in.read(); endChar++; int status = INITIAL; while (c != -1) { // 若还未读到文件尾 if (c == '\n') { endLine++; endChar = 0; } switch (status) { case INITIAL: if (delimiters.indexOf(c) > -1) { // 如果是分隔符 lastDelimiter = (char) c; if (isWhiteSpace(c)) { // 如果同时也是I白Wƈ且标识符长度大于零则q回标识W? if (token.length() > 0) { if (reuseDelimiter) { // 如果要重用分隔符则将它推回输入流? in.revert((char) c); } return token.toString(); } // 如果q未有数据,q要l箋往下读 } else { // 如果不是I白W则无论标识W长度是否ؓӞ都要q回 if (reuseDelimiter) { in.revert((char) c); } return token.toString(); } } else if (processEscape && c == '\\') { status = ESCAPE; // 设{义字W标? } else if (allowComments && c == '/') { status = COMMENT_START; // 设注释标? } else if (isWhiteSpace(c)) { if (keepWhitespace) { // 如果I白W也要用Q把它加入标识符? token.append((char) c); } } else { token.append((char) c); } break; case ESCAPE: // 处理转义字符 switch (c) { case 'n': token.append('\n'); break; case 'r': token.append('\r'); break; case 't': token.append('\t'); break; case 'b': token.append('\b'); break; case 'f': token.append('\f'); break; default: token.append((char) c); break; } status = INITIAL; // 设正常情冉|? break; case COMMENT_START: // 处理注释 if (c == '/') { status = LINE_COMMENT; // 是行式注? } else if (c == '*') { status = BLOCK_COMMENT; // 是块式注? } else { status = INITIAL; // 如果都不是则把注释v始符和刚d的字W都加入到标识符? token.append('/').append((char) c); } break; case LINE_COMMENT: if (c == '\n') { status = INITIAL; // 如果当前注释状态则要一直读到行才恢复正常情况标志 } break; case BLOCK_COMMENT: if (c == '*') { status = COMMENT_END; // 如果当前为块注释状态则要一直读?可为块注释l束状? } break; case COMMENT_END: if (c == '/') { status = INITIAL; // 在块l束状态下d/则ؓ块结? } else { status = BLOCK_COMMENT; // 否则块注释还未结束,恢复为块注释状? } break; } c = in.read(); // d下一字符 } // 如果d文g时Q标识符长度大于Ӟ则返回标识符Q否则返回NULL? return token.length() > 0 ? token.toString() : null; } catch (IOException e) { throw new IOException("Error reading input L=" + startLine + " C=" + startChar); } } //... 省略 </pre> <br /> <br />不过从代码可以看出,它ƈ不支持非Ascii~码格式的文Ӟq要q行q一步的攚w? <br />我的计划是StringBuffer 用byte[]代替Q增加setEncode(String encode)Ҏ,q回字符串时使用 new String(byte[], encode) <br/> <span style="color:red;"> <a style="color:red;">本文的讨Z很精彩,览讨论>></a> </span> <br/><br/><br/> <span style="color:#E28822;">JavaEye推荐</span> <br/> <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">中科院Y件、计机工程士;中港软g士、管理类士博士招生</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">WebSphere 产品家族新特性系列经典推?/span></a></li></ul> <br/><br/><br/> <br>文章来源:<a >http://iwinyeah.javaeye.com/blog/170335</a> <img src ="http://www.aygfsteel.com/iwinyeah/aggbug/187977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/iwinyeah/" target="_blank">iwinyeah</a> 2008-03-12 07:03 <a href="http://www.aygfsteel.com/iwinyeah/archive/2008/03/12/187977.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">е</a>| <a href="http://" target="_blank">̫</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˷</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʱ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank">̶</a>| <a href="http://" target="_blank">²</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¤</a>| <a href="http://" target="_blank">͡</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank">Ѯ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">齭</a>| <a href="http://" target="_blank">ɳƺ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>