Exemplo n.º 1
0
 public void update(PageArray pa) {
   if (pa == null) {
     return;
   }
   for (int i = 0; i < pa.getPageSize(); i++) {
     Page newP = pa.getPageByIndex(i);
     Page oldP = getPage(newP.no);
     if (oldP == null) {
       updatePage(newP);
     } else {
       oldP.update(newP);
     }
   }
 }
Exemplo n.º 2
0
 /**
  * Get page according page number.
  *
  * @param no from 1 start
  * @return
  */
 public Page getPage(int no) {
   if (no <= 0 || no > pageArray.getPageSize()) {
     throw new IndexOutOfBoundsException("Page no is incorrect ");
   }
   return pageArray.getPage(no);
 }
Exemplo n.º 3
0
 public int getPageSize() {
   return pageArray.getPageSize();
 }
Exemplo n.º 4
0
 public Page getActivatePage() {
   return pageArray.getPage(currentPageNo);
 }
Exemplo n.º 5
0
 public Page findPage(int no) {
   return pageArray.getPage(no);
 }
Exemplo n.º 6
0
 public void addPage(Page p) {
   if (p == null) {
     throw new NullPointerException(" page is null");
   }
   pageArray.addPage(p);
 }