org.jacorb.orb
Class TaggedComponentList

java.lang.Object
  extended byorg.jacorb.orb.TaggedComponentList
All Implemented Interfaces:
java.lang.Cloneable

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

Represents a list of tagged components from an IOR, along with some generic methods to find and access individual components.

Version:
$Id: TaggedComponentList.java,v 1.7 2003/05/23 13:36:16 andre.spiegel Exp $
Author:
Andre Spiegel

Constructor Summary
TaggedComponentList()
          Constructs a new, empty TaggedComponentList.
TaggedComponentList(byte[] data)
          Constructs a TaggedComponentList from a CDR encapsulation of an array of tagged components.
TaggedComponentList(InputStream in)
          Constructs a TaggedComponentList object from a CDR representation of an array of tagged components.
 
Method Summary
 void addAll(TaggedComponentList other)
          Adds an entire TaggedComponentList to this list.
 void addComponent(int tag, byte[] data)
          Adds a tagged component to this list.
 void addComponent(int tag, java.lang.Object data, java.lang.Class helper)
          Adds a tagged component to this list.
 void addComponent(TaggedComponent component)
          Adds a tagged component to this list.
 TaggedComponent[] asArray()
           
 java.lang.Object clone()
           
 TaggedComponent get(int index)
           
 java.lang.Object getComponent(int tag, java.lang.Class helper)
          Searches for a component with the given tag in this component list.
 java.util.List getComponents(int tag, java.lang.Class helper)
          Returns a List of all components with the given tag from this TaggedComponentList.
 java.lang.String getStringComponent(int tag)
          Returns the first component with the given tag, which is assumed to be a CDR string.
 boolean isEmpty()
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaggedComponentList

public TaggedComponentList(InputStream in)
Constructs a TaggedComponentList object from a CDR representation of an array of tagged components.


TaggedComponentList

public TaggedComponentList(byte[] data)
Constructs a TaggedComponentList from a CDR encapsulation of an array of tagged components.


TaggedComponentList

public TaggedComponentList()
Constructs a new, empty TaggedComponentList.

Method Detail

size

public int size()

isEmpty

public boolean isEmpty()

get

public TaggedComponent get(int index)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

asArray

public TaggedComponent[] asArray()

addComponent

public void addComponent(int tag,
                         java.lang.Object data,
                         java.lang.Class helper)
Adds a tagged component to this list. The component's data is created by marshaling the given data Object using the write() method of the given helper class.


addComponent

public void addComponent(int tag,
                         byte[] data)
Adds a tagged component to this list.


addComponent

public void addComponent(TaggedComponent component)
Adds a tagged component to this list.


addAll

public void addAll(TaggedComponentList other)
Adds an entire TaggedComponentList to this list.


getComponent

public java.lang.Object getComponent(int tag,
                                     java.lang.Class helper)
Searches for a component with the given tag in this component list. If one is found, this method reads the corresponding data with the given helper class, and returns the resulting object, otherwise returns null.


getStringComponent

public java.lang.String getStringComponent(int tag)
Returns the first component with the given tag, which is assumed to be a CDR string. If no component with the given tag exists, returns null.


getComponents

public java.util.List getComponents(int tag,
                                    java.lang.Class helper)
Returns a List of all components with the given tag from this TaggedComponentList. Each individual component is read with the given helper class. If no components with the given tag can be found, an empty list is returned.