Packagejp.naggg.data
Classpublic class Page
InheritancePage Inheritance Object

要素(配列)のページング処理計算を担当するクラス. ページセットにも対応しています. インスタンスを生成してそのプロパティにアクセスすることで利用しますが、 currentPage などの一部プロパティは設定することができ、 設定する度にそのほかのプロパティが上書きされます. なお、Perlの同名のモジュールを参考としています.

View the examples

See also

http://perldoc.jp/docs/modules/Data-Page-1.01/Page.pod
http://perldoc.jp/docs/modules/Data-Pageset-0.06/Pageset.pod


Public Properties
 PropertyDefined By
  currentPage : uint
表示ページ番号.値を変更するとインスタンスのその他プロパティが更新されます.
Page
  entriesOnThisPage : uint
[read-only] 現在の表示ページのおける要素数。1からentriesPerPageの値を取ります.
Page
  entriesPerPage : uint
1ページ当たりの要素数.値を変更するとインスタンスのその他プロパティが更新され、特に currentPage は必ず 1 となります.
Page
  firstOnThisPage : uint
[read-only] 現在の表示ページのおける最初の要素番号.
Page
  firstPage : uint
[read-only] 最小ページ番号.つねに 1 を返します.
Page
  firstPageInSet : uint
[read-only] 現在のページセットの最初のページ.
Page
  lastOnThisPage : uint
[read-only] 現在の表示ページのおける最後の要素番号.
Page
  lastPage : uint
[read-only] 最大ページ番号.
Page
  lastPageInSet : uint
[read-only] 現在のページセットの最後のページ.
Page
  nextPage : uint
[read-only] 在の表示ページ番号の次のページ番号. 次のページが存在しない場合(表示ページ番号と最大ページ番号が同じ場合)0を返します.
Page
  pagesInSet : uint
[read-only] 現在のページセットに含まれるページ数.
Page
  pagesPerSet : uint
1セットあたりのページ数.
Page
  previousPage : uint
[read-only] 現在の表示ページ番号の前のページ番号. 前のページが存在しない場合(表示ページ番号と最小ページ番号が同じ場合)0を返します.
Page
  totalEntries : uint
総要素数.値を変更するとインスタンスのその他プロパティが更新され、特に currentPage は必ず 1 となります.
Page
Public Methods
 MethodDefined By
  
Page(totalEntries:uint, entriesPerPage:uint, currentPage:uint = 1, pagesPerSet:uint = 10)
Page
  
インスタンスを複製します.
Page
  
toString():String
文字列表現を返します.各プロパティを列挙する分、オーバーヘッドがかかるので、リリース版では使用しないでください.
Page
Property Detail
currentPageproperty
currentPage:uint

表示ページ番号.値を変更するとインスタンスのその他プロパティが更新されます.


Implementation
    public function get currentPage():uint
    public function set currentPage(value:uint):void
entriesOnThisPageproperty 
entriesOnThisPage:uint  [read-only]

現在の表示ページのおける要素数。1からentriesPerPageの値を取ります.


Implementation
    public function get entriesOnThisPage():uint
entriesPerPageproperty 
entriesPerPage:uint

1ページ当たりの要素数.値を変更するとインスタンスのその他プロパティが更新され、特に currentPage は必ず 1 となります.


Implementation
    public function get entriesPerPage():uint
    public function set entriesPerPage(value:uint):void
firstOnThisPageproperty 
firstOnThisPage:uint  [read-only]

現在の表示ページのおける最初の要素番号.


Implementation
    public function get firstOnThisPage():uint
firstPageproperty 
firstPage:uint  [read-only]

最小ページ番号.つねに 1 を返します.


Implementation
    public function get firstPage():uint
firstPageInSetproperty 
firstPageInSet:uint  [read-only]

現在のページセットの最初のページ.


Implementation
    public function get firstPageInSet():uint
lastOnThisPageproperty 
lastOnThisPage:uint  [read-only]

現在の表示ページのおける最後の要素番号.


Implementation
    public function get lastOnThisPage():uint
lastPageproperty 
lastPage:uint  [read-only]

最大ページ番号.


Implementation
    public function get lastPage():uint
lastPageInSetproperty 
lastPageInSet:uint  [read-only]

現在のページセットの最後のページ.


Implementation
    public function get lastPageInSet():uint
nextPageproperty 
nextPage:uint  [read-only]

在の表示ページ番号の次のページ番号. 次のページが存在しない場合(表示ページ番号と最大ページ番号が同じ場合)0を返します.


Implementation
    public function get nextPage():uint
pagesInSetproperty 
pagesInSet:uint  [read-only]

現在のページセットに含まれるページ数.


Implementation
    public function get pagesInSet():uint
pagesPerSetproperty 
pagesPerSet:uint

1セットあたりのページ数.


Implementation
    public function get pagesPerSet():uint
    public function set pagesPerSet(value:uint):void
previousPageproperty 
previousPage:uint  [read-only]

現在の表示ページ番号の前のページ番号. 前のページが存在しない場合(表示ページ番号と最小ページ番号が同じ場合)0を返します.


Implementation
    public function get previousPage():uint
totalEntriesproperty 
totalEntries:uint

総要素数.値を変更するとインスタンスのその他プロパティが更新され、特に currentPage は必ず 1 となります.


Implementation
    public function get totalEntries():uint
    public function set totalEntries(value:uint):void
Constructor Detail
Page()Constructor
public function Page(totalEntries:uint, entriesPerPage:uint, currentPage:uint = 1, pagesPerSet:uint = 10)

Parameters
totalEntries:uint — 総ページ数、配列などのコレクションの数です
 
entriesPerPage:uint — 1ページあたりに表示する要素の数
 
currentPage:uint (default = 1) — 現在のページ番号
 
pagesPerSet:uint (default = 10) — 1セットあたリのページ数
Method Detail
clone()method
public function clone():Page

インスタンスを複製します.

Returns
Page — 同じプロパティを持つ Page インスタンス
toString()method 
public function toString():String

文字列表現を返します.各プロパティを列挙する分、オーバーヘッドがかかるので、リリース版では使用しないでください.

Returns
String — 各プロパティの文字列を返します.
Examples
 
     var page:Page = new Page(25, 3, 6, 5); // 25の要素を1ページあたり3つずつ割り振り、現在6ページ目、5ページを1セット
     trace(page);
     // 以下結果
     [Page
         totalEntries=25
         entriesPerPage=3
         currentPage=6
         nextPage=7
         previousPage=5
         firstPage=1
         lastPage=9
         entriesOnThisPage=3
         firstOnThisPage=16
         lastOnThisPage=18
         pagesPerSet=5
         pagesInSet=5
         firstPageInSet=4
         lastPageInSet=8
     ]