FileDocCategorySizeDatePackage
SlotTable.javaAPI DocJava SE 6 API2450Tue Jun 10 00:21:34 BST 2008com.sun.corba.se.impl.interceptors

SlotTable

public class SlotTable extends Object
SlotTable is used internally by PICurrent to store the slot information.

Fields Summary
private org.omg.CORBA.Any[]
theSlotData
private com.sun.corba.se.spi.orb.ORB
orb
private boolean
dirtyFlag
Constructors Summary
SlotTable(com.sun.corba.se.spi.orb.ORB orb, int slotSize)
The constructor instantiates an Array of Any[] of size given by slotSize parameter.

        dirtyFlag = false;
        this.orb = orb;
        theSlotData = new Any[slotSize];
    
Methods Summary
intgetSize()
This method returns the size of the allocated slots.

        return theSlotData.length;
    
public org.omg.CORBA.Anyget_slot(int id)
This method get the slot data for the given slot id (index).

        // First check whether the slot is allocated
        // If not, raise the invalid slot exception
        if( id >= theSlotData.length ) {
            throw new InvalidSlot();
        }
        if( theSlotData[id] == null ) {
            theSlotData [id] = new AnyImpl(orb);
        }
        return theSlotData[ id ];
    
voidresetSlots()
This method resets all the slot data to null if dirtyFlag is set.

        if( dirtyFlag == true ) {
            for( int i = 0; i < theSlotData.length; i++ ) {
                theSlotData[i] = null;
            }
        }
    
public voidset_slot(int id, org.omg.CORBA.Any data)
This method sets the slot data at the given slot id (index).

        // First check whether the slot is allocated
        // If not, raise the invalid slot exception
        if( id >= theSlotData.length ) {
            throw new InvalidSlot();
        }
        dirtyFlag = true;
        theSlotData[id] = data;