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);
     }
   }
 }
 /**
  * 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);
 }
 public int getPageSize() {
   return pageArray.getPageSize();
 }
 public Page getActivatePage() {
   return pageArray.getPage(currentPageNo);
 }
 public Page findPage(int no) {
   return pageArray.getPage(no);
 }
 public void addPage(Page p) {
   if (p == null) {
     throw new NullPointerException(" page is null");
   }
   pageArray.addPage(p);
 }