Package org.xj3d.sai
Class X3DNodeTypeMapper
java.lang.Object
org.xj3d.sai.X3DNodeTypeMapper
A utility class for handling abstract node type functions, Including:
- Associating abstract node type names with their enumerated type constants and vice versa.
- Obtaining the inherited abstract node types of both abstract nodes and 'real' nodes.
- Producing the set of enumerated type constants suitable for return from the X3DNode.getNodeType() method.
- Version:
- $Revision: 1.2 $
- Author:
- Rex Melton
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic X3DNodeTypeMapper
Return the instance of the X3DNodeTypeMapperReturn an unmodifiable interface map.String[]
getInterfaces
(String node_name) Return the array of interface names for the named argument nodeint[]
getInterfaceTypes
(String node_name) Return the array of abstract node types for the named argument nodeint
Return the X3DNodeType constant that corresponds to the abstract node type name.getTypeName
(int type) Return the abstract node type name that corresponds to the X3DNodeType constant.static void
Test routine to echo out the nodes and inherited types in "spec" format.
-
Constructor Details
-
X3DNodeTypeMapper
protected X3DNodeTypeMapper()Protected Constructor
-
-
Method Details
-
getInstance
Return the instance of the X3DNodeTypeMapper- Returns:
- the instance of the X3DNodeTypeMapper
-
getInterfaces
Return the array of interface names for the named argument node- Parameters:
node_name
- The node for which to determine the interfaces- Returns:
- The array of interface names. If the named node does not inherit from any known interfaces, an empty String array is returned. If the named node is unknown, null is returned.
-
getInterfaceTypes
Return the array of abstract node types for the named argument node- Parameters:
node_name
- The node for which to determine the interfaces- Returns:
- The array of abstract node types. If the named node does not inherit from any known interfaces, an empty array is returned. If the named node is unknown, an array containing a single value of -1 is returned.
-
getInterfaceMap
-
getTypeName
Return the abstract node type name that corresponds to the X3DNodeType constant.- Parameters:
type
- The X3DNodeType constant- Returns:
- The abstract node type name. If the constant does not correspond to a known type, null is returned.
-
getType
Return the X3DNodeType constant that corresponds to the abstract node type name.- Parameters:
typeName
- The abstract node type name.- Returns:
- the X3DNodeType constant that corresponds to the named abstract node type. If the named node type is unknown, -1 is returned.
-
main
Test routine to echo out the nodes and inherited types in "spec" format. Will complain if an unknown abstract type is encountered.- Parameters:
arg
-
-