org.jboss.cache
Class AbstractNode<K,V>

java.lang.Object
  extended by org.jboss.cache.AbstractNode<K,V>
Direct Known Subclasses:
UnversionedNode, WorkspaceNodeImpl

public abstract class AbstractNode<K,V>
extends Object

Base class for UnversionedNode.

Author:
manik

Nested Class Summary
static class AbstractNode.NodeFlags
          These flags were originally stored as booleans on the UnversionedNode class.
 
Field Summary
protected  Map<Object,Node<K,V>> children
           
protected  short flags
          Flags placed on the node.
protected  Fqn<?> fqn
           
 
Constructor Summary
AbstractNode()
           
 
Method Summary
 boolean equals(Object another)
           
 int hashCode()
           
 boolean isDeleted()
           
protected  boolean isFlagSet(AbstractNode.NodeFlags flag)
          Tests whether a flag is set.
 boolean isResident()
           
 void markAsDeleted(boolean marker)
           
 void markAsDeleted(boolean marker, boolean recursive)
           
protected  void setFlag(AbstractNode.NodeFlags flag)
          Unility method that sets the value of the given flag to true.
protected  void setFlag(AbstractNode.NodeFlags flag, boolean value)
          Utility method for setting or unsetting a flag.
 void setResident(boolean resident)
           
protected  void unsetFlag(AbstractNode.NodeFlags flag)
          Utility method that sets the value of the flag to false.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected Map<Object,Node<K,V>> children

fqn

protected Fqn<?> fqn

flags

protected short flags
Flags placed on the node. Replaces older 'boolean' flags.

Constructor Detail

AbstractNode

public AbstractNode()
Method Detail

isFlagSet

protected final boolean isFlagSet(AbstractNode.NodeFlags flag)
Tests whether a flag is set.

Parameters:
flag - flag to test
Returns:
true if set, false otherwise.

setFlag

protected final void setFlag(AbstractNode.NodeFlags flag,
                             boolean value)
Utility method for setting or unsetting a flag. If status is true, the NodeFlag specified is added to the flags encoded short. If status is false, the NodeFlag is removed from the encoded short.

Parameters:
flag - flag to set or unset
value - true to set the flag, false to unset the flag.

setFlag

protected final void setFlag(AbstractNode.NodeFlags flag)
Unility method that sets the value of the given flag to true.

Parameters:
flag - flag to set

unsetFlag

protected final void unsetFlag(AbstractNode.NodeFlags flag)
Utility method that sets the value of the flag to false.

Parameters:
flag - flag to unset

isDeleted

public boolean isDeleted()

markAsDeleted

public void markAsDeleted(boolean marker)

markAsDeleted

public void markAsDeleted(boolean marker,
                          boolean recursive)

setResident

public void setResident(boolean resident)

isResident

public boolean isResident()

equals

public boolean equals(Object another)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.