code: @Override
      public int compareTo(BLine other) {
  
          int pageCompare = new Integer(pageId).compareTo(other.pageId);
          if (pageCompare != 0) {
              return pageCompare;
          }
  
          int xCompare = new Float(region.x).compareTo(other.region.x);
          if (xCompare != 0) {
              return xCompare;
          }
          int yCompare = new Float(region.y).compareTo(other.region.y);
          return yCompare;
      }
docs: compare by page, x,y