MATES 3.0-rc2

Class Bundle

  extended byorg.mates.util.Bundle
All Implemented Interfaces:
Direct Known Subclasses:

public class Bundle
extends java.lang.Object
implements java.lang.Cloneable

A data encapsulator class for automating concurrent processes. This is the main data structure used by the BatchProcessor architecture.

It is possible to extend this class, however not necessary. Most extensions of this class will need to re-implement the clone() function, as this is used in BatchProcessor.process(Bundle) to create new Bundles for each of the processing threads.

Evan Sultanik

Nested Class Summary
protected  class Bundle.BundleIterator
          An iterator class for a Bundle.
Constructor Summary
          Default constructor.
Bundle(int data_offset, int data_range, java.lang.Object payload)
          Conveniance constructor.
Method Summary
protected  java.lang.Object clone()
          Creates a copy of this bundle.
 java.util.Iterator elements()
          Returns an iterator for the current list this bundle is a member of.
 int getDataOffset()
          Accessor for the data offset.
 int getDataRange()
          Accessor for the data range.
 Bundle getNext()
          Returns the next Bundle in the current list.
 java.lang.Object getPayload()
          Returns the payload of this bundle.
 void insertAfter(Bundle bundle)
          Inserts a bundle in the current list between this and this.
 void setDataOffset(int offset)
          Sets the data offset.
 void setDataRange(int range)
          Sets the data range.
 void setPayload(java.lang.Object payload)
          Sets the payload of this bundle.
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Bundle()
Default constructor.


public Bundle(int data_offset,
              int data_range,
              java.lang.Object payload)
Conveniance constructor.

Method Detail


protected java.lang.Object clone()
Creates a copy of this bundle. Everything but the payload is cloned.


public void setDataOffset(int offset)
Sets the data offset.


public int getDataOffset()
Accessor for the data offset.


public int getDataRange()
Accessor for the data range.


public void setDataRange(int range)
Sets the data range.


public void setPayload(java.lang.Object payload)
Sets the payload of this bundle. This is simply for a conveniance; the payload is not required at all for the successful execution of BatchProcessor.process(Bundle). The payload of a bundle is generally not cloned during clone(). This is one way of collecting batch processing results; each processor can add the resulting object to this bundle, which, in turn, gets appended to the input bundle to BatchProcessor.process(Bundle).


public java.lang.Object getPayload()
Returns the payload of this bundle.

See Also:


public java.util.Iterator elements()
Returns an iterator for the current list this bundle is a member of. Every bundle is a member of a doubly-linked list containing one bundle per data "chunk" that was parallelized. For example, this linked list is then concatenated on the end of the bundle passed to BatchProcessor.process(Bundle).

See Also:


public Bundle getNext()
Returns the next Bundle in the current list.

See Also:


public void insertAfter(Bundle bundle)
Inserts a bundle in the current list between this and this.getNext().

bundle - the bundle to be inserted in the list.

MATES 3.0-rc2

Submit a bug or request a feature

Copyright 2004 Evan Sultanik