Page constructor

```js
var page = new Page();
```

@param {Object} `page` optional page object to populate initial values.
@api public
182328
function Page(page) {
  if (!page) page = {};
  for (var key in page) this[key] = page[key];
  if (!this.hasOwnProperty('idx')) this.idx = 0;
  if (!this.hasOwnProperty('total')) this.total = 1;
  if (!this.hasOwnProperty('current')) {
    this.current = this.total;
  }
}
171251
public void setPage(int page) {
        if(page < 0)
            throw new IllegalArgumentException(Bundle.getErrorString("PagerModel_IllegalPage"));

        /* todo: need to check that the new 'current' page is in range given the first/last boundaries */
        _currentRow = new Integer(page * getPageSize());
    }
799768
function(fnName, args) {
        var pageCount = this.cfg.getProperty(DEF_CFG.PAGES.key);

        for (var p=0;p<pageCount;++p) {
            var page = this.pages[p];
            if (page[fnName]) {
                var fn = page[fnName];
                fn.call(page, args);
            }
        } 
    }
1368656
function(page) {
			var regixAll = /(<p>!FILENAME\s+([\S].+)<\/p>)\s*<pre>[\s\S]*?(<\/pre>)/g;
			var regix = /(<p>!FILENAME\s+([\S].+)<\/p>)\s*<pre>[\s\S]*?(<\/pre>)/;
			var replacer = function(filename){
				return '<div><p class="code-filename">' + filename + '</p></div>';
			}

			var tagAll = page.content.match(regixAll);

			for(var j = 0; tagAll && j < tagAll.length; j++){
				var tag = page.content.match(regix);
				var replace = tag[0].replace(tag[1], replacer(tag[2]));
				page.content = page.content.replace(tag[0], replace);
			}

			return page;
		}
998252
def new
      @page.parent ||= Page.where(id: params['parent_id']).first
      respond_to do |format|
        format.html { render layout: false if request.xhr? }
        format.json { render json: @page }
      end
    end
1035081
function(pages, callback) {
      var t = this,
          didError = false,
          numLeft = pages.length;

      // Callback early if no pages to read
      if (pages.length === 0) {
        return callback();
      }

      // Read and parse each file for the title/description
      pages.forEach(function(page, index) {

        // Read the file
        var fullPath = Path.join(t.dirPath, page.id + '.json');
        FS.readFile(fullPath, 'utf8', function(error, file) {

          // Process a stat error
          if (error) {
            didError = true;
            return callback(error);
          }

          // Parse the JSON
          var parsed = null;
          try {
            parsed = JSON.parse(file);
          }
          catch (e) {
            didError = true;
            console.error('JSON error parsing page: ' + fullPath, e);
            return callback(e);
          }

          // Do nothing if a prior error callback happened
          if (didError) {
            return;
          }

          // Set the page title and description
          if (parsed.title) {
            page.label = parsed.title;
          }
          if (parsed.description) {
            page.description = parsed.description;
          }

          // Add a file watcher if not already watching
          if (!t.fileWatchers[page.id]) {
            t.fileWatchers[page.id] = new FS.watch(fullPath, {persistent:false}, function(type){
              t.sync();
            });
          }

          // Callback if all page reads are complete
          if (--numLeft === 0) {
            callback(null);
          }
        });
      });
    }
1071337
function createPage() {
        var page = new View(view.clone(), lazy.extend({}, view.options, opts));
        page.data.pagination = new Parent(lazy.extend({}, self.options, {Item: Item}));
        return page;
      }
343961
function validatePage(page, path) {
  let errors = [];

  // Check for required properties
  errors = [...errors, ...assertProperties(page, path, requiredProperties[page.type])];

  if (page.children) {
    // Check that children is an array
    if (!Array.isArray(page.children)) {
      errors = [...errors, { path, error: 'Children must be an array' }];

      return errors;
    }

    page.children.forEach((node, index) => {
      errors = [...errors, ...validateNode(node, [...path, 'children', index], [page])];
    });
  }

  return errors;
}
602067
def page(number)
      number = (n = number.to_i) > 0 ? n : 1
      Page.new(self, number, lambda {
                 offset = (number - 1) * @per_page
                 args = [offset]
                 args << @per_page if @select.arity == 2
                 @select.call(*args)
               })
    end
338735
public void setPage(int page, boolean fireChanged) {

        m_page = page;
        m_label.setValue("( " + (1 + m_page) + " / " + (m_lastPage + 1) + " )");
        int start = (m_page * m_pageSize) + 1;
        int end = Math.min((start + m_pageSize) - 1, m_resultCount);
        String resultsMsg = CmsVaadinUtils.getMessageText(
            Messages.GUI_DATAVIEW_RESULTS_3,
            "" + start,
            "" + end,
            "" + m_resultCount);
        m_resultsLabel.setValue(start <= end ? resultsMsg : "");
        if (fireChanged) {
            firePageChanged(page);
        }
    }
242016
function Page(version, response, solution) {
  var payload = this.processResponse(response);

  this._version = version;
  this._payload = payload;
  this._solution = solution;

  this.nextPageUrl = this.getNextPageUrl();
  this.previousPageUrl = this.getPreviousPageUrl();

  this.instances = this.loadInstances(this.loadPage(payload));
}
438247
def page(name, attributes = {}, &block)
      page = Elements::Page.new(name, nil, @resolver, attributes, &block)
      pages << page if page.visible?
    end
