·ÖÒ³¹¦ÄܵÄjavaʵÏÖ
×î½ü×öÒ»¸öÏîÄ¿£¬ÒªÓõ½·ÖÒ³¹¦ÄÜ£¬²Î¿¼Á˺ܶ෽·¨£¬ÓеIJ»ºÏÊÊ£¬ÓеIJ»Ï²»¶£¬ÓÚÊÇ×Ô¼ºÔÚËûÃǵĻù´¡ÉÏÕûÁËÒ»¸ö£»Ë¼Â·ÊÇÕâÑùµÄ£ºÏÈ°ÑÐèÒª·ÖÒ³µÄÊý¾Ý»òÊǼǼ¶¼²éѯ³öÀ´ ´æÈëÒ»¸ö¼¯ºÏÀàÀïÈçList»òÊÇVector£¬È»ºóÀûÓÃÆäsublist(int findex,int eindex)·½·¨£¬»ñÈ¡ÐèÒª·ÖÒ³µÄÊý¾Ý»ò¼Ç¼,¹ØÓÚsublist()º¯Êý¾Í×Ô¼ºÈ¥²éAPIÁË¡£ÏÂÃæÌùÏ´úÂë°É£¬Ê×ÏÈÊǽ«·ÖÒ³ËùÐèµÄһЩ¸ö¶«¶«³éÏó³öÒ»¸öjavabean¶ÔÏó—PageBean:
public class PageBean {
private int curPage; //µ±Ç°Ò³
private int pageCount; //×ÜÒ³Êý
private int rowsCount; //×ÜÐÐÊý
private int pageSize=10; //ÿҳ¶àÉÙÐÐ
public PageBean(int rows){
this.setRowsCount(rows);
if(this.rowsCount % this.pageSize == 0){
this.pageCount=this.rowsCount / this.pageSize;
}
else if(rows<this.pageSize){
this.pageCount=1;
}
else{
this.pageCount=this.rowsCount / this.pageSize +1;
}
}
public int getCurPage() {
return curPage;
}
public void setCurPage(int curPage) {
this.curPage = curPage;
}
public int getPageCount() {
return pageCount;
}
public void setPageCount(int pageCount) {
this.pageCount = pageCount;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getRowsCount() {
return rowsCount;
}
public void setRowsCount(int rowsCount) {
this.rowsCount = rowsCount;
}
}
·ÖÒ³ÏÔʾ£º
List clist=adminbiz.queryNotFullCourse();//½«²éѯ½á¹û´æ·ÅÔÚList¼¯ºÏÀï
PageBean pagebean=new PageBean(clist.size());//³õʼ»¯PageBean¶ÔÏó
//ÉèÖõ±Ç°Ò³
pagebean.setCurPage(page); //ÕâÀïpageÊÇ´ÓÒ³ÃæÉÏ»ñÈ¡µÄÒ»¸ö²ÎÊý£¬´ú±íÒ³Êý
//»ñµÃ·ÖÒ³´óС
int pagesize=pagebean.getPageSize();
//»ñµÃ·ÖÒ³Êý¾ÝÔÚlist¼¯ºÏÖеÄË÷Òý
int firstIndex=(page-1)*pagesize;
int toIndex=page*pagesize;
if(toIndex>clist.size()){
toIndex=clist.size();
}
if(firstIndex>toIndex){
firstIndex=0;
pagebean.setCurPage(1);
}
//½ØÈ¡Êý¾Ý¼¯ºÏ£¬»ñµÃ·ÖÒ³Êý¾Ý
Li
Ïà¹ØÎĵµ£º
Ôڳɹ¦ÊµÏÖJavaµ÷ÓÃC++Ö®ºó£¬½ÓÏÂÀ´Ïëµ½ÄÜ·ñͨ¹ýJNAʵÏÖJavaµ÷ÓÃFortran£¬½ñÌìÊÔÑéÁËһϣ¬»¹ÊDZȽÏÈÝÒ׵ġ£
ÍøÉÏÓÐÒ»¸öJavaµ÷ÓÃF95µÄÀý×Ó£¬µ«ÊÇÎÒ¿¼ÂDz»½öҪʵÏÖF95µÄµ÷Ó㬻¹ÒªÊµÏÖF77µÄµ÷Óã¬ËùÒÔ·ÑÁËһЩÖÜÕÛ¡£
ÎÊÌâµÄ¹Ø¼üÔÚÓÚF77Ϊ¹ý³ÌÃû×Ô¶¯Ìí¼ÓÁËÒ»¸öβ²¿µÄÏ»®Ïߣ¬ËùÒÔsub1Õâ¸ö¹ý³Ì£¬µ½JavaÒ»¶Ë£¬¾Í±ä³ÉÁËsub1_£¬ ......
×î½ü¹«Ë¾Åöµ½ÐèÒªÓÃͼ±íµÄÐÎʽÏÔʾһЩÊý¾Ý£¬ÎҾͿªÊ¼µ½ÍøÉϲéѯ£¬²éµ½ÁËjfreechartºÍamcharts,ÕâÁ½ÕßÎÒ¶¼ÊµÏÖ¹ýÁË£¬jfreechart×îºóÉú³ÉͼƬ£¬µ«ÊÇͼƬЧ¹û²»ÊÇÎÒÏëÒªµÄ£¬È»ºóÓÖÑо¿amcharts ËüµÄЧ¹ûȷʵºÜºÃ£¬¶øÇÒ¹Ù·½ÍøÕ¾ÉÏ»¹ÓкÃЩÀý×ӿɹ©ÏÂÔØ£¬ÍøÖ·ÊÇ:www.amcharts.com
£¨ÏëÒªÍê³ÉÒ»¸öamchartsͼÐÎÐèÒªswfobjects. ......
import java.util.ArrayList;
import java.util.HashMap;
public class Client {
/**
* @param args
*/
public static void main(String[] args) {
test1();
System.out.println("==================================");
test2();
......
¸Õ¸Õ¿´µ½Ò»ÆªÎÄÕÂÌá³öc++¶à̬Óëjava¶à̬²»Í¬µÄµØ·½£¬»ù±¾Òâ˼ÈçÏ£º
Çë¿´C++´úÂ룺
class Base
{
public:
Base()
{
init();
}
virtual ~Base() {}
protected:
int value;
virtual void init()
{
value = 100; &nb ......
1.¾²Ì¬µ¼È룺
¾²Ì¬µ¼ÈëÊÇJDK1.5ºóмӵŦÄÜ£¬Ò»°ã²»Ôõô³£Ó㬺ܼòµ¥¸øÄã¾Ù¸öÀý×ÓÄã¾ÍÄÜÃ÷°×ÁË£¬¿´Õâ¶Î´úÂ룺
import static java.lang.System.out;//µ¼Èëjava.lang°üϵÄSystemÀàµÄ¾²Ì¬·½·¨out;
public class HelloWorld{
public static void main(String[] args){
out.print("Hello World!");//¼ÈÊÇÔÚÕ ......