|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.egit.github.core.client.PageIterator<V>
V
- type of resource being iterated overpublic class PageIterator<V>
Iterator for getting paged responses. Each call to next()
will make
a client request for the next page of resources using the URI returned from
the previous request.
The hasNext()
method can be used to determine if the last executed
request contained the location of the next page of results.
This iterator also provides the next and last page numbers as well as the
next and last URIs.
Field Summary | |
---|---|
protected GitHubClient |
client
Client |
protected String |
last
Last uri to be fetched |
protected int |
lastPage
Last page number |
protected String |
next
Next uri to be fetched |
protected int |
nextPage
Current page number |
protected PagedRequest<V> |
request
Request |
Constructor Summary | |
---|---|
PageIterator(PagedRequest<V> request,
GitHubClient client)
Create page iterator |
Method Summary | |
---|---|
int |
getLastPage()
Get number of last page |
String |
getLastUri()
Get uri of last page |
int |
getNextPage()
Get number of next page to be read |
String |
getNextUri()
Get URI of next request |
PagedRequest<V> |
getRequest()
Get request being executed |
boolean |
hasNext()
|
Iterator<Collection<V>> |
iterator()
|
Collection<V> |
next()
|
protected int |
parsePageNumber(String uri)
Parse page number from uri |
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final PagedRequest<V> request
protected final GitHubClient client
protected int nextPage
protected int lastPage
protected String next
protected String last
Constructor Detail |
---|
public PageIterator(PagedRequest<V> request, GitHubClient client)
request
- client
- Method Detail |
---|
protected int parsePageNumber(String uri)
uri
-
public int getNextPage()
public int getLastPage()
public String getNextUri()
public String getLastUri()
public boolean hasNext()
hasNext
in interface Iterator<Collection<V>>
public void remove()
remove
in interface Iterator<Collection<V>>
public Collection<V> next()
next
in interface Iterator<Collection<V>>
public PagedRequest<V> getRequest()
public Iterator<Collection<V>> iterator()
iterator
in interface Iterable<Collection<V>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |