org.scribble.protocol.model
Class Block

java.lang.Object
  extended by org.scribble.protocol.model.ModelObject
      extended by org.scribble.protocol.model.Activity
          extended by org.scribble.protocol.model.Block

public class Block
extends Activity

This class represents a group of activities.


Constructor Summary
Block()
           
 
Method Summary
 boolean add(Activity act)
          This method adds an activity to the block.
 boolean equals(Object o)
           
 Activity get(int index)
          This method returns the activity at the specified index.
 List<Activity> getContents()
          This method returns the contents associated with the block.
 int hashCode()
           
 int indexOf(Activity act)
          This method returns the index of the supplied activity.
 boolean remove(Activity act)
          This method removes an activity from the block.
 int size()
          This method returns the number of activities in the block.
 String toString()
           
 void visit(Visitor visitor)
          This method visits the model object using the supplied visitor.
 
Methods inherited from class org.scribble.protocol.model.Activity
getEnclosingProtocol
 
Methods inherited from class org.scribble.protocol.model.ModelObject
derivedFrom, getAnnotations, getModel, getParent, getProperties, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Block

public Block()
Method Detail

getContents

public List<Activity> getContents()
This method returns the contents associated with the block.

Returns:
The contents

add

public boolean add(Activity act)
This method adds an activity to the block.

Parameters:
act - The activity
Returns:
Whether the activity has been added

remove

public boolean remove(Activity act)
This method removes an activity from the block.

Parameters:
act - The activity
Returns:
Whether the activity has been removed

size

public int size()
This method returns the number of activities in the block.

Returns:
The number of activities

get

public Activity get(int index)
             throws IndexOutOfBoundsException
This method returns the activity at the specified index.

Parameters:
index - The index The index
Returns:
The activity The activity
Throws:
IndexOutOfBoundsException - Out of bounds

indexOf

public int indexOf(Activity act)
This method returns the index of the supplied activity.

Parameters:
act - The activity
Returns:
The index, or -1 if the activity is not found

visit

public void visit(Visitor visitor)
This method visits the model object using the supplied visitor.

Specified by:
visit in class ModelObject
Parameters:
visitor - The visitor

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-Present Scribble.org. All Rights Reserved.