emn.fr.ascola.extractor
Class TypesTable

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,Information>
          extended by emn.fr.ascola.extractor.TypesTable
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,Information>

public class TypesTable
extends java.util.HashMap<java.lang.String,Information>

Table for storing informations about the types.

Author:
jroyer
See Also:
Serialized Form

Constructor Summary
TypesTable(java.util.Vector<org.eclipse.jdt.core.IType> vt)
          Constructor.
 
Method Summary
 void addType(java.lang.String fn, Information it)
          Add a new entry and its information.
 java.util.Vector<java.lang.String> checkCycle()
          Compute the component type which have a cyclic structure.
 java.util.Vector<java.lang.String> checkPublicFields()
          Compute the list of component which have a public fields TODO check it here not an interface !
 java.util.Vector<java.lang.String> findCycle(java.lang.String node, java.util.Vector<java.lang.String> history)
          Recursive function to find cyclic component type.
 int getComponentNumber()
          Compute the number of component type.
 java.util.Vector<java.lang.String> getCycles()
          Compute the list of component type which have a cycle structure.
 int getDatatypeNumber()
          Compute the number of data type.
 Fields getStructure(java.lang.String fullname)
          Get the structure stored in the table.
 java.util.Vector<java.lang.String> getUndefined()
          Compute the list of undefined types.
 boolean hasFields(java.lang.String fn)
          Test fields existence.
 boolean inheritsFromData(java.lang.String sub, java.lang.String sup)
          test if sub inherits directly or not from sup IF sup is external we consider it is true
 boolean isDataType(java.lang.String fn)
          Check if it is flagged as a data type.
 boolean isOfInterest(java.lang.String fn)
          Check the existence of such a type.
 boolean isResolved(java.lang.String fn)
          Check if the type name is resolved Require this.isOfInterest()
 void propagateDATA()
          For each entry flagged DATA then direct subclasses are also flagged as DATA.
 void setComponentType(java.lang.String bn)
          Set that name is a component type.
 void setDataType(java.lang.String bn)
          Set that name is a data type.
 void setRoot(java.lang.String bn)
          Set as THE root name.
 void setType(java.lang.String bn)
          Setting default null information.
 void setType(java.lang.String bn, MyIType it)
          Set the information type for a name.
 void setUndefinedInterfaces()
          Set the undefined interfaces to component types.
 java.lang.String toString()
          String description.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

TypesTable

public TypesTable(java.util.Vector<org.eclipse.jdt.core.IType> vt)
Constructor.

Parameters:
vt -
Method Detail

isOfInterest

public boolean isOfInterest(java.lang.String fn)
Check the existence of such a type.

Parameters:
fn -
Returns:

isDataType

public boolean isDataType(java.lang.String fn)
Check if it is flagged as a data type. Require this.isOfInterest()

Parameters:
fn -
Returns:

isResolved

public boolean isResolved(java.lang.String fn)
Check if the type name is resolved Require this.isOfInterest()

Parameters:
fn -
Returns:

hasFields

public boolean hasFields(java.lang.String fn)
Test fields existence.

Parameters:
fn -
Returns:

setDataType

public void setDataType(java.lang.String bn)
Set that name is a data type.

Parameters:
bn - binary name

setComponentType

public void setComponentType(java.lang.String bn)
Set that name is a component type.

Parameters:
bn - binary name

setRoot

public void setRoot(java.lang.String bn)
Set as THE root name.

Parameters:
bn -

addType

public void addType(java.lang.String fn,
                    Information it)
Add a new entry and its information.

Parameters:
fn -
it -

setType

public void setType(java.lang.String bn,
                    MyIType it)
Set the information type for a name.

Parameters:
bn -
it -

inheritsFromData

public boolean inheritsFromData(java.lang.String sub,
                                java.lang.String sup)
test if sub inherits directly or not from sup IF sup is external we consider it is true

Parameters:
sub - full name of type in the table
sup - full name of any type
Returns:

propagateDATA

public void propagateDATA()
For each entry flagged DATA then direct subclasses are also flagged as DATA. TODO what about subinterfaces ? ca doit 'heriter si interface alors peut-y avoir et ca marque


checkPublicFields

public java.util.Vector<java.lang.String> checkPublicFields()
Compute the list of component which have a public fields TODO check it here not an interface !

Returns:

checkCycle

public java.util.Vector<java.lang.String> checkCycle()
Compute the component type which have a cyclic structure. Look only at component type and catch all the connected components

Returns:

findCycle

public java.util.Vector<java.lang.String> findCycle(java.lang.String node,
                                                    java.util.Vector<java.lang.String> history)
Recursive function to find cyclic component type.

Parameters:
node -
history -
Returns:

setType

public void setType(java.lang.String bn)
Setting default null information.

Parameters:
bn -

getStructure

public Fields getStructure(java.lang.String fullname)
Get the structure stored in the table.

Parameters:
fullname -
Returns:

toString

public java.lang.String toString()
String description.

Overrides:
toString in class java.util.AbstractMap<java.lang.String,Information>

getComponentNumber

public int getComponentNumber()
Compute the number of component type.

Returns:

getDatatypeNumber

public int getDatatypeNumber()
Compute the number of data type.

Returns:

getCycles

public java.util.Vector<java.lang.String> getCycles()
Compute the list of component type which have a cycle structure.

Returns:

getUndefined

public java.util.Vector<java.lang.String> getUndefined()
Compute the list of undefined types.

Returns:

setUndefinedInterfaces

public void setUndefinedInterfaces()
Set the undefined interfaces to component types.