ohair | 6c32066 | 2012-03-04 11:55:34 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * reserved comment block |
| 3 | * DO NOT REMOVE OR ALTER! |
| 4 | */ |
| 5 | /* |
| 6 | * Copyright 2001,2002,2004,2005 The Apache Software Foundation. |
| 7 | * |
| 8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | * you may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
| 11 | * |
| 12 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | * |
| 14 | * Unless required by applicable law or agreed to in writing, software |
| 15 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | * See the License for the specific language governing permissions and |
| 18 | * limitations under the License. |
| 19 | */ |
| 20 | |
| 21 | package com.sun.org.apache.xerces.internal.dom; |
| 22 | |
| 23 | import java.io.Serializable; |
| 24 | |
| 25 | /** |
| 26 | * This class is used, via a pool managed on CoreDocumentImpl, in ParentNode to |
| 27 | * improve performance of the NodeList accessors, getLength() and item(i). |
| 28 | * |
| 29 | * @xerces.internal |
| 30 | * |
| 31 | * @author Arnaud Le Hors, IBM |
| 32 | * |
| 33 | * @version $Id: NodeListCache.java,v 1.6 2010/07/20 20:25:25 joehw Exp $ |
| 34 | */ |
| 35 | class NodeListCache implements Serializable { |
| 36 | |
| 37 | /** Serialization version. */ |
| 38 | private static final long serialVersionUID = -7927529254918631002L; |
| 39 | |
| 40 | /** Cached node list length. */ |
| 41 | int fLength = -1; |
| 42 | |
| 43 | /** Last requested node index. */ |
| 44 | int fChildIndex = -1; |
| 45 | |
| 46 | /** Last requested node. */ |
| 47 | ChildNode fChild; |
| 48 | |
| 49 | /** Owner of this cache */ |
| 50 | ParentNode fOwner; |
| 51 | |
| 52 | /** Pointer to the next object on the list, |
| 53 | only meaningful when actully stored in the free list. */ |
| 54 | NodeListCache next; |
| 55 | |
| 56 | NodeListCache(ParentNode owner) { |
| 57 | fOwner = owner; |
| 58 | } |
| 59 | } |