Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.engine
Class AbstractElement

java.lang.Object
  extended byorg.evolvica.engine.AbstractElement
All Implemented Interfaces:
IElement
Direct Known Subclasses:
ConduitElement, ConnectorElement, ForkElement, JoinElement, SinkElement, SourceElement

public abstract class AbstractElement
extends java.lang.Object
implements IElement

Abstract algorithm element.

Since:
0.4.0
Version:
$Revision: 1.7 $ $Date: 2004/05/26 11:58:21 $
Author:
Andreas Rummler

Field Summary
protected  IAlgorithm algorithm
          The algorithm this element belongs to.
protected  IConnection[] incoming
          Incoming connections.
protected  java.lang.Object[] input
          Input data.
protected  IConnection[] outgoing
          Outgoing connections.
protected  java.lang.Object[] output
          Output data.
 
Constructor Summary
AbstractElement(int incomingSlots, int outgoingSlots)
          Constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a property change listener to this element.
 void firePropertyChangeEvent(java.beans.PropertyChangeEvent event)
          Fires a property change event.
 IAlgorithm getAlgorithm()
          Returns the algorithm this element is contained in.
 IConnection getIncoming(int index)
          Gets an incoming connection.
 int getIncomingIndex(IConnection connection)
          Returns the index of the given incoming connection.
 Metadata getMetadata(java.lang.String path)
          Returns a metadata object for this element from the associated metadata store.
 IConnection getOutgoing(int index)
          Gets an outgoing connection.
 int getOutgoingIndex(IConnection connection)
          Returns the index of the given outgoing connection.
 java.lang.Object[] getOutput()
          Gets the output data
 int incomingSize()
          Returns the number of incoming connections.
 int outgoingSize()
          Returns the number of outgoing connections.
 void removeConnection(IConnection connection)
          Removes a connection from this element.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a property change listener from this element.
 void setAlgorithm(IAlgorithm algorithm)
          Sets the algorithm this element belongs to.
 void setIncoming(IConnection connection, int index)
          Sets an incoming connection.
 void setInput(java.lang.Object[] input)
          Sets the input data.
 void setMetadata(Metadata data)
          Sets a metadata object for this element.
 void setOutgoing(IConnection connection, int index)
          Sets an outgoing connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.evolvica.engine.IElement
activate, getOperator, isActivatable, setIncomingSize, setOutgoingSize
 

Field Detail

algorithm

protected IAlgorithm algorithm
The algorithm this element belongs to.


incoming

protected IConnection[] incoming
Incoming connections.


outgoing

protected IConnection[] outgoing
Outgoing connections.


input

protected java.lang.Object[] input
Input data.


output

protected java.lang.Object[] output
Output data.

Constructor Detail

AbstractElement

public AbstractElement(int incomingSlots,
                       int outgoingSlots)
Constructor.

Parameters:
incomingSlots - number of input slots
outgoingSlots - number of output slots
Method Detail

getAlgorithm

public IAlgorithm getAlgorithm()
Description copied from interface: IElement
Returns the algorithm this element is contained in.

Specified by:
getAlgorithm in interface IElement
Returns:
algorithm this element is contained in
See Also:
IElement.getAlgorithm()

setAlgorithm

public void setAlgorithm(IAlgorithm algorithm)
Description copied from interface: IElement
Sets the algorithm this element belongs to.

Specified by:
setAlgorithm in interface IElement
Parameters:
algorithm - the algorithm this element belongs to
See Also:
IElement.setAlgorithm(org.evolvica.engine.IAlgorithm)

getMetadata

public Metadata getMetadata(java.lang.String path)
Description copied from interface: IElement
Returns a metadata object for this element from the associated metadata store. The metadata is stored in the associated algorithms metadata store.

Specified by:
getMetadata in interface IElement
Parameters:
path - metadata path
Returns:
metadata object or null if no such object exists
See Also:
IElement.getMetadata(java.lang.String)

setMetadata