687993
function constructor(options) {
    Pagelet.prototype.constructor.call(this, options = options || {});

    //
    // Store the provided global dependencies.
    //
    this.dependencies = this._bigpipe._compiler.page(this).concat(
      options.dependencies
    );

    var req = options.req || {}
      , uri = req.uri || {}
      , query = req.query || {};

    //
    // Set a number of properties on the response as it is available to all pagelets.
    // This will ensure the correct amount of pagelets are processed and that the
    // entire queue is written to the client.
    //
    this._queue = [];

    //
    // Prepare several properties that are used to render the HTML fragment.
    //
    this.length = options.length || 0;
    this.child = options.child || 'root';
    this.once('contentType', this.contentTypeHeader, this);

    //
    // Set the default fallback script, see explanation above.
    //
    this.debug('Initialized in %s mode', options.mode);
    this.fallback = 'sync' === options.mode ? script : noscript.replace(
      '{path}',
      uri.pathname || 'http://localhost/'
    ).replace(
      '{query}',
      qs.stringify(this.merge({ no_pagelet_js: 1 }, query))
    );
  }
375176
function changePage(pageNumber) {
      var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

      if (pageNumber > 0 && this.total > this.currentPerPage * (pageNumber - 1)) {
        this.prevPage = this.currentPage;
        this.currentPage = pageNumber;
        if (emit) this.pageChanged();
      }
    }
1364776
function (pageName, page, role) {
            // Extends Views
            // Create JQuery Mobile Page
            var pageid = 'pagename-' + pageName.toLowerCase();
            var isExistingPage = $('#' + pageid);

            // For already existing pages, only delegate events so they can
            // handle onPageBeforeShow and onPageShow.
            if (isExistingPage.length === 1) {

                // Sometimes, controller may have been destroyed but the
                // HTML stayed in the DOM (in case of an exception).
                // We can detect that using needRedraw, which indicate
                // that we have to do a full repaint.
                if (page.needRedraw) {
                    page.render();
                }
                else {
                    page.refresh();
                    page.delegateEvents();
                }

            } else {
                // Create the page, store its page name in an attribute
                // so it can be retrieved later.
                page.el.id = 'pagename-' + pageName.toLowerCase();
                page.el.className = 'page-container';

                // Render it and add it in the DOM.
                page.render();

                if (Jackbone.manualMode) {
                    // Create the new page
                    page._onPageBeforeCreate();
                    Jackbone.trigger('createview', page);
                    page._onPageManualCreate();
                    page._onPageCreate();
                }

                // Append to the DOM.
                document.body.appendChild(page.el);
            }

            if (!Jackbone.manualMode) {
                // Select the transition to apply.
                var t = this.selectTransition(pageName, role);

                // Perform transition using JQuery Mobile
                $.mobile.changePage(page.$el, {
                    changeHash:    false,
                    transition:    t.transition,
                    reverse:       t.reverse,
                    role:          role,
                    pageContainer: page.$el
                });
            }
            else {

                var currentActivePage = Jackbone.activePage;
                try {
                    // Hide previous page, show next
                    if (Jackbone.activePage) {
                        Jackbone.activePage._onPageBeforeHide();
                    }
                    page._onPageBeforeShow();
                    page.$el.show();
                    if (Jackbone.activePage) {
                        Jackbone.activePage.$el.hide();
                        Jackbone.activePage._onPageHide();
                    }
                    page._onPageShow();

                    // Update 'activePage'
                    Jackbone.activePage = page;
                    $.mobile.activePage = page.$el;
                }
                catch (error) {
                    page.$el.hide();
                    if (currentActivePage) {
                        currentActivePage.$el.show();
                        Jackbone.activePage = currentActivePage;
                        $.mobile.activePage = currentActivePage.$el;
                    }
                    throw new Error('Failed to changePage: ' + error);
                }
            }

            // Current hash is stored so a subsequent openView can know
            // which page it comes from.
            this.currentHash = Jackbone.history.getFragment();
        }
578725
private Object init(Object[] arguments) throws PageException {
	object = Reflector.callConstructor(clazz, arguments);
	isInit = true;
	return object;
    }
1242566
function pages(opts){

    var page = _SAX.get('_CURENT_PAGE')
    if (page){
        var intent = _SAX.get(page)
        this.intent = intent;
    }
    else {
        this.intent = false;
    }

    var _this = this;

    var _dft = [];
    var defaults = {
        init: function(){},
        // goback: function(){},
        ready: function(){},
        main: function(){}
        // end: function(){}
    }
    _dft = Object.keys(defaults)

    if ( _lodash.isObject(opts) ){
        var defaults = _lodash.extend({}, defaults, opts)
    }

    var dft = defaults;
    var funs = Object.keys(dft)
    funs.map(function(item, i){
        _this[item] = dft[item];
    })

    function run(){
        var _this = this;
        funs.map(function(item, i){
            if (typeof dft[item] === 'function'){
                if (_lodash.indexOf(_dft, item)>-1)
                    dft[item].call(_this, _this, _this.intent)
            }
        })
    }

    _this.next = function(stat,data){
        if (stat){
            if (!_this.innerData){
                _this.innerData = data;
            }
            else{
                var tmp = _lodash.extend({}, _this.innerData, data)
                _this.innerData = tmp;
            }
            run.call(_this)
        }
    }

    if (_lodash.indexOf(funs, 'boot')>-1){
        var stat = dft['boot'].call(_this, _this)
        if (stat)
            run.call(_this);
    }
    else
        run.call(_this);

    return this;
}