/** * Creates a new node, either by reusing one from the cache or creating * a new one. * * @param value value of the new node * @return the newly created node */ protected Node createNode(Object value) { Node cachedNode = getNodeFromCache(); if (cachedNode == null) { return super.createNode(value); } else { cachedNode.setValue(value); return cachedNode; } }
/** * Creates a new node, either by reusing one from the cache or creating * a new one. * * @param value value of the new node * @return the newly created node */ protected Node createNode(Object value) { Node cachedNode = getNodeFromCache(); if (cachedNode == null) { return super.createNode(value); } else { cachedNode.setValue(value); return cachedNode; } }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
/** * Updates the node with a new value. * This implementation sets the value on the node. * Subclasses can override this to record the change. * * @param node node to update * @param value new value of the node */ protected void updateNode(Node node, Object value) { node.setValue(value); }
/** * Updates the node with a new value. * This implementation sets the value on the node. * Subclasses can override this to record the change. * * @param node node to update * @param value new value of the node */ protected void updateNode(Node node, Object value) { node.setValue(value); }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
/** * Updates the node with a new value. * This implementation sets the value on the node. * Subclasses can override this to record the change. * * @param node node to update * @param value new value of the node */ protected void updateNode(Node node, Object value) { node.setValue(value); }
/** * Updates the node with a new value. * This implementation sets the value on the node. * Subclasses can override this to record the change. * * @param node node to update * @param value new value of the node */ protected void updateNode(Node node, Object value) { node.setValue(value); }
/** * Updates the node with a new value. * This implementation sets the value on the node. * Subclasses can override this to record the change. * * @param node node to update * @param value new value of the node */ protected void updateNode(Node node, Object value) { node.setValue(value); }
/** * Adds a node to the cache, if the cache isn't full. * The node's contents are cleared to so they can be garbage collected. * * @param node the node to add to the cache */ protected void addNodeToCache(Node node) { if (isCacheFull()) { // don't cache the node. return; } // clear the node's contents and add it to the cache. Node nextCachedNode = firstCachedNode; node.previous = null; node.next = nextCachedNode; node.setValue(null); firstCachedNode = node; cacheSize++; }
/** * Creates a new node, either by reusing one from the cache or creating * a new one. * * @param value value of the new node * @return the newly created node */ protected Node createNode(Object value) { Node cachedNode = getNodeFromCache(); if (cachedNode == null) { return super.createNode(value); } else { cachedNode.setValue(value); return cachedNode; } }
/** * Adds a node to the cache, if the cache isn't full. * The node's contents are cleared to so they can be garbage collected. * * @param node the node to add to the cache */ protected void addNodeToCache(Node node) { if (isCacheFull()) { // don't cache the node. return; } // clear the node's contents and add it to the cache. Node nextCachedNode = firstCachedNode; node.previous = null; node.next = nextCachedNode; node.setValue(null); firstCachedNode = node; cacheSize++; }
/** * Creates a new node, either by reusing one from the cache or creating * a new one. * * @param value value of the new node * @return the newly created node */ protected Node createNode(Object value) { Node cachedNode = getNodeFromCache(); if (cachedNode == null) { return super.createNode(value); } else { cachedNode.setValue(value); return cachedNode; } }
/** * Updates the node with a new value. * This implementation sets the value on the node. * Subclasses can override this to record the change. * * @param node node to update * @param value new value of the node */ protected void updateNode(Node node, Object value) { node.setValue(value); }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
public void set(Object obj) { checkModCount(); getLastNodeReturned().setValue(obj); }
/** * Updates the node with a new value. * This implementation sets the value on the node. * Subclasses can override this to record the change. * * @param node node to update * @param value new value of the node */ protected void updateNode(Node node, Object value) { node.setValue(value); }