Build 1.0_r1(from source)

android.webkit
Class WebBackForwardList

java.lang.Object
  extended by android.webkit.WebBackForwardList
All Implemented Interfaces:
Serializable, Cloneable

public class WebBackForwardList
extends Object
implements Cloneable, Serializable

This class contains the back/forward list for a WebView. WebView.copyBackForwardList() will return a copy of this class used to inspect the entries in the list.

See Also:
Serialized Form

Constructor Summary
WebBackForwardList()
          Construct a back/forward list used by clients of WebView.
 
Method Summary
(package private)  void addHistoryItem(WebHistoryItem item)
          Add a new history item to the list.
protected  WebBackForwardList clone()
          Clone the entire object to be used in the UI thread by clients of WebView.
(package private)  void close(int nativeFrame)
          Clear the back/forward list.
(package private)  boolean getClearPending()
          Return the status of the clear flag.
 int getCurrentIndex()
          Get the index of the current history item.
 WebHistoryItem getCurrentItem()
          Return the current history item.
 WebHistoryItem getItemAtIndex(int index)
          Get the history item at the given index.
 int getSize()
          Get the total size of the back/forward list.
(package private) static void restoreIndex(int nativeFrame, int index)
          Restore the history index.
(package private)  void setClearPending()
          Mark the back/forward list as having a pending clear.
(package private)  void setCurrentIndex(int newIndex)
          Set the new history index.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebBackForwardList

WebBackForwardList()
Construct a back/forward list used by clients of WebView.

Method Detail

getCurrentItem

public WebHistoryItem getCurrentItem()
Return the current history item. This method returns null if the list is empty.

Returns:
The current history item.

getCurrentIndex

public int getCurrentIndex()
Get the index of the current history item. This index can be used to directly index into the array list.

Returns:
The current index from 0...n or -1 if the list is empty.

getItemAtIndex

public WebHistoryItem getItemAtIndex(int index)
Get the history item at the given index. The index range is from 0...n where 0 is the first item and n is the last item.

Parameters:
index - The index to retrieve.

getSize

public int getSize()
Get the total size of the back/forward list.

Returns:
The size of the list.

setClearPending

void setClearPending()
Mark the back/forward list as having a pending clear. This is used on the UI side to mark the list as being invalid during the clearHistory method.


getClearPending

boolean getClearPending()
Return the status of the clear flag. This is used on the UI side to determine if the list is valid for checking things like canGoBack.


addHistoryItem

void addHistoryItem(WebHistoryItem item)
Add a new history item to the list. This will remove all items after the current item and append the new item to the end of the list. Called from the WebCore thread only. Synchronized because the UI thread may be reading the array or the current index.

Parameters:
item - A new history item.

close

void close(int nativeFrame)
Clear the back/forward list. Called from the WebCore thread.


clone

protected WebBackForwardList clone()
Clone the entire object to be used in the UI thread by clients of WebView. This creates a copy that should never be modified by any of the webkit package classes.

Overrides:
clone in class Object
Returns:
Object a shallow copy of this object.

setCurrentIndex

void setCurrentIndex(int newIndex)
Set the new history index.

Parameters:
newIndex - The new history index.

restoreIndex

static void restoreIndex(int nativeFrame,
                         int index)
Restore the history index.


Build 1.0_r1(from source)

Please submit a feedback, bug or feature