org.mmbase.module.core
Class VirtualNode

java.lang.Object
  extended byorg.mmbase.module.core.MMObjectNode
      extended byorg.mmbase.module.core.VirtualNode
All Implemented Interfaces:
SizeMeasurable
Direct Known Subclasses:
Authenticate.AdminVirtualNode, ClusterNode, ResultNode, TypeRel.VirtualTypeRelNode

public class VirtualNode
extends MMObjectNode

VirtualNode is a representation of a virtual objectnode. Virtual Object nodes are nodes that are not stored in a databasetable. Note that a temporary node is not virtual. This class captures a number of methods that would normally require datbase access, such as obtaining relations or determining age of a node.

Version:
$Id: VirtualNode.java,v 1.6 2004/02/24 17:44:02 michiel Exp $
Author:
Pierre van Rooden

Field Summary
 
Fields inherited from class org.mmbase.module.core.MMObjectNode
alias, changed, initializing, parent, prefix, properties, relatedCache, relationsCache, VALUE_NULL, values, virtual
 
Constructor Summary
VirtualNode(MMObjectBuilder parent)
          Main contructor.
 
Method Summary
 boolean commit()
          commit : commits the node to the database or other storage system.
 int getAge()
          Returns the node's age A virtual node is always new (0)
 int getRelationCount()
          Returns the number of relations of this node.
 int getRelationCount(java.lang.String wantedtype)
          Return the number of relations of this node, filtered on a specified type.
 java.util.Enumeration getRelations()
          Return the relations of this node.
 boolean hasRelations()
          Returns whether this node has relations.
 int insert(java.lang.String userName)
          Insert is not implemented on a virtual node.
 
Methods inherited from class org.mmbase.module.core.MMObjectNode
clearChanged, commit, defaultEquals, delPropertiesCache, delRelationsCache, equals, finish, getAlias, getAllRelations, getBooleanValue, getBuilder, getByteSize, getByteSize, getByteValue, getChanged, getContext, getDBState, getDBType, getDoubleValue, getFloatValue, getFunctionValue, getGUIIndicator, getIntegerValue, getIntValue, getLongValue, getName, getNodeValue, getNumber, getOType, getPossibleContexts, getProperties, getProperty, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelationCacheHits, getRelationCacheMiss, getRelationNodes, getRelations, getRelations, getStringValue, getTableName, getValue, getValues, getXMLValue, hashCode, insert, insertDone, isChanged, isVirtual, preEdit, putProperty, remove, removeRelations, retrieveValue, sendFieldChangeSignal, setAlias, setContext, setValue, setValue, setValue, setValue, setValue, setValue, start, storeValue, testValidData, toString, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualNode

public VirtualNode(MMObjectBuilder parent)
Main contructor.

Parameters:
parent - the node's parent, generally (but not necessarily) an instance of a virtual builder.
Method Detail

commit

public boolean commit()
commit : commits the node to the database or other storage system. Generally, commiting a virtual node has no effect, so the basic implementation returns false.

Overrides:
commit in class MMObjectNode
Returns:
false

insert

public int insert(java.lang.String userName)
Insert is not implemented on a virtual node.

Overrides:
insert in class MMObjectNode
Returns:
nothing, throws an exception
Throws:
java.lang.UnsupportedOperationException

hasRelations

public boolean hasRelations()
Returns whether this node has relations. A virtual node never has relations.

Overrides:
hasRelations in class MMObjectNode
Returns:
false

getRelations

public java.util.Enumeration getRelations()
Return the relations of this node. A virtual node never has relations.

Overrides:
getRelations in class MMObjectNode
Returns:
empty Enumeration

getRelationCount

public int getRelationCount()
Returns the number of relations of this node. A virtual node never has relations.

Overrides:
getRelationCount in class MMObjectNode
Returns:
0

getRelationCount

public int getRelationCount(java.lang.String wantedtype)
Return the number of relations of this node, filtered on a specified type. A virtual node never has relations.

Overrides:
getRelationCount in class MMObjectNode
Parameters:
wantedtype - the 'type' of related nodes (NOT the relations!).
Returns:
An int indicating the number of nodes found

getAge

public int getAge()
Returns the node's age A virtual node is always new (0)

Overrides:
getAge in class MMObjectNode
Returns:
the age in days (0)


MMBase build 1.7.1.20041002