亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? weather.java

?? Mobile Services
?? JAVA
字號:
/* 	Importing the basic packages required by various classes 
 	during execution of the program    */
import java.util.Hashtable;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.rms.*;
import javax.microedition.io.*;
import java.util.*;
import java.io.*; 
import java.lang.*;
 
 
 /* Declaration of the class Weather. */
 public class Weather extends MIDlet implements CommandListener
 {
	/* Declare an object for GetData class */
	DataParser getd;
 	
 	/* Declaring  variable for requesting that object to be displayed on the device */
 	private Display displaylist;
 
 	/* Declaring List type variables for storing and displaying list of cities and details of weather  */
 	private List states, details;
 
 	/* Declare and create vector type variables for storing list of cities and	list of labels  */
 	private Vector vstate = new Vector();
  	private Vector vlist = new Vector();
  		
  	/* Declaring variables for Command Buttons and initializing with null */
  	private Command cancelcommand = null;
 	private Command okcommand = null;
 	private Command goback = null;
 	private Command exit = null;
 
 	/*	Declaring Hashtable object and initialising it with null  */
 	private Hashtable htable = null;
  	
 	/* Creating  object of RecordStore type and initialising it with null */
 	RecordStore recordstore = null;	
 	
 	/* Declaring object of Class MainClass */
 	private MainClass lastscreen;
 	
 	/* Declaring constructor of Class Weather */
 	public Weather(Display displayweather, MainClass obj)
 	{
 		/* initializing Mainclass object lastscreen with the argument obj */
 		lastscreen = obj;
 		
 		/* Getting the current reference of any object which is present at run time 
	   for displaying it on the cellpone screen */
 		displaylist = displayweather;
 
         /* Create an object of List type to store the list of Cities */
 		states = new List("States",List.IMPLICIT);
 				
 		/* Registering the List object states for event Handling */
 		states.setCommandListener(this);
 
 		/* Creates an object for hashtable htable */
 		htable = new Hashtable();
 		
 		/* Creates an object for exit command defined as screen and give the  priority 2  */
 		exit = new Command("Exit",Command.EXIT,2);
 
 		/* Creates an object for Back  command defined as Command and given the priority 2 */
 		goback = new Command("Back",Command.BACK,1);
 		
 		/* Creates an object for Ok command defined as screen and given the priority 1 */
 		okcommand = new Command("OK",Command.SCREEN,1);
 
 		/* Creates an object for Cancel command defined as Screen and given the priority 2 */
 		cancelcommand = new Command("Cancel",Command.SCREEN,2);
  
 		/* Inserts label into vector vlist */
 		vlist.insertElementAt("State",0);
 		vlist.insertElementAt("Date",1);
  		vlist.insertElementAt("Sunrise",2);
 		vlist.insertElementAt("Sunset",3);
  		vlist.insertElementAt("Moonrise",4);
  		vlist.insertElementAt("Moonset",5);
  		vlist.insertElementAt("Day Humidity",6);
  		vlist.insertElementAt("Night Humidity",7);
 		vlist.insertElementAt("Day Wind Direction",8);
 		vlist.insertElementAt("Night Wind Direction",9);
  		vlist.insertElementAt("Day Wind Speed",10);
 		vlist.insertElementAt("Night Wind Speed",11);
 		vlist.insertElementAt("High Temp",12);
 		vlist.insertElementAt("Low Temp",13);
  		vlist.insertElementAt("Rain Fall",14);
 		vlist.insertElementAt("Forecast",15);
 	}
  	/* Declarartion of the method startApp */
  	/* Application Starts from this method */
  	public void startApp()
  	{
  
  		/* Store the path of xml file in url object as string */
  		String url = new String("http://192.192.168.100/midlet/template/midlet_weather.xml");
 		
  		/* Creating an object for DataParser class */
  		getd = new DataParser();
  				
  		/* Calling the method sourceurl and sending the path of the xml file */
  		getd.sourceurl(url);
  		
  		/* Calling  the read_record method for parsing XML file and
  		 storing the records into the Database and Hashtable */ 
  		getd.read_record();
  		
  		/*  Calling  the returnState method and returning the records in hashtable */
  		htable = getd.returnState();
 				
 		/*  Creates an object that implements the Enumeration interface generating a series of elements  
  			and the loop will execute till any element is present in Enumeration e object */ 
			for (Enumeration e = htable.keys(); e.hasMoreElements() ;) 
 			{
  				/* Adding values to List Object states, present in the hashtable */
  				states.append( (String)e.nextElement() , null);
  			}
  		/* display List states on cellphone screen */
  		displaylist.setCurrent(states);
  		
  		/* To attach the ok command button with List states */ 
  		states.addCommand(okcommand);
  
  		/* To attach the cancel command button with List states */ 
  		states.addCommand(cancelcommand);
 	}
  	
  	/* Declaring method for eventhandling routines */
  	public void commandAction(Command c, Displayable d)
  	{
  	
  		/* if condition is associated with ok command button when the user clicks it  */
  		if(c == okcommand)
 		{
  			String st = "";
 			/* get the postion which is selected by the user in the List states  */
  			int index  = states.getSelectedIndex();
  			
  			/* Retrieving the hashtable value according to the index number */
  			String hash_id = (String)htable.get(states.getString(index));
  			
  			/* Create an object details of List type to display the Weather Details */
  			details = new List("Weather of " +  states.getString(index)	, List.IMPLICIT) ;
  			
  			/* Registering the List object details for event Handling */
  			details.setCommandListener(this);
  			
  			/* displays List details on cellphone screen */
  			displaylist.setCurrent(details);
  					
  			try 
  			{
  				/* Opens the Recordstore addresses for retrieving the records */
  				recordstore = RecordStore.openRecordStore("addresses", true);	
  
  				/* Retreiving the record from the recordstore and storing it as String */
  				st = new String(recordstore.getRecord(Integer.parseInt(hash_id)));
  				
  				/* Closes the Recordstore after retrieving the records */
  				recordstore.closeRecordStore();	
  
  			}
  			catch(RecordStoreException rse) 
  			{
  				rse.printStackTrace();
  			}
  			
  			/* Declaring integer variables  */
  			int st_index = 0, end_index = 0, ctr = 0, pos ;
  			/* Storing the string length retrieved from the database */
  			int len = st.length();
  			
  			/* Declaring String type variable for storing the substring */ 
  			String sub_st = "";
 			
  			/* Declaring the character type array, creating space for array and 
  			   defining the size equivalent to string length */
  			char[] c_arr = new char[len];
  
  			/* Inserting String into character type array. */
  			c_arr = st.toCharArray();
  
  			/* For Loop for retreiving Weather record from the string and displaying it 
  			   on the cellphone screen */		
  			for (pos = 0; pos < len ; pos++)
  			{
  				if(c_arr[pos] == '?')
  				{
  					st_index = end_index ;
  					end_index = pos ;
  					ctr = ctr + 1;
  					if (ctr > 1)
  					{
  						sub_st = st.substring(st_index + 1,end_index);
  						details.append((String)vlist.elementAt(ctr - 2) + " " + sub_st, null);
 					}
  				}
  			}
  			/*  To attach the goback and exit command button with List details */
  			details.addCommand(goback);
  			details.addCommand(exit);
  		}
  
  		/* if condition is associated with exit command button when the user clicks it */
  		if(c == exit)
  		{
  			/* Destroys the weather application */
  			destroyApp( true );
 			/* Confirms application destroyed */ 
  			notifyDestroyed();
  			
  			/* The getDisplayObject method takes displayobject as parameter and displays the first screen of the application  */
  			lastscreen.getDisplayObject(displaylist); 
  		}
  		/* if condition is associated with cancel command button when the user clicks  */
  		if(c == cancelcommand)
  		{
  			/* Destroys the weather application */
  			destroyApp(true);
  			/* Confirms application destroyed */
  			notifyDestroyed();
  			
  			/* The getDisplayObject method takes displayobject as parameter and displays the first screen ot the application  */
  			lastscreen.getDisplayObject(displaylist);
  		}
  		/* if condition is associated with goback command button when the user clicks  */
  		if(c == goback)
  		{
  			/* displays List states on cellphone screen */
  			displaylist.setCurrent(states);
  			
  			/*  To attach the ok and cancel command button with List states */
  			states.addCommand(okcommand);
  			states.addCommand(cancelcommand);
  		}
  	}  
  		
  	/* Method called when the application is destroyed	*/
  	public void destroyApp(boolean b)
  	{
  		/* Deletes the records from the database by calling the deleterecords method  */
  		getd.deleterecords();
  	}
  	/* This method is called when the midlet is paused */
  	public void pauseApp()
  	{}		
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人午夜99999| 久久综合九色欧美综合狠狠 | 国产精品国产成人国产三级| 亚洲免费三区一区二区| 久久精品久久久精品美女| 色综合久久九月婷婷色综合| 精品乱码亚洲一区二区不卡| 亚洲国产视频一区| 99久久99久久精品国产片果冻| 欧美一区二区三区四区在线观看 | 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 日本一区二区视频在线| 婷婷六月综合网| aaa欧美大片| 国产欧美精品一区aⅴ影院 | 亚洲一区二区三区在线| 成人av片在线观看| 精品欧美久久久| www.欧美精品一二区| 欧美电影免费提供在线观看| 亚洲国产综合91精品麻豆 | 国产精一区二区三区| 欧美日韩国产综合一区二区三区| 亚洲视频狠狠干| 99re8在线精品视频免费播放| 国产网站一区二区三区| 精品一区二区三区免费播放| 日韩视频国产视频| 青青草原综合久久大伊人精品优势| 色噜噜夜夜夜综合网| 亚洲精品乱码久久久久久日本蜜臀 | 99久精品国产| 亚洲人成网站影音先锋播放| 91视频国产资源| 亚洲视频综合在线| 一本一本久久a久久精品综合麻豆| 国产农村妇女精品| 成人午夜伦理影院| 日韩一区中文字幕| 91麻豆免费看| 亚洲已满18点击进入久久| 欧美午夜在线观看| 性做久久久久久| 欧美一区二区在线免费播放| 另类欧美日韩国产在线| 亚洲精品一区二区三区香蕉| 国产一区二区按摩在线观看| 久久精品视频一区二区三区| 国产成人av一区二区| 自拍偷拍国产精品| 欧美日韩中文字幕一区| 日本不卡视频在线| 久久精品一区二区三区不卡| 99久久99久久精品免费观看| 午夜一区二区三区在线观看| 欧美大片一区二区| 国产99久久久久| 一区二区三国产精华液| 欧美一级欧美三级在线观看 | 美女在线视频一区| 欧美国产激情一区二区三区蜜月 | 欧美日韩国产三级| 国产精品一区二区三区网站| 综合色中文字幕| 日韩午夜电影在线观看| 成人综合婷婷国产精品久久蜜臀| 亚洲精品国产精华液| 欧美丰满少妇xxxxx高潮对白| 精品亚洲国产成人av制服丝袜 | 久久亚洲精品国产精品紫薇| 99久久伊人网影院| 日本人妖一区二区| 精油按摩中文字幕久久| 中文字幕中文在线不卡住| 欧美日韩和欧美的一区二区| 国产夫妻精品视频| 亚洲午夜久久久久久久久久久| 精品成人一区二区三区| 91久久精品国产91性色tv| 国产精品自拍在线| 同产精品九九九| 亚洲欧洲综合另类| 国产网站一区二区三区| 在线综合视频播放| 一本到一区二区三区| 国产精品白丝jk白祙喷水网站| 亚洲成a人片在线观看中文| 国产精品亲子伦对白| 欧美精品一区二区三区在线| 欧美午夜精品理论片a级按摩| 成人午夜视频在线| 国产一区二区视频在线播放| 视频一区中文字幕国产| 玉米视频成人免费看| 国产精品色眯眯| 久久久久久久久蜜桃| 日韩欧美激情在线| 69成人精品免费视频| 在线观看免费视频综合| bt欧美亚洲午夜电影天堂| 国产精品一区二区免费不卡| 六月丁香婷婷久久| 日韩—二三区免费观看av| 亚洲黄网站在线观看| 1024亚洲合集| 亚洲欧美一区二区三区国产精品| 国产欧美一区二区三区鸳鸯浴| 久久亚洲综合av| 久久免费的精品国产v∧| 欧美大片顶级少妇| 日韩一区二区在线观看视频| 日韩一区二区三区在线观看| 6080午夜不卡| 日韩欧美久久久| 精品伦理精品一区| 精品91自产拍在线观看一区| 精品国产网站在线观看| 精品久久国产老人久久综合| 日韩欧美亚洲另类制服综合在线| 91精品国产麻豆| 日韩视频在线一区二区| 欧美v亚洲v综合ⅴ国产v| 欧美本精品男人aⅴ天堂| 久久亚洲一区二区三区明星换脸| 久久久久亚洲综合| 欧美经典一区二区三区| 中文字幕五月欧美| 亚洲欧美另类图片小说| 亚洲超丰满肉感bbw| 男女视频一区二区| 国产激情偷乱视频一区二区三区| 国产高清在线精品| 99re成人在线| 欧美妇女性影城| 久久久精品tv| 亚洲欧洲日韩一区二区三区| 亚洲一区二区三区国产| 久久99久久99| 成年人网站91| 777精品伊人久久久久大香线蕉| 欧美一区二区在线视频| 亚洲国产精品t66y| 一区二区三区美女视频| 男女男精品网站| 不卡视频免费播放| 日本高清不卡视频| 精品欧美黑人一区二区三区| 国产精品久久精品日日| 性做久久久久久免费观看欧美| 美女爽到高潮91| av中文字幕一区| 日韩视频永久免费| 国产精品乱人伦| 日韩综合一区二区| 从欧美一区二区三区| 91麻豆精品国产91久久久使用方法 | 日韩一区二区三区电影在线观看| 欧美国产禁国产网站cc| 亚洲v精品v日韩v欧美v专区| 国产精品一二三区在线| 欧美色网一区二区| 欧美国产日产图区| 青青草国产精品亚洲专区无| 不卡免费追剧大全电视剧网站| 日韩一二在线观看| 亚洲女女做受ⅹxx高潮| 国产福利一区二区三区视频| 欧美老女人第四色| 一区二区三区四区视频精品免费| 激情六月婷婷综合| 欧美日韩黄视频| 一区二区免费视频| 成人午夜精品一区二区三区| 欧美tickle裸体挠脚心vk| 亚洲成人综合网站| 色综合久久精品| 国产精品久久久久影院老司 | 日韩av一级片| 欧美性受xxxx黑人xyx性爽| 中文字幕亚洲在| 国产成人精品免费一区二区| 日韩欧美激情一区| 图片区小说区区亚洲影院| 色94色欧美sute亚洲线路一久| 国产精品女同互慰在线看| 国内精品写真在线观看| 日韩一级黄色大片| 蜜臀99久久精品久久久久久软件| 欧美亚洲国产一区在线观看网站| 中文字幕一区三区| 成人aa视频在线观看| 国产精品人成在线观看免费 | 欧美日本国产一区| 亚洲va国产天堂va久久en| 色婷婷av一区| 一区二区三区在线视频观看58| 成人av高清在线| 中文字幕在线一区免费| 99国产精品久久久久| 亚洲欧美自拍偷拍色图|