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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? weather.java

?? Mobile Services
?? JAVA
字號(hào):
/* 	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()
  	{}		
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一卡二卡三卡| av毛片久久久久**hd| 国产精品白丝av| 91小视频在线| 91精品视频网| 国产欧美日韩精品一区| 亚洲自拍偷拍av| 国产在线播精品第三| 91丝袜美女网| 日韩一区二区三区免费看| 亚洲精品一区二区三区精华液| 国产欧美一区二区三区网站| 一二三区精品视频| 国产精品一区二区果冻传媒| 欧美在线观看你懂的| 久久久久久久一区| 性欧美大战久久久久久久久| 国产盗摄女厕一区二区三区| 欧美日韩一区小说| 国产日韩欧美激情| 日韩中文字幕一区二区三区| 久久久久久久久99精品| 亚洲午夜久久久| 国产成人精品免费| 制服丝袜亚洲色图| 尤物在线观看一区| 国产一区二区0| 欧美精品久久天天躁| 国产精品久久久久久久午夜片| 日韩高清在线不卡| 色综合天天综合给合国产| 久久综合九色综合久久久精品综合| 亚洲精品国产一区二区三区四区在线 | 亚洲成av人片一区二区三区| 国产一区二区导航在线播放| 7777精品伊人久久久大香线蕉的 | av电影天堂一区二区在线| 欧美岛国在线观看| 亚洲国产视频一区| a美女胸又www黄视频久久| 欧美成人官网二区| 午夜视频一区在线观看| 91玉足脚交白嫩脚丫在线播放| 欧美不卡激情三级在线观看| 天天综合色天天综合色h| 91啪亚洲精品| 国产精品欧美精品| 欧美精品高清视频| 亚洲综合免费观看高清完整版在线 | 欧美色综合久久| 日韩毛片高清在线播放| 国产剧情在线观看一区二区| 欧美一级生活片| 天天影视网天天综合色在线播放 | 日韩精品亚洲专区| 欧美日韩中文一区| 一级日本不卡的影视| 91啪亚洲精品| 亚洲欧美色一区| 99久久久国产精品| 中文字幕av一区二区三区免费看| 国模冰冰炮一区二区| 久久香蕉国产线看观看99| 麻豆精品蜜桃视频网站| 91精品国产综合久久久久久| 亚洲第一福利一区| 欧美日韩亚洲丝袜制服| 欧美影视一区二区三区| 亚洲一区二区三区四区的| 色婷婷激情综合| 亚洲综合丝袜美腿| 欧美日韩国产电影| 日本三级亚洲精品| 欧美白人最猛性xxxxx69交| 国内精品视频一区二区三区八戒| 日韩欧美中文字幕精品| 狠狠网亚洲精品| 亚洲国产电影在线观看| 国产.欧美.日韩| 亚洲三级视频在线观看| 欧美体内she精高潮| 亚洲成人三级小说| 欧美一级午夜免费电影| 国产久卡久卡久卡久卡视频精品| 久久免费午夜影院| 成人免费毛片嘿嘿连载视频| √…a在线天堂一区| 在线视频国内一区二区| 午夜精品一区二区三区三上悠亚| 日韩一区二区三区精品视频| 久久电影网站中文字幕| 久久精品一区二区三区av| 99久久婷婷国产| 亚洲丶国产丶欧美一区二区三区| 欧美一区二区私人影院日本| 国产一区二区三区电影在线观看| 国产喂奶挤奶一区二区三区| 99re在线精品| 视频一区中文字幕国产| 久久久久国产免费免费| 91亚洲精品一区二区乱码| 午夜成人免费电影| 久久精品夜夜夜夜久久| 一本色道亚洲精品aⅴ| 视频在线观看国产精品| 久久久.com| 色美美综合视频| 日韩成人一区二区| 中文一区二区在线观看| 在线观看一区二区精品视频| 久久精品国产免费| 国产精品三级在线观看| 欧美区一区二区三区| 国产精品一区二区三区四区| 亚洲精品写真福利| 欧美一区二区三区免费| 成人污视频在线观看| 亚洲自拍另类综合| 久久久久久久电影| 欧美中文字幕一区| 国产福利精品导航| 图片区小说区国产精品视频| 国产欧美日韩另类一区| 欧美理论片在线| av激情综合网| 麻豆精品在线视频| 一区二区三区国产豹纹内裤在线| 免费高清在线视频一区·| 亚洲视频图片小说| 久久午夜免费电影| 欧美日韩一级二级| 成人中文字幕合集| 免费日本视频一区| 一区二区三区日韩| 欧美国产日韩精品免费观看| 51精品秘密在线观看| 成人精品小蝌蚪| 麻豆国产91在线播放| 伊人一区二区三区| 欧美激情一区在线观看| 欧美一区二区三区视频在线| 99久久精品免费观看| 另类小说色综合网站| 亚洲一区二区三区爽爽爽爽爽| 久久精品一区二区三区不卡牛牛| 678五月天丁香亚洲综合网| 97se亚洲国产综合自在线观| 国产精品中文有码| 日本不卡一区二区三区高清视频| 亚洲欧美日本在线| 国产精品污网站| 亚洲精品一区二区三区蜜桃下载 | 日本不卡一区二区| 亚洲综合自拍偷拍| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产在线播精品第三| 午夜精品成人在线| 亚洲码国产岛国毛片在线| 国产欧美日韩不卡| 久久免费电影网| 精品少妇一区二区三区视频免付费 | 国产欧美va欧美不卡在线| 日韩三级中文字幕| 欧美精品tushy高清| 欧洲激情一区二区| 日本道精品一区二区三区| 97se亚洲国产综合自在线观| jlzzjlzz亚洲女人18| 春色校园综合激情亚洲| 国产乱子伦视频一区二区三区| 麻豆国产精品777777在线| 欧美a一区二区| 三级不卡在线观看| 日韩一区精品视频| 天天av天天翘天天综合网色鬼国产 | caoporen国产精品视频| 国产91对白在线观看九色| 成人午夜av影视| www.在线成人| 91欧美激情一区二区三区成人| 国产精品久久久久久久岛一牛影视| 久久麻豆一区二区| 国产亚洲成aⅴ人片在线观看| 欧美精品一区二区三区蜜桃| 欧美va亚洲va| 久久综合色之久久综合| 欧美大片在线观看| 精品第一国产综合精品aⅴ| 久久亚洲二区三区| 欧美国产精品中文字幕| 中文字幕在线不卡视频| 亚洲美女一区二区三区| 亚洲在线一区二区三区| 婷婷中文字幕一区三区| 久久成人精品无人区| 国产成人午夜视频| 97久久精品人人澡人人爽| 欧美优质美女网站| 日韩一级完整毛片| 久久久精品综合|