public void setMetadata(Metadata data)
Description copied from interface: IElement
Sets a metadata object for this element. The metadata is stored in the associated algorithms metadata store.

Specified by:
setMetadata in interface IElement
Parameters:
data - metadata object
See Also:
IElement.setMetadata(org.evolvica.util.Metadata)

incomingSize

public int incomingSize()
Description copied from interface: IElement
Returns the number of incoming connections.

Specified by:
incomingSize in interface IElement
Returns:
number of incoming connections
See Also:
IElement.incomingSize()

outgoingSize

public int outgoingSize()
Description copied from interface: IElement
Returns the number of outgoing connections.

Specified by:
outgoingSize in interface IElement
Returns:
number of outgoing connections
See Also:
IElement.outgoingSize()

getIncoming

public IConnection getIncoming(int index)
Description copied from interface: IElement
Gets an incoming connection.

Specified by:
getIncoming in interface IElement
Parameters:
index - index of the connection
Returns:
incoming connection with the specified index
See Also:
IElement.getIncoming(int)

getIncomingIndex

public int getIncomingIndex(IConnection connection)
Description copied from interface: IElement
Returns the index of the given incoming connection.

Specified by:
getIncomingIndex in interface IElement
Parameters:
connection - incoming connection
Returns:
index of the connection or -1 if the connection is not an incoming connection for this element
See Also:
IElement.getIncomingIndex(org.evolvica.engine.IConnection)

setIncoming

public void setIncoming(IConnection connection,
                        int index)
Description copied from interface: IElement
Sets an incoming connection.

Specified by:
setIncoming in interface IElement
Parameters:
connection - connection to set
index - index of the coonection
See Also:
IElement.setIncoming(org.evolvica.engine.IConnection, int)

getOutgoing

public IConnection getOutgoing(int index)
Description copied from interface: IElement
Gets an outgoing connection.

Specified by:
getOutgoing in interface IElement
Parameters:
index - index of the connection
Returns:
outgoing connection with the specified index
See Also:
IElement.getOutgoing(int)

getOutgoingIndex

public int getOutgoingIndex(IConnection connection)
Description copied from interface: IElement
Returns the index of the given outgoing connection.

Specified by:
getOutgoingIndex in interface IElement
Parameters:
connection - outgoing connection
Returns:
index of the connection or -1 if the connection is not an outgoing connection for this element
See Also:
IElement.getOutgoingIndex(org.evolvica.engine.IConnection)

removeConnection

public void removeConnection(IConnection connection)
Description copied from interface: IElement
Removes a connection from this element.

Specified by:
removeConnection in interface IElement
Parameters:
connection - connection to be removed
See Also:
IElement.removeConnection(org.evolvica.engine.IConnection)

setOutgoing

public void setOutgoing(IConnection connection,
                        int index)
Description copied from interface: IElement
Sets an outgoing connection.

Specified by:
setOutgoing in interface IElement
Parameters:
connection - connection to set
index - index of the coonection
See Also:
IElement.setOutgoing(org.evolvica.engine.IConnection, int)

setInput

public void setInput(java.lang.Object[] input)
Sets the input data.

Parameters:
input - input data

getOutput

public java.lang.Object[] getOutput()
Gets the output data

Returns:
output data

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: IElement
Adds a property change listener to this element.

Specified by:
addPropertyChangeListener in interface IElement
Parameters:
listener - property change listener to be added
See Also:
IElement.addPropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: IElement
Removes a property change listener from this element.

Specified by:
removePropertyChangeListener in interface IElement
Parameters:
listener - property change listener to be removed
See Also:
IElement.removePropertyChangeListener(java.beans.PropertyChangeListener)

firePropertyChangeEvent

public void firePropertyChangeEvent(java.beans.PropertyChangeEvent event)
Description copied from interface: IElement
Fires a property change event.

Specified by:
firePropertyChangeEvent in interface IElement
Parameters:
event - event to be fired
See Also:
IElement.firePropertyChangeEvent(java.beans.PropertyChangeEvent)

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems