org.objectweb.kilim.description
Class Slot

java.lang.Object
  extended byorg.objectweb.kilim.description.TemplateElementImpl
      extended byorg.objectweb.kilim.description.Slot
All Implemented Interfaces:
java.lang.Cloneable, NamedElement, TemplateElement

public class Slot
extends TemplateElementImpl
implements NamedElement

Author:
horn Describes a slot, which is just a set of unbound ports

Field Summary
private static java.lang.String[][] msgTexts
           
private  java.util.List ports
           
private  java.lang.String slotName
           
private  int status
           
 
Fields inherited from class org.objectweb.kilim.description.TemplateElementImpl
 
Constructor Summary
Slot(java.lang.String aSlotName, int aStatus, TemplateDescription aTemplate)
          a public constructor for slots.
 
Method Summary
 void addPort(Port aPort)
          Method addPort adds a new port in the slot.
private  void checkStatus(int aStatus)
          Method checkStatus.
 java.lang.String getLocalName()
          returns the name of the element.
 java.util.Iterator getPorts()
          Method getPorts returns as an iterator the ports defined in the slot.
 int getStatus()
          returns the status of the element.
private  java.lang.String msgSuffix1()
           
 void removePort(Port aPort)
          Method removePort.
 void setLocalName(java.lang.String aName)
          sets a name to the element.
 void setStatus(int aStatus)
          sets the element status.
 
Methods inherited from class org.objectweb.kilim.description.TemplateElementImpl
clone, getContainingTemplate, getTemplateDefHierarchy, setContainingTemplate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.kilim.description.TemplateElement
clone, getContainingTemplate, getTemplateDefHierarchy, setContainingTemplate
 

Field Detail

msgTexts

private static java.lang.String[][] msgTexts

slotName

private java.lang.String slotName

status

private int status

ports

private java.util.List ports
Constructor Detail

Slot

public Slot(java.lang.String aSlotName,
            int aStatus,
            TemplateDescription aTemplate)
     throws KilimException
a public constructor for slots.

Parameters:
aSlotName - : the slot name
aStatus - : the status of the slot. It should be one KILIM.PRIVATE, KILIM.PROTECTED, KILIM.PUBLIC.
aTemplate - : the template in which the slot is defined.
Throws:
KilimException - : generated if aSlotName or aTemplate is null or if aStatus has an invalid value.
Method Detail

getLocalName

public java.lang.String getLocalName()
Description copied from interface: NamedElement
returns the name of the element.

Specified by:
getLocalName in interface NamedElement
Returns:
String
See Also:
NamedElement.getLocalName()

setLocalName

public void setLocalName(java.lang.String aName)
                  throws KilimException
Description copied from interface: NamedElement
sets a name to the element.

Specified by:
setLocalName in interface NamedElement
Parameters:
aName - : the name to be set
Throws:
KilimException - : generated when aName is null.
See Also:
NamedElement.setLocalName(String)

getStatus

public int getStatus()
Description copied from interface: NamedElement
returns the status of the element.

Specified by:
getStatus in interface NamedElement
Returns:
int. The value is one of KILIM.PRIVATE, KILIM.PROTECTED, KILIM.PUBLIC.
See Also:
NamedElement.getStatus()

setStatus

public void setStatus(int aStatus)
               throws KilimException
Description copied from interface: NamedElement
sets the element status.

Specified by:
setStatus in interface NamedElement
Parameters:
aStatus - : The value must be one of KILIM.PRIVATE, KILIM.PROTECTED, KILIM.PUBLIC.
Throws:
KilimException - generated if the value for aStatus is not valid.
See Also:
NamedElement.setStatus(int)

checkStatus

private void checkStatus(int aStatus)
                  throws KilimException
Method checkStatus.

Parameters:
aStatus -
Throws:
KilimException

getPorts

public java.util.Iterator getPorts()
Method getPorts returns as an iterator the ports defined in the slot.

Returns:
Iterator

addPort

public void addPort(Port aPort)
             throws KilimException
Method addPort adds a new port in the slot.

Parameters:
aPort - : the port to be added.
Throws:
KilimException - : generated if aPort is null or if the slot already contains aPort.

removePort

public void removePort(Port aPort)
                throws KilimException
Method removePort.

Parameters:
aPort - : the port to be removed.
Throws:
KilimException - : generated if aPort is null or if no port have been defined in the slot.

msgSuffix1

private java.lang.String msgSuffix1()