org.ourgrid.common.spec
Class IOBlock

java.lang.Object
  extended by org.ourgrid.common.spec.IOBlock
All Implemented Interfaces:
java.io.Serializable

public class IOBlock
extends java.lang.Object
implements java.io.Serializable

This entity handles the input and output entries for a task.

See Also:
Created on Jul 1, 2004, Serialized Form

Constructor Summary
IOBlock()
          An empty constructor
 
Method Summary
 java.util.Iterator<java.lang.String> getConditions()
          Returns all the conditions that indexes the entry blocks.
 java.util.Vector<IOEntry> getEntry(java.lang.String condition)
          Returns a collection with the entries related with a condition.
 int length()
          Tells how many entries this I/O block has.
 void putEntry(IOEntry entry)
          Inserts a new input/output entry at this block of I/O commands, using as condition the empty string, that means this entry will always be used.
 void putEntry(java.lang.String condition, IOEntry entry)
          Inserts a new input/output entry at this block of I/O commands.
 java.lang.String toString()
          Returns a string representation of an IOBlock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IOBlock

public IOBlock()
An empty constructor

Method Detail

putEntry

public void putEntry(java.lang.String condition,
                     IOEntry entry)
Inserts a new input/output entry at this block of I/O commands.

Parameters:
condition - The condition that tells if the I/O command will be executed. It happens only when the command was written inside a if/else block.
entry - A IOEntry object that defines the command and the paths of origin and destiny of a file.

putEntry

public void putEntry(IOEntry entry)
Inserts a new input/output entry at this block of I/O commands, using as condition the empty string, that means this entry will always be used.

Parameters:
entry - The input/output entry.

length

public int length()
Tells how many entries this I/O block has. Notice that the lenght means how many conditions blocks where inserted and not how many commands has been inserted.

Returns:
How many entries this block has.

getEntry

public java.util.Vector<IOEntry> getEntry(java.lang.String condition)
Returns a collection with the entries related with a condition. To obtain all the conditions at this block use this.getConditions.

Parameters:
condition - The condition that indexes all the entries that will be used if it is true.
Returns:
The collection of entries related with a condition - null if the condition does not exist.

getConditions

public java.util.Iterator<java.lang.String> getConditions()
Returns all the conditions that indexes the entry blocks.

Returns:
A iterator with all the valid conditions that indexes the entries at this input/output block.

toString

public java.lang.String toString()
Returns a string representation of an IOBlock.

Overrides:
toString in class java.lang.Object