org.drools.reteoo.compiled
Class CompiledNetwork

java.lang.Object
  extended by org.drools.reteoo.compiled.CompiledNetwork
All Implemented Interfaces:
Externalizable, Serializable, NetworkNode, ObjectSink, Sink

public abstract class CompiledNetwork
extends Object
implements ObjectSink

This is the base type for all generated classes that that represent a "compiled" portion of the RETE network. By compiled we mean IF statements, switch statements, etc. as opposed to nodes, propagators, etc.

See Also:
Serialized Form

Constructor Summary
CompiledNetwork()
           
 
Method Summary
 int getId()
          Returns the unique id that represents the node in the Rete network
 RuleBasePartitionId getPartitionId()
          Returns the partition ID to which this node belongs to
 void readExternal(ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
protected abstract  void setNetworkNodeReference(NetworkNode networkNode)
          Generated subclasses need to implement this method to set member variables based on the specified NetworkNode.
 void setObjectTypeNode(ObjectTypeNode objectTypeNode)
          Sets the OTN for this network.
 void writeExternal(ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.drools.reteoo.ObjectSink
assertObject, modifyObject
 

Constructor Detail

CompiledNetwork

public CompiledNetwork()
Method Detail

getId

public int getId()
Returns the unique id that represents the node in the Rete network

Specified by:
getId in interface NetworkNode
Returns:
unique int value

getPartitionId

public RuleBasePartitionId getPartitionId()
Returns the partition ID to which this node belongs to

Specified by:
getPartitionId in interface NetworkNode
Returns:
partition id

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface Externalizable
Parameters:
out - the stream to write the object to
Throws:
IOException - Includes any I/O exceptions that may occur

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface Externalizable
Parameters:
in - the stream to read data from in order to restore the object
Throws:
IOException - if I/O errors occur
ClassNotFoundException - If the class for an object being restored cannot be found.

setObjectTypeNode

public final void setObjectTypeNode(ObjectTypeNode objectTypeNode)
Sets the OTN for this network. Calling this method will set all variables in the generated subclasses by walking the ObjectTypeNode using a ObjectTypeNodeParser.

Parameters:
objectTypeNode - node for whom this network was created

setNetworkNodeReference

protected abstract void setNetworkNodeReference(NetworkNode networkNode)
Generated subclasses need to implement this method to set member variables based on the specified NetworkNode.

Parameters:
networkNode - node to set to set


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.