/** * Removes the node from the list, storing it in the cache for reuse * if the cache is not yet full. * * @param node the node to remove */ protected void removeNode(Node node) { super.removeNode(node); addNodeToCache(node); }
/** * Removes the node from the list, storing it in the cache for reuse * if the cache is not yet full. * * @param node the node to remove */ protected void removeNode(Node node) { super.removeNode(node); addNodeToCache(node); }
/** * Removes all the nodes from the list, storing as many as required in the * cache for reuse. * */ protected void removeAllNodes() { // Add the removed nodes to the cache, then remove the rest. // We can add them to the cache before removing them, since // {@link AbstractLinkedList.removeAllNodes()} removes the // nodes by removing references directly from {@link #header}. int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize); Node node = header.next; for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) { Node oldNode = node; node = node.next; addNodeToCache(oldNode); } super.removeAllNodes(); }
/** * Removes all the nodes from the list, storing as many as required in the * cache for reuse. * */ protected void removeAllNodes() { // Add the removed nodes to the cache, then remove the rest. // We can add them to the cache before removing them, since // {@link AbstractLinkedList.removeAllNodes()} removes the // nodes by removing references directly from {@link #header}. int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize); Node node = header.next; for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) { Node oldNode = node; node = node.next; addNodeToCache(oldNode); } super.removeAllNodes(); }
/** * Removes the node from the list, storing it in the cache for reuse * if the cache is not yet full. * * @param node the node to remove */ protected void removeNode(Node node) { super.removeNode(node); addNodeToCache(node); }
/** * Removes the node from the list, storing it in the cache for reuse * if the cache is not yet full. * * @param node the node to remove */ protected void removeNode(Node node) { super.removeNode(node); addNodeToCache(node); }
/** * Removes the node from the list, storing it in the cache for reuse * if the cache is not yet full. * * @param node the node to remove */ protected void removeNode(Node node) { super.removeNode(node); addNodeToCache(node); }
/** * Removes the node from the list, storing it in the cache for reuse * if the cache is not yet full. * * @param node the node to remove */ protected void removeNode(Node node) { super.removeNode(node); addNodeToCache(node); }
/** * Removes the node from the list, storing it in the cache for reuse * if the cache is not yet full. * * @param node the node to remove */ protected void removeNode(Node node) { super.removeNode(node); addNodeToCache(node); }
/** * Removes all the nodes from the list, storing as many as required in the * cache for reuse. * */ protected void removeAllNodes() { // Add the removed nodes to the cache, then remove the rest. // We can add them to the cache before removing them, since // {@link AbstractLinkedList.removeAllNodes()} removes the // nodes by removing references directly from {@link #header}. int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize); Node node = header.next; for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) { Node oldNode = node; node = node.next; addNodeToCache(oldNode); } super.removeAllNodes(); }
/** * Removes all the nodes from the list, storing as many as required in the * cache for reuse. * */ protected void removeAllNodes() { // Add the removed nodes to the cache, then remove the rest. // We can add them to the cache before removing them, since // {@link AbstractLinkedList.removeAllNodes()} removes the // nodes by removing references directly from {@link #header}. int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize); Node node = header.next; for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) { Node oldNode = node; node = node.next; addNodeToCache(oldNode); } super.removeAllNodes(); }
/** * Removes all the nodes from the list, storing as many as required in the * cache for reuse. * */ protected void removeAllNodes() { // Add the removed nodes to the cache, then remove the rest. // We can add them to the cache before removing them, since // {@link AbstractLinkedList.removeAllNodes()} removes the // nodes by removing references directly from {@link #header}. int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize); Node node = header.next; for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) { Node oldNode = node; node = node.next; addNodeToCache(oldNode); } super.removeAllNodes(); }
/** * Removes all the nodes from the list, storing as many as required in the * cache for reuse. * */ protected void removeAllNodes() { // Add the removed nodes to the cache, then remove the rest. // We can add them to the cache before removing them, since // {@link AbstractLinkedList.removeAllNodes()} removes the // nodes by removing references directly from {@link #header}. int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize); Node node = header.next; for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) { Node oldNode = node; node = node.next; addNodeToCache(oldNode); } super.removeAllNodes(); }
/** * Removes all the nodes from the list, storing as many as required in the * cache for reuse. * */ protected void removeAllNodes() { // Add the removed nodes to the cache, then remove the rest. // We can add them to the cache before removing them, since // {@link AbstractLinkedList.removeAllNodes()} removes the // nodes by removing references directly from {@link #header}. int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize); Node node = header.next; for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) { Node oldNode = node; node = node.next; addNodeToCache(oldNode); } super.removeAllNodes(); }