Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java ¶Áдexcel

public class OperatExcel
{
    private  File file = new File(ParamenterInit.SRCEXCELPATH);
    private  File outfile = new File(ParamenterInit.DESTEXCELPATH);
    private static String sheetName = ParamenterInit.SHEETNAME;
    private static int column =Integer.parseInt(ParamenterInit.SHELLCOLUMN);
    private static int sqlcolumn =Integer.parseInt(ParamenterInit.SQLCOLUMN);
    public static void main(String args[] ) throws  IOException, RowsExceededException, BiffException, WriteException{
        OperatExcel op = new OperatExcel();
        op.writeExcel();
    }
   
  
    public   List readExcel() throws  IOException{
        InputStream in = new FileInputStream(file);
        List list = new ArrayList();
        try{
        Workbook book = Workbook.getWorkbook(in);
       Sheet sheet =  book.getSheet(sheetName);
       Cell cell [] =  sheet.getColumn(column);
      
        for(Cell c : cell){
            list.add(c.getContents().trim().startsWith("/")?c.getContents().substring(1).trim():c.getContents().trim());
        }
       
        in.close();
        //in.close();
        }catch(Exception ex){
            ex.printStackTrace();
&nbs


Ïà¹ØÎĵµ£º

JAVAÏß³ÌÖ®ËÄ£ºÏß³Ì״̬¼ì²é£¬ºǫ́Ï̼߳°Ïß³Ì×é

Ò»£¬Ïß³Ì״̬µÄ¼ì²é
      Ò»°ãÇé¿öÏÂÎÞ·¨È·¶¨Ò»¸öÏ̵߳ÄÔËÐÐ״̬£¬¶ÔÓÚÕâЩ´¦ÓÚδ֪״̬µÄỊ̈߳¬¿ÉÒÔͨ¹ýisAlive()·½·¨ÓÃÀ´È·¶¨Ò»¸öÏß³ÌÊÇ·ñÈÔ´¦Ôڻ״̬¡£µ±È»¼´Ê¹´¦Óڻ״̬µÄÏß³ÌÒ²²¢²»Òâζ×ÅÕâ¸öÏß³ÌÒ»¶¨ÕýÔÚÔËÐУ¬¶ÔÓÚÒ»¸öÒÑ¿ªÊ¼ÔËÐе«»¹Ã»ÓÐÍê³ÉÈÎÎñµÄỊ̈߳¬Õâ¸ö·½·¨·µ»ØֵΪtrue¡£
......

JavaÉè¼Æģʽ֮Flyweightģʽ


GOF£ºÔËÓù²Ïí¼¼ÊõÓÐЧµØÖ§³Ö´óÁ¿Ï¸Á£¶ÈµÄ¶ÔÏó¡£
 
½âÊÍһϸÅÄҲ¾ÍÊÇ˵ÔÚÒ»¸öϵͳÖÐÈç¹ûÓжà¸öÏàͬµÄ¶ÔÏó£¬ÄÇôֻ¹²ÏíÒ»·Ý¾Í¿ÉÒÔ
ÁË£¬²»±Øÿ¸ö¶¼È¥ÊµÀý»¯Ò»¸ö¶ÔÏó¡£±ÈÈç˵£¨ÕâÀïÒýÓÃGOFÊéÖеÄÀý×Ó£©Ò»¸öÎı¾ÏµÍ³£¬Ã¿¸ö×Öĸ¶¨Ò»¸ö¶ÔÏó£¬ÄÇô´óСд×Öĸһ¹²¾ÍÊÇ52¸ö£¬ÄÇô¾ÍÒª¶¨Òå
52¸ö¶ÔÏó¡£Èç¹ûÓÐÒ»¸ö1MµÄÎ ......

´«ÖDz¥¿ÍjavaÅàѵ¡ï¡ï¡ï¡ï¡ïJavaWeb»ù´¡ ÔöÇ¿For

    ½ñÌì·Å¼ÙÒ»Ì죬֮ǰµÄѧϰÈÃÎҸоõÂäÏÂÐí¶à£¬ËùÒÔÔçÉÏÔçÔçµÄÆðÀ´ÔÚÕâÀïд´úÂë ²¹¹¦¿ÎÀ²¡£ForÑ­»·´ó¼ÒÓ¦¸Ã²»»áÄ°Éú°É£¬½ñÌì°ÑforÔÙ´ÎÊìϤÏ£¬¹®¹Ì֪ʶÂï¡£
 
µÚÒ»£¬ÔöÇ¿forµÄʹÓÃÌõ¼þ£º
    1.Êý×é   2.Iterator µü´úÆ÷
 
µÚ¶þ£¬´«Í³FORÓëÔöÇ¿FORµÄ¾ÙÀý±È½Ï:
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