/**
* @see DTMIterator#setItem(int, int)
*/
public void setItem(int node, int index)
{
NodeVector vec = getVector();
if(null != vec)
{
int oldNode = vec.elementAt(index);
if (oldNode != node && m_cache.useCount() > 1) {
/* If we are going to set the node at the given index
* to a different value, and the cache is shared
* (has a use count greater than 1)
* then make a copy of the cache and use it
* so we don't overwrite the value for other
* users of the cache.
*/
IteratorCache newCache = new IteratorCache();
final NodeVector nv;
try {
nv = (NodeVector) vec.clone();
} catch (CloneNotSupportedException e) {
// This should never happen
e.printStackTrace();