org.objectweb.fractal.julia.type
Class BasicComponentType

java.lang.Object
  extended byorg.objectweb.fractal.julia.type.BasicComponentType
All Implemented Interfaces:
ComponentType, Serializable, Type

public class BasicComponentType
extends Object
implements ComponentType, Serializable

Provides a basic implementation of the ComponentType interface.

See Also:
Serialized Form

Constructor Summary
BasicComponentType(InterfaceType[] itfTypes)
          Constructs a BasicComponentType object.
 
Method Summary
 InterfaceType getFcInterfaceType(String name)
          Returns an interface type of this component type from its name.
 InterfaceType[] getFcInterfaceTypes()
          Returns the types of the interfaces of components of this type.
 boolean isFcSubTypeOf(Type type)
          Returns true if the given type is a sub-type of this type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicComponentType

public BasicComponentType(InterfaceType[] itfTypes)
                   throws InstantiationException
Constructs a BasicComponentType object.

Parameters:
itfTypes - the types of the interfaces of components of this type.
Throws:
InstantiationException - if two interface types have the same name, or if the name of an interface type is a prefix of the name of a collection interface type.
Method Detail

getFcInterfaceTypes

public InterfaceType[] getFcInterfaceTypes()
Description copied from interface: ComponentType
Returns the types of the interfaces of components of this type.

Specified by:
getFcInterfaceTypes in interface ComponentType
Returns:
the types of the interfaces that components of this type must or may have at runtime.

getFcInterfaceType

public InterfaceType getFcInterfaceType(String name)
                                 throws NoSuchInterfaceException
Description copied from interface: ComponentType
Returns an interface type of this component type from its name. This method is not strictly necessary, as it can be implemented by using the getFcInterfaceTypes method. But it is convenient and can be implemented more efficiently than with the previous method. This is why it is specified here.

Specified by:
getFcInterfaceType in interface ComponentType
Parameters:
name - the name of one of the interface types returned by getFcInterfaceTypes (see getFcItfName).
Returns:
the interface type of this component type whose name is equal to the given name (see getFcItfName).
Throws:
NoSuchInterfaceException - if there is no such interface type.

isFcSubTypeOf

public boolean isFcSubTypeOf(Type type)
Description copied from interface: Type
Returns true if the given type is a sub-type of this type. The relation defined by this method should be:

Specified by:
isFcSubTypeOf in interface Type
Parameters:
type - the type to be compared to this type.
Returns:
true if the given type is a sub-type of this type.