line.java

来自「一个完整的门户网站,基于JSP环境下开发的,使用SQL数据库.」· Java 代码 · 共 63 行

JAVA
63
字号
package com.bwm.database;import java.util.Collection;import java.util.Iterator;import com.bwm.model.Soft;import com.bwm.model.Mend;/** * <p>Title: mingrisoft</p> * <p>Description: 明日科技门户网站</p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: MR</p> * @author BWM * @version 1.0 */public class Line {    public int[] softToArray(){        int[] soft=null;        Collection softcoll=new Dbsoft().Select("");        if(softcoll==null||softcoll.size()<=0||softcoll.isEmpty()){            return null;        }else{            soft=new int [softcoll.size()];            Iterator it=softcoll.iterator();            for(int i=0;i<softcoll.size()&&it.hasNext();i++){                Soft s=(Soft)it.next();                soft[i]=s.getLoadnum();           }        }        return soft;    }    private int[] mendToArray(){        int[] mend=null;        Collection softcoll=new Dbmend().Select("ORDER BY loadnum DESC");        if(softcoll==null||softcoll.size()<=0||softcoll.isEmpty()){            return null;        }else{            mend=new int [softcoll.size()];            Iterator it=softcoll.iterator();            for(int i=0;i<softcoll.size()&&it.hasNext();i++){                Mend s=(Mend)it.next();                mend[i]=s.getLoadnum();            }        }        return mend;    }    public int[] getCountLine(){        int soft[]=softToArray();        int mend[]=mendToArray();        int count[]=new int [soft.length+mend.length];        for(int i=0;i<soft.length;i++){            count[i]=soft[i];            System.out.println(soft[i]+" soft[i]");        }        for(int j=0;j<mend.length;j++){            count[soft.length+j]=mend[j];            System.out.println(mend[j]+" mend[i]");        }        return count;    }}

⌨️ 快捷键说明

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