twitter4j
Class Paging

java.lang.Object
  extended by twitter4j.Paging
All Implemented Interfaces:
java.io.Serializable

public final class Paging
extends java.lang.Object
implements java.io.Serializable

Controls pagination.
It is possible to use the same Paging instance in a multi-threaded context only if the instance is treated immutably.
But basically instance of this class is NOT thread safe. A client should instantiate Paging class per thread.

Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
Serialized Form

Field Summary
private  int count
           
(package private) static java.lang.String COUNT
           
private  long maxId
           
private static twitter4j.internal.http.HttpParameter[] NULL_PARAMETER_ARRAY
           
private static java.util.List<twitter4j.internal.http.HttpParameter> NULL_PARAMETER_LIST
           
private  int page
           
(package private) static java.lang.String PER_PAGE
           
(package private) static char[] S
           
private static long serialVersionUID
           
private  long sinceId
           
(package private) static char[] SMCP
           
 
Constructor Summary
Paging()
           
Paging(int page)
           
Paging(int page, int count)
           
Paging(int page, int count, long sinceId)
           
Paging(int page, int count, long sinceId, long maxId)
           
Paging(int page, long sinceId)
           
Paging(long sinceId)
           
 
Method Summary
private  void addPostParameter(char[] supportedParams, char paramKey, java.util.List<twitter4j.internal.http.HttpParameter> pagingParams, java.lang.String paramName, long paramValue)
           
(package private)  twitter4j.internal.http.HttpParameter[] asPostParameterArray()
           
(package private)  twitter4j.internal.http.HttpParameter[] asPostParameterArray(char[] supportedParams, java.lang.String perPageParamName)
          Converts the pagination parameters into a List of PostParameter.
This method also Validates the preset parameters, and throws IllegalStateException if any unsupported parameter is set.
(package private)  java.util.List<twitter4j.internal.http.HttpParameter> asPostParameterList()
           
(package private)  java.util.List<twitter4j.internal.http.HttpParameter> asPostParameterList(char[] supportedParams)
           
(package private)  java.util.List<twitter4j.internal.http.HttpParameter> asPostParameterList(char[] supportedParams, java.lang.String perPageParamName)
          Converts the pagination parameters into a List of PostParameter.
This method also Validates the preset parameters, and throws IllegalStateException if any unsupported parameter is set.
 Paging count(int count)
           
 boolean equals(java.lang.Object o)
           
 int getCount()
           
 long getMaxId()
           
 int getPage()
           
 long getSinceId()
           
 int hashCode()
           
 Paging maxId(long maxId)
           
 void setCount(int count)
           
 void setMaxId(long maxId)
           
 void setPage(int page)
           
 void setSinceId(long sinceId)
           
 Paging sinceId(long sinceId)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

page

private int page

count

private int count

sinceId

private long sinceId

maxId

private long maxId

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

S

static char[] S

SMCP

static char[] SMCP

COUNT

static final java.lang.String COUNT
See Also:
Constant Field Values

PER_PAGE

static final java.lang.String PER_PAGE
See Also:
Constant Field Values

NULL_PARAMETER_ARRAY

private static twitter4j.internal.http.HttpParameter[] NULL_PARAMETER_ARRAY

NULL_PARAMETER_LIST

private static java.util.List<twitter4j.internal.http.HttpParameter> NULL_PARAMETER_LIST
Constructor Detail

Paging

public Paging()

Paging

public Paging(int page)

Paging

public Paging(long sinceId)

Paging

public Paging(int page,
              int count)

Paging

public Paging(int page,
              long sinceId)

Paging

public Paging(int page,
              int count,
              long sinceId)

Paging

public Paging(int page,
              int count,
              long sinceId,
              long maxId)
Method Detail

asPostParameterList

java.util.List<twitter4j.internal.http.HttpParameter> asPostParameterList()

asPostParameterArray

twitter4j.internal.http.HttpParameter[] asPostParameterArray()

asPostParameterList

java.util.List<twitter4j.internal.http.HttpParameter> asPostParameterList(char[] supportedParams)

asPostParameterList

java.util.List<twitter4j.internal.http.HttpParameter> asPostParameterList(char[] supportedParams,
                                                                          java.lang.String perPageParamName)
Converts the pagination parameters into a List of PostParameter.
This method also Validates the preset parameters, and throws IllegalStateException if any unsupported parameter is set.

Parameters:
supportedParams - char array representation of supported parameters
perPageParamName - name used for per-page parameter. getUserListStatuses() requires "per_page" instead of "count".
Returns:
list of PostParameter

asPostParameterArray

twitter4j.internal.http.HttpParameter[] asPostParameterArray(char[] supportedParams,
                                                             java.lang.String perPageParamName)
Converts the pagination parameters into a List of PostParameter.
This method also Validates the preset parameters, and throws IllegalStateException if any unsupported parameter is set.

Parameters:
supportedParams - char array representation of supported parameters
perPageParamName - name used for per-page parameter. getUserListStatuses() requires "per_page" instead of "count".
Returns:
list of PostParameter

addPostParameter

private void addPostParameter(char[] supportedParams,
                              char paramKey,
                              java.util.List<twitter4j.internal.http.HttpParameter> pagingParams,
                              java.lang.String paramName,
                              long paramValue)

getPage

public int getPage()

setPage

public void setPage(int page)

getCount

public int getCount()

setCount

public void setCount(int count)

count

public Paging count(int count)

getSinceId

public long getSinceId()

setSinceId

public void setSinceId(long sinceId)

sinceId

public Paging sinceId(long sinceId)

getMaxId

public long getMaxId()

setMaxId

public void setMaxId(long maxId)

maxId

public Paging maxId(long maxId)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object