org.objectweb.fractal.explorer.graph
Class GraphInformations

java.lang.Object
  extended by org.objectweb.fractal.explorer.graph.GraphInformations

public class GraphInformations
extends Object

Utilities class for graphic representation

Version:
September 2004
Author:
Alexandre Vandekerkhove

Nested Class Summary
static class GraphInformations.SortInterface
          Sorts two interfaces by alphabetic order using their names.
 
Constructor Summary
GraphInformations()
           
 
Method Summary
static List getClientNeighbors(Component primitiveComponent)
          Provides a List of the neighbors 'client' components of a primitive component
static String getComponentState(Component component)
          Provides the execution state of a component
static String getComponentType(Component component)
          Provides the type of a component (primitive/composite)
static String getInterfaceName(Interface itf)
          Provides the name of an interface, summary name if it's a control interface ("content-controller" ==> "CC")
static Interface[] getIntItf(Component component)
          Provides the array of the internal interfaces of a component
static List getItfCollection(Component component)
          Provides an ArrayList of the (InterfaceType) of the collection interfaces Each collection will appear only one time in the ArrayList in order to represent a port per collection and not a port per client interface
static String getPortType(Interface itf)
          Provides the type of the port associated to an interface : client/collection-client/server/control
static Component getRootComponent(String nameAppli)
          Provides the first component (root) of an application
static List getServerNeighbors(Component primitiveComponent)
          Provides a List of the neighbors 'server' components of a primitive component
static String getSignature(Interface itf)
          Provides the signature of the interface
static Interface[] getSortExtItf(Component component)
          Provides the array of the external interfaces of a component The array is sorted by alphabetical order of the names of the interfaces
static Component[] getSubComponents(Component component)
          Provides an array of the sub-components of a composite component
static Component getTargetComponent(Component component, Interface itf)
          Provides the destination component
static Interface getTargetInterface(Component component, Interface itf)
          Provides the the destination interface
static boolean isClientInterface(Interface itf)
           
static boolean isCollectionInterface(Interface itf)
           
static boolean isControlInterface(Interface itf)
           
static boolean isOptional(Interface itf)
           
static boolean isPrimitiveComponent(Component component)
           
static boolean isSharedComponent(Component component)
           
static boolean isStarted(Component component)
          Returns true if the status of the component is "STARTED"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphInformations

public GraphInformations()
Method Detail

getRootComponent

public static Component getRootComponent(String nameAppli)
Provides the first component (root) of an application

Parameters:
nameAppli - the name of the application
Returns:
the "root" component associated

isPrimitiveComponent

public static boolean isPrimitiveComponent(Component component)
Parameters:
component - a component
Returns:
true if the component is a primitive component (no sub-components)

getComponentType

public static String getComponentType(Component component)
Provides the type of a component (primitive/composite)

Parameters:
component - the component
Returns:
its type

isSharedComponent

public static boolean isSharedComponent(Component component)
Parameters:
component - a component
Returns:
true if the component is a shared component

getSubComponents

public static Component[] getSubComponents(Component component)
Provides an array of the sub-components of a composite component

Parameters:
component - the component
Returns:
the array of its sub-components

getComponentState

public static String getComponentState(Component component)
Provides the execution state of a component

Parameters:
component - the component
Returns:
its execution state ("STARTED" / "STOPPED")

isStarted

public static boolean isStarted(Component component)
Returns true if the status of the component is "STARTED"

Parameters:
component - the component

getSortExtItf

public static Interface[] getSortExtItf(Component component)
Provides the array of the external interfaces of a component The array is sorted by alphabetical order of the names of the interfaces

Parameters:
component - the component
Returns:
the array of the external interfaces

getIntItf

public static Interface[] getIntItf(Component component)
Provides the array of the internal interfaces of a component

Parameters:
component - the component to introspect
Returns:
the array of its internal interfaces

getInterfaceName

public static String getInterfaceName(Interface itf)
Provides the name of an interface, summary name if it's a control interface ("content-controller" ==> "CC")

Parameters:
itf - the interface
Returns:
the name of the interface

isClientInterface

public static boolean isClientInterface(Interface itf)
Parameters:
itf - an interface
Returns:
true if the interface is a client interface

isControlInterface

public static boolean isControlInterface(Interface itf)
Parameters:
itf - an interface
Returns:
true if itf is a control interface

isCollectionInterface

public static boolean isCollectionInterface(Interface itf)
Parameters:
itf - a client interface
Returns:
true if the client interface is a collection interface

isOptional

public static boolean isOptional(Interface itf)
Parameters:
itf - a client interface
Returns:
true if the client interface is an optional interface

getItfCollection

public static List getItfCollection(Component component)
Provides an ArrayList of the (InterfaceType) of the collection interfaces Each collection will appear only one time in the ArrayList in order to represent a port per collection and not a port per client interface

Parameters:
component - the component to introspect
Returns:
the ArrayList of the (InterfaceType) of its collection interfaces

getPortType

public static String getPortType(Interface itf)
Provides the type of the port associated to an interface : client/collection-client/server/control

Parameters:
itf - the interface
Returns:
the type of the port associated

getSignature

public static String getSignature(Interface itf)
Provides the signature of the interface

Parameters:
itf - the interface
Returns:
the signature of the interface

getTargetComponent

public static Component getTargetComponent(Component component,
                                           Interface itf)
Provides the destination component

Parameters:
component - the component "server" of the bind
itf - the client interface which is bound
Returns:
the component "client" of the bind

getTargetInterface

public static Interface getTargetInterface(Component component,
                                           Interface itf)
Provides the the destination interface

Parameters:
component - the component "server" of the bind
itf - the client interface which is bound
Returns:
the interface "client" of the bind

getServerNeighbors

public static List getServerNeighbors(Component primitiveComponent)
Provides a List of the neighbors 'server' components of a primitive component

Parameters:
primitiveComponent - the primitive component
Returns:
the list of its server neighbors

getClientNeighbors

public static List getClientNeighbors(Component primitiveComponent)
Provides a List of the neighbors 'client' components of a primitive component

Parameters:
primitiveComponent - the primitive component
Returns:
the list of its client neighbors