copyright The Portico Project 2008.

org.portico.shared.model
Class MOMHelper

java.lang.Object
  extended by org.portico.shared.model.MOMHelper

public class MOMHelper
extends Object

This class helps do MOM related stuff (including 1.3/1516 conversions). As a result, it is VERY ugly internally. I can't understand why the IEEE 1516 standards group decided to ENTIRELY BREAK ALL BACKWARDS COMPATIBILITY by prefixing everything with "HLA", but they did. As a result, we have to do all sorts of ugly stuff we wouldn't normally have to do, so get used to it.


Nested Class Summary
static class MOMHelper.Federate
          Identifiers for the attributes of the Federate MOM class.
static class MOMHelper.Federation
          Same solution as for Federate above, see that comment for my thoughts
 
Field Summary
private  HashSet<Integer> allFederateHandles
           
private  HashSet<Integer> allFederationHandles
           
private  HashMap<String,MOMHelper.Federate> federate13Attributes
           
private  HashMap<String,MOMHelper.Federate> federate1516Attributes
           
static int FederateClass
           
private  HashMap<String,MOMHelper.Federation> federation13Attributes
           
private  HashMap<String,MOMHelper.Federation> federation1516Attributes
           
static int FederationClass
           
private static MOMHelper INSTANCE
           
static int ManagerClass
           
 
Constructor Summary
private MOMHelper()
           
 
Method Summary
static HashSet<Integer> getFederateAttributes()
           
static HashSet<Integer> getFederationAttributes()
           
static int getMOMAttributeHandle(int classHandle, String name)
          Fetch the handle for the MOM attribute of the given name in the MOM class of the given handle.
static int getMOMClassHandle(String className)
          Fetch the handle for the MOM class of the given name.
static void insertMomHierarchy(ObjectModel theModel)
          Build the hierarchy of MOM object classes and initialize them with the default handles.
private static ACMetadata newAttribute(String name, int handle)
           
static String strip1516Crap(String name)
          This method will remove "HLA" from the front of any provided string and return the resulting string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ManagerClass

public static final int ManagerClass
See Also:
Constant Field Values

FederateClass

public static final int FederateClass
See Also:
Constant Field Values

FederationClass

public static final int FederationClass
See Also:
Constant Field Values

INSTANCE

private static final MOMHelper INSTANCE

federate13Attributes

private HashMap<String,MOMHelper.Federate> federate13Attributes

federation13Attributes

private HashMap<String,MOMHelper.Federation> federation13Attributes

federate1516Attributes

private HashMap<String,MOMHelper.Federate> federate1516Attributes

federation1516Attributes

private HashMap<String,MOMHelper.Federation> federation1516Attributes

allFederateHandles

private HashSet<Integer> allFederateHandles

allFederationHandles

private HashSet<Integer> allFederationHandles
Constructor Detail

MOMHelper

private MOMHelper()
Method Detail

getFederateAttributes

public static HashSet<Integer> getFederateAttributes()

getFederationAttributes

public static HashSet<Integer> getFederationAttributes()

getMOMClassHandle

public static int getMOMClassHandle(String className)
Fetch the handle for the MOM class of the given name. This will work when given either HLA 1.3 or HLA 1516 style MOM names. If the class name is unknown, ObjectModel.INVALID_HANDLE will be returned.


getMOMAttributeHandle

public static int getMOMAttributeHandle(int classHandle,
                                        String name)
Fetch the handle for the MOM attribute of the given name in the MOM class of the given handle. If the handle is not recognized or the name isn't a valid attribute, ObjectModel.INVALID_HANDLE will be returned.


strip1516Crap

public static String strip1516Crap(String name)
This method will remove "HLA" from the front of any provided string and return the resulting string. If the next letter is lower case, it will be made upper case. This will work on "." separated names. For example: "HLAobjectRoot.HLAmanager" will become "ObjectRoot.Manager".


insertMomHierarchy

public static void insertMomHierarchy(ObjectModel theModel)
Build the hierarchy of MOM object classes and initialize them with the default handles. This method will also patch the MOM stuff into the model, adding all the classes and setting the manager class (for example) as a child of the object root.


newAttribute

private static ACMetadata newAttribute(String name,
                                       int handle)

copyright The Portico Project 2008.