Java 时间范围 Util
import java.util.Date;
public class TimeSpan
{
public final static TimeSpan ZERO = new TimeSpan(0);
private long _totalMilliSeconds = 0;
public TimeSpan(long totalMilliSeconds)
{
_totalMilliSeconds = totalMilliSeconds;
}
public TimeSpan(Date afterDate, Date beforeDate)
{
this(afterDate.getTime() - beforeDate.getTime());
}
public long getMilliSeconds()
{
return _totalMilliSeconds;
}
public long getSeconds()
{
return Math.round(_totalMilliSeconds/1000);
}
public long getMinutes()
{
return Math.round(_totalMilliSeconds/(1000*60));
}
public long getHours()
{
return Math.round(_totalMilliSeconds/(1000*60*60));
}
}
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
JAVA虚拟机有一个字符串池,对于字符串池的访问可以使用字符串对象的intern()方法,可动态向池中添加对象,它的定义如下:
public native String intern();
这是一个本地方法,在调用这个方法时,JAVA虚拟机首先检查字符串池中是否存在与该字符串对象值相等的对象,如果存在就返回字符串池中的对象的引用,否则就新创建一个 ......
安装与设置JDK
Sun JDK的安装基本上有两种方式:
1. 通过Ubuntu提供的包管理工具进行安装
Ubuntu在其包仓库里都包括有JDK的安装,只要sources.list设置正确,通
过apt-get, aptitude, Synaptic Package
Manager等都能安装,而且相关的设置也容易得多;在Ubuntu的新
发布版本里都带了JDK5.0,和JDK6.0的安装支持,而且 ......
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import com.paic.is.dispatch.TMPEntry;
public class DateTimeUtil
{
public final static String LOCAL_SHORT_DATE_FORMAT = "yyyy-MM-dd";
public final static String LOCAL_LONG_DATE_FORMAT = "yyyy-MM-dd H ......
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import com.paic.is.dispatch.TMPEntry;
public class FileUtil
{
public static File getFileByRelativePath(String ......