• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.webkit;
18 
19 import java.io.Serializable;
20 
21 /**
22  * This class contains the back/forward list for a WebView.
23  * WebView.copyBackForwardList() will return a copy of this class used to
24  * inspect the entries in the list.
25  */
26 public class WebBackForwardList implements Cloneable, Serializable {
27 
28     /**
29      *  @hide
30      */
WebBackForwardList()31     public WebBackForwardList() {
32     }
33 
34     /**
35      * Return the current history item. This method returns null if the list is
36      * empty.
37      * @return The current history item.
38      */
getCurrentItem()39     public synchronized WebHistoryItem getCurrentItem() {
40         throw new MustOverrideException();
41     }
42 
43     /**
44      * Get the index of the current history item. This index can be used to
45      * directly index into the array list.
46      * @return The current index from 0...n or -1 if the list is empty.
47      */
getCurrentIndex()48     public synchronized int getCurrentIndex() {
49         throw new MustOverrideException();
50     }
51 
52     /**
53      * Get the history item at the given index. The index range is from 0...n
54      * where 0 is the first item and n is the last item.
55      * @param index The index to retrieve.
56      */
getItemAtIndex(int index)57     public synchronized WebHistoryItem getItemAtIndex(int index) {
58         throw new MustOverrideException();
59     }
60 
61     /**
62      * Get the total size of the back/forward list.
63      * @return The size of the list.
64      */
getSize()65     public synchronized int getSize() {
66         throw new MustOverrideException();
67     }
68 
69     /**
70      * Clone the entire object to be used in the UI thread by clients of
71      * WebView. This creates a copy that should never be modified by any of the
72      * webkit package classes.
73      */
clone()74     protected synchronized WebBackForwardList clone() {
75         throw new MustOverrideException();
76     }
77 
78 }
79