edu.wpi.ebob.model.cm
Interface IClassManager

All Known Implementing Classes:
JEMClassManager

public interface IClassManager

Performs remote operations on a JVM and retains references for obtaining remote classes and objects.

Author:
Liam Morley

Method Summary
 void addClassManagerListener(IClassManagerListener listener)
           
 void associateProject(org.eclipse.jdt.core.IJavaProject javaProject)
          Associates this manager with a given java project.
 void disassociateProject()
          Removes any given association with any project.
 void dispose()
          Clears up any resources held by the class manager.
 org.eclipse.jdt.core.IJavaProject getAssociatedProject()
          Retrieves the associated project, if one exists.
 IClass getClass(java.lang.String name)
          Retrieves a class with the given name.
 boolean isDirty()
          States whether the underlying class structure may be out of sync with the class manager.
 boolean isValid()
          States whether the manager is currently associated with a project.
 IObject performAdditionOperation(IObject left, IObject right)
          Performs left + right.
 IObject performAlgebraicNegationOperation(IObject operand)
          Performs -operand.
 IObject performBooleanNegationOperation(IObject operand)
          Performs !operand.
 IObject performDivisionOperation(IObject left, IObject right)
          Performs left / right.
 IObject performModulusOperation(IObject left, IObject right)
          Performs left % right.
 IObject performMultiplicationOperation(IObject left, IObject right)
          Performs left * right.
 IObject performOperation(IOperation op, IObject[] args)
          performs the given operation with the given arguments.
 IObject performSubtractionOperation(IObject left, IObject right)
          Performs left - right.
 void removeClassManagerListener(IClassManagerListener listener)
           
 IArray resolveArray(IClass type, IObject[] elements)
          Returns an array object using the IArray form.
 IObject resolveObject(IClass type, java.lang.String expression)
          Returns an object of type returnType based on the given expression, if such an expression can resolve to that returnType.
 IObject resolveValue(boolean value)
          Returns an IObject representing a primitive boolean value.
 IObject resolveValue(char value)
          Returns an IObject representing a primitive char value.
 IObject resolveValue(double value)
          Returns an IObject representing a primitive double value.
 IObject resolveValue(int value)
          Returns an IObject representing a primitive integer value.
 IObject resolveValue(java.lang.String value)
          Returns an IObject representing a primitive String value.
 

Method Detail

addClassManagerListener

void addClassManagerListener(IClassManagerListener listener)

removeClassManagerListener

void removeClassManagerListener(IClassManagerListener listener)

associateProject

void associateProject(org.eclipse.jdt.core.IJavaProject javaProject)
Associates this manager with a given java project. Does nothing if the current project is equal to the given project.

Parameters:
javaProject - the given project, can not be null.

getAssociatedProject

org.eclipse.jdt.core.IJavaProject getAssociatedProject()
Retrieves the associated project, if one exists.

Returns:
the project associated with this manager.

isValid

boolean isValid()
States whether the manager is currently associated with a project.

Returns:
true if the manager is currently associated with a project, false otherwise.

isDirty

boolean isDirty()
States whether the underlying class structure may be out of sync with the class manager.

Returns:
true if the dirty flag has been set, false otherwise.

disassociateProject

void disassociateProject()
Removes any given association with any project. Does nothing if no such association currently exists.


getClass

IClass getClass(java.lang.String name)
                throws java.lang.ClassNotFoundException
Retrieves a class with the given name.

Parameters:
name - the fully-qualified class name. Can also be "int" or another primitive type.
Returns:
the class if it exists.
Throws:
java.lang.IllegalStateException - if the manager is not currently associated with a project.
java.lang.ClassNotFoundException

resolveObject

IObject resolveObject(IClass type,
                      java.lang.String expression)
                      throws java.lang.ClassCastException,
                             java.lang.InstantiationException,
                             RemoteException
Returns an object of type returnType based on the given expression, if such an expression can resolve to that returnType.

Throws:
java.lang.ClassCastException
java.lang.InstantiationException
RemoteException

resolveArray

IArray resolveArray(IClass type,
                    IObject[] elements)
                    throws RemoteException
Returns an array object using the IArray form.

Parameters:
type - the type of the array
elements - the elements of the array
Returns:
the converted IArray object
Throws:
RemoteException

resolveValue

IObject resolveValue(boolean value)
Returns an IObject representing a primitive boolean value.

Parameters:
value - the boolean value, true or false.
Returns:
an IObject representing a primitive boolean value.

resolveValue

IObject resolveValue(int value)
Returns an IObject representing a primitive integer value.

Parameters:
value - the integer value.
Returns:
an IObject representing a primitive integer value.

resolveValue

IObject resolveValue(double value)
Returns an IObject representing a primitive double value.

Parameters:
value - the double value.
Returns:
an IObject representing a primitive double value.

resolveValue

IObject resolveValue(char value)
Returns an IObject representing a primitive char value.

Parameters:
value - the char value.
Returns:
an IObject representing a primitive char value.

resolveValue

IObject resolveValue(java.lang.String value)
Returns an IObject representing a primitive String value.

Parameters:
value - the String value.
Returns:
an IObject representing a primitive String value.

performOperation

IObject performOperation(IOperation op,
                         IObject[] args)
                         throws RemoteException
performs the given operation with the given arguments.

Throws:
RemoteException - if there is an error performing the operation.

performAdditionOperation

IObject performAdditionOperation(IObject left,
                                 IObject right)
                                 throws RemoteException
Performs left + right.

Throws:
RemoteException

performSubtractionOperation

IObject performSubtractionOperation(IObject left,
                                    IObject right)
                                    throws RemoteException
Performs left - right.

Throws:
RemoteException

performMultiplicationOperation

IObject performMultiplicationOperation(IObject left,
                                       IObject right)
                                       throws RemoteException
Performs left * right.

Throws:
RemoteException

performDivisionOperation

IObject performDivisionOperation(IObject left,
                                 IObject right)
                                 throws RemoteException
Performs left / right.

Throws:
RemoteException

performModulusOperation

IObject performModulusOperation(IObject left,
                                IObject right)
                                throws RemoteException
Performs left % right.

Throws:
RemoteException

performAlgebraicNegationOperation

IObject performAlgebraicNegationOperation(IObject operand)
                                          throws RemoteException
Performs -operand.

Throws:
RemoteException

performBooleanNegationOperation

IObject performBooleanNegationOperation(IObject operand)
                                        throws RemoteException
Performs !operand.

Throws:
RemoteException

dispose

void dispose()
Clears up any resources held by the class manager.