simulink

edu.tum.cs.simulink.model
Class SimulinkBlock

java.lang.Object
  extended by edu.tum.cs.simulink.model.ParameterizedElement
      extended by edu.tum.cs.simulink.model.SimulinkElementBase
          extended by edu.tum.cs.simulink.model.SimulinkBlock
Direct Known Subclasses:
SimulinkModel, StateflowBlock

public class SimulinkBlock
extends SimulinkElementBase

A Simulink block has a type and maintains a parameter map, a list of sub blocks, a list of annotations and in/out-ports.

Version:
$Rev: 26277 $
Author:
hummelb, $Author: juergens $
Rating:
GREEN Hash: 5DDE14945CA1B08AC406000C88246E18

Constructor Summary
  SimulinkBlock()
          Create new Simulink block.
protected SimulinkBlock(SimulinkBlock origBlock)
          Copy constructor.
 
Method Summary
 void addAnnotation(SimulinkAnnotation annotation)
          Add an annotation.
 void addSubBlock(SimulinkBlock subBlock)
          Adds a sub block.
 SimulinkBlock deepClone()
          Creates a deep clone of this block.
  getAnnotations()
          Get annotations.
 java.util.List<SimulinkLine> getInLines()
          Get all incoming lines of this block.
 SimulinkInPort getInPort(java.lang.String portIndex)
          Get inport by index or null if no inport with this index was found.
  getInPorts()
          Returns the inports this block.
 java.util.List<SimulinkLine> getOutLines()
          Get all outgoing lines of this block.
 SimulinkOutPort getOutPort(java.lang.String portIndex)
          Get outport by index or null if no outport with this index was found.
  getOutPorts()
          Returns the outport of this block.
 java.lang.String getResolvedType()
          If this block is of type 'Reference' this returns Reference.
 SimulinkBlock getSubBlock(java.lang.String name)
          Get named sub block or null if no sub block with the given name is present.
  getSubBlocks()
          Returns the sub blocks of this block.
 java.lang.String getType()
          Returns the type.
 boolean hasSubBlocks()
          Returns whether this block has subBlocks.
 void remove()
          Unlinks this object from the simulink tree.
 java.lang.String toString()
          Get string representation of this block.
 
Methods inherited from class edu.tum.cs.simulink.model.SimulinkElementBase
getId, getModel, getName, getParent, setParent
 
Methods inherited from class edu.tum.cs.simulink.model.ParameterizedElement
getDeclaredParameter, getDeclaredParameterNames, getParameter, getParameterNames, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimulinkBlock

public SimulinkBlock()
Create new Simulink block.


SimulinkBlock

protected SimulinkBlock(SimulinkBlock origBlock)
                 throws DeepCloneException
Copy constructor. This is used from the SimulinkModel during cloning.

Throws:
DeepCloneException
Method Detail

addAnnotation

public void addAnnotation(SimulinkAnnotation annotation)
Add an annotation.


addSubBlock

public void addSubBlock(SimulinkBlock subBlock)
Adds a sub block.


getAnnotations

public  getAnnotations()
Get annotations.


getInLines

public java.util.List<SimulinkLine> getInLines()
Get all incoming lines of this block.


getInPort

public SimulinkInPort getInPort(java.lang.String portIndex)
Get inport by index or null if no inport with this index was found.


getInPorts

public  getInPorts()
Returns the inports this block.


getOutLines

public java.util.List<SimulinkLine> getOutLines()
Get all outgoing lines of this block.


getOutPort

public SimulinkOutPort getOutPort(java.lang.String portIndex)
Get outport by index or null if no outport with this index was found.


getOutPorts

public  getOutPorts()
Returns the outport of this block.


getResolvedType

public java.lang.String getResolvedType()
If this block is of type 'Reference' this returns Reference.<source type of the reference>. Otherwise this just returns the type of the block.


getSubBlock

public SimulinkBlock getSubBlock(java.lang.String name)
Get named sub block or null if no sub block with the given name is present.


getSubBlocks

public  getSubBlocks()
Returns the sub blocks of this block.


getType

public java.lang.String getType()
Returns the type.


hasSubBlocks

public boolean hasSubBlocks()
Returns whether this block has subBlocks.


remove

public void remove()
Unlinks this object from the simulink tree.

Overrides:
remove in class SimulinkElementBase

toString

public java.lang.String toString()
Get string representation of this block.

Overrides:
toString in class SimulinkElementBase

deepClone

public SimulinkBlock deepClone()
                        throws DeepCloneException
Creates a deep clone of this block. Please note that is possible to clone a single block but the resulting block will behave not properly as it does not belong to SimulinkModel. Therefore it is strongly recommended to deep clone only whole models.

Throws:
DeepCloneException

simulink

simulink - 2.7