网站首页
JSP空间
动态资讯
开源项目
技术文档
资源下载
J2EE资源
客户论坛
在线支付
 
  技术文档>>JAVA>>新手入门>>基础入门>查看文档  
  一些非常有用的java常用方法( 2)     
  文章作者:未知  文章来源:水木森林  
  查看:139次  录入:管理员--2007-11-17  
 
  int cint(float stsid){
     int cint = 0;
     try{
      int stsid1 = 0;
   if(stsid > 0){
      if((stsid - (int)stsid > 0) && (stsid - (int)stsid != 0.5))
         stsid1 = (int)(stsid + 0.5);
      if(stsid - (int)stsid == 0.5){
      if(((int)(stsid-0.5))%2 == 0)
         stsid1 = (int)(stsid - 0.5);
      else
            stsid1 = (int)(stsid + 0.5);
      }
            if(stsid - (int)stsid ==0)
      stsid1 = (int)stsid;
   }else{
      stsid = -stsid;
   if((stsid - (int)stsid > 0) && (stsid - (int)stsid != 0.5))
         stsid1 = - (int)(stsid + 0.5);
      if(stsid - (int)stsid == 0.5){
      if(((int)(stsid-0.5))%2 == 0)
         stsid1 = - (int)(stsid - 0.5);
      else
            stsid1 = - (int)(stsid + 0.5);
      }
            if(stsid - (int)stsid ==0)
      stsid1 = - (int)stsid;
   }
   cint = stsid1;
  }catch(exception e){}
  return cint;
  }

long clng(float numb){
     int nu = 0;
     long clng = 0;
     try{
        nu = cint(numb);
        clng = (long) nu;
     }catch(exception e){}
     return clng;
}

float dealfloat(string s){
    s=dealnull(s);
    if (s.equals(""))
return 0;
    return float.parsefloat(s);
}

string[] split(string source,string div){
      int arynum = 0,intidx=0,intidex=0,div_length = div.length();     
      if(source.compareto("")!=0){      
        if(source.indexof(div)!=-1){       
         intidx = source.indexof(div);        
         for(int intcount =1 ; ; intcount++){        
           if(source.indexof(div,intidx+div_length)!=-1){
             intidx= source.indexof(div,intidx+div_length);
             arynum = intcount;
             }
           else {arynum+=2;break;}
            }                    
       }else arynum =1;
      }else arynum = 0;
     
      intidx=0;
      intidex=0;
      string[] returnstr = new string[arynum];
     
      if(source.compareto("")!=0){
      
       if(source.indexof(div)!=-1){
       
        intidx = (int)source.indexof(div);
        returnstr[0]= (string)source.substring(0,intidx);
      
        for(int intcount =1 ; ; intcount++){
           if(source.indexof(div,intidx+div_length)!=-1){
             intidex=(int)source.indexof(div,intidx+div_length);
             
             returnstr[intcount] = (string)source.substring(intidx+div_length,intidex);
             
             intidx = (int)source.indexof(div,intidx+div_length);
             }
           else {
                returnstr[intcount] = (string)source.substring(intidx+div_length,source.length());
                break;
                }
            }
      }
      else {returnstr[0] = (string)source.substring(0,source.length());return returnstr;}
     }
     else {return returnstr;}                  
    return returnstr;    
}


public class stc_rsyb_name
  {
    public int pos = -1;
    public string name = "";
    public string host = "";
    public string home1 = "";
    public string home2 = "";
    public string home3 = "";
  }
  public class stc_syb_inf
  {
    string reg_name  = "";
    string g_syb = "";
    string r_syb = "";
  }
file://输出空格
void showblank(int num,jspwriter out){
try{
for(int i=0;i<=num;i++)
  out.print(" ");
}
catch(exception e){}  
}


   string g_syb_mk(){
     string g_syb_mk = nul
 
 
上一篇: 一个用来访问http服务器的东西。功能类似于java.net中的那个。但要强。    下一篇: 一些非常有用的java常用方法(1)
  相关文档
用jbuilder实现类似visualstudio的宏扩展功能 11-17
java线程简介(线程基础) 11-17
ojb中的多表查询和更新 11-17
浅谈java中的存储空间类型 11-17
commons-fileupload和struts公用问题 11-17
struts开发指南之其他web构架介绍 11-17
java应用热遍全球 11-17
关于java的一些 工具,类库,框架...... 11-17
为java应用程序添加退出事件响应 11-16
最简单的struts程序 11-17
递增 (++) 和递减 (--) 运算符 11-16
关于继承和接口的一个非常有趣的比喻 11-17
java设计模式之装饰模式(1) 11-16
j2ee中使用spring aop框架和ejb组件 11-16
利用java实现zip压缩/解压缩(2) 11-17
j2ee基础:java rmi分布式应用程序概述 11-16
古代帝国中的图片资源节省算法 11-17
java简单数据类型 11-17
java学习备忘录(二)基础语法和数组 11-17
java编程测试1m内存可用来缓存多少对象 11-16
返回首页 | 关于我们 | J网章程 | JSP空间合租 | 客服中心 | 免责声明 | 常见问题 | 参观机房
本站主机空间代理至厦门市华众网络科技有限公司
《中华人民共和国增值电信业务经营许可证》
编号:闽B2-20050079
@2005-2008福建JSP技术网 版权所有 闽ICP备05000928号
技术电话:13616026886
邮箱:admin@fjjsp.com 站长QQ,点击这里给我发消息