All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iBus.Posting

java.lang.Object
   |
   +----iBus.Posting

public class Posting
extends Object
implements Serializable
iBus Posting Java Bean Posting objects are used to encapsulate Java objects to be transmitted via a channel. A Posting object is a dynamically growing array of java.io.Serializable objects. The elements of a posting are accessed by index. For more sophisticated data structures, f.e. a HashTable, you can allocate a Serializable HashTable and pack it into a Posting.

A Posting has a Maximum and a Length property. Maximum determines how many elements can be packed without triggering a reallocation of the internal storage area. Length indicates the number of objects currently in the Posting. Extending the Length beyond the Maximum causes a reallocation and a copy of the internal storage.

Optionally the IncrementFactor propertly can be set. When the internal storage area needs to be reallocated, which typically happens within the setLength method, then a new storage area for (increment factor * new length) elements is allocated. IncrementFactor must be >= 1. The default is 1.


Constructor Index

 o Posting()
Create a Posting with Maximum = 0, Length = 0, and IncrementFactor = 2
 o Posting(int)
Create a Posting with Maximum = maximum, Length = 0, and IncrementFactor = 1

Method Index

 o getIncrementFactor()
Gets the IncrementFactor property.
 o getLength()
Get the Length property
 o getObject(int)
Returns the object at index position.
 o getSender()
Gets the URL of the sender of this posting.
 o setIncrementFactor(float)
Set the IncrementFactor property.
 o setLength(int)
Sets the Length property.
 o setObject(int, Serializable)
Store object at index position.
 o setSender(iBusURL)
sets the URL of the sender of this posting

Constructors

 o Posting
 public Posting()
Create a Posting with Maximum = 0, Length = 0, and IncrementFactor = 2

 o Posting
 public Posting(int maximum)
Create a Posting with Maximum = maximum, Length = 0, and IncrementFactor = 1

Parameters:
maximum - the required size of the internal storage area. Setting a Length larger than Maximum causes a reallocation and a copy of the internal storage area.

Methods

 o setObject
 public void setObject(int index,
                       Serializable object) throws ArrayIndexOutOfBoundsException
Store object at index position. Overwrites any object at that postition. If index > Maximum, then the internal array is reallocated. Note that no gaps are allowed in the internal storage area. A posting must be filled from 0 to N-1, otherwise a marshaling exception will occur.

Parameters:
index - the position to store the object at. 0 <= index <= length
object - the Java object (or Bean) to store
 o getObject
 public Serializable getObject(int index) throws ArrayIndexOutOfBoundsException
Returns the object at index position.

Parameters:
index - the position of the object to return. index < Length
Returns:
the object at index position
Throws: ArrayIndexOutOfBoundsException
if index >= Length
 o setLength
 public void setLength(int length) throws ArrayIndexOutOfBoundsException
Sets the Length property. If Length > Maximum then the internal array is reallocated.

Parameters:
length - the new size of the internal storage area. length >= 0
Throws: ArrayIndexOutOfBoundsException
if length < 0
 o getLength
 public int getLength()
Get the Length property

Returns:
the Length property
 o setIncrementFactor
 public void setIncrementFactor(float incFactor) throws ArrayIndexOutOfBoundsException
Set the IncrementFactor property. incFactor >= 1.0

Parameters:
incFactor - the new IncrementFactor
Throws: ArrayIndexOutOfBoundsException
if incFactor < 1
 o getIncrementFactor
 public float getIncrementFactor()
Gets the IncrementFactor property.

Returns:
the IncrementFactor property
 o getSender
 public iBusURL getSender()
Gets the URL of the sender of this posting.

Returns:
the URL of the sender of this posting
 o setSender
 public void setSender(iBusURL url)
sets the URL of the sender of this posting

Parameters:
url - of the sender of this posting

All Packages  Class Hierarchy  This Package  Previous  Next  Index