Xj3D 2.0 VRML/X3D Code API

org.xj3d.sai
Class X3DNodeTypeMapper

java.lang.Object
  extended by org.xj3d.sai.X3DNodeTypeMapper

public class X3DNodeTypeMapper
extends java.lang.Object

A utility class for handling abstract node type functions, Including:

Version:
$Revision: 1.2 $
Author:
Rex Melton

Constructor Summary
protected X3DNodeTypeMapper()
          Protected Constructor
 
Method Summary
static X3DNodeTypeMapper getInstance()
          Return the instance of the X3DNodeTypeMapper
 java.util.Map<java.lang.String,java.lang.String[]> getInterfaceMap()
          Return an unmodifiable interface map.
 java.lang.String[] getInterfaces(java.lang.String node_name)
          Return the array of interface names for the named argument node
 int[] getInterfaceTypes(java.lang.String node_name)
          Return the array of abstract node types for the named argument node
 int getType(java.lang.String typeName)
          Return the X3DNodeType constant that cooresponds to the abstract node type name.
 java.lang.String getTypeName(int type)
          Return the abstract node type name that cooresponds to the X3DNodeType constant.
static void main(java.lang.String[] arg)
          Test routine to echo out the nodes and inherited types in "spec" format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

X3DNodeTypeMapper

protected X3DNodeTypeMapper()
Protected Constructor

Method Detail

getInstance

public static X3DNodeTypeMapper getInstance()
Return the instance of the X3DNodeTypeMapper

Returns:
the instance of the X3DNodeTypeMapper

getInterfaces

public java.lang.String[] getInterfaces(java.lang.String node_name)
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

public int[] getInterfaceTypes(java.lang.String node_name)
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

public java.util.Map<java.lang.String,java.lang.String[]> getInterfaceMap()
Return an unmodifiable interface map. The map key is the named node. The map value is an array of interface names.

Returns:
The interface map.

getTypeName

public java.lang.String getTypeName(int type)
Return the abstract node type name that cooresponds to the X3DNodeType constant.

Parameters:
type - The X3DNodeType constant
Returns:
The abstract node type name. If the constant does not coorespond to a known type, null is returned.

getType

public int getType(java.lang.String typeName)
Return the X3DNodeType constant that cooresponds to the abstract node type name.

Parameters:
typeName - The abstract node type name.
Returns:
the X3DNodeType constant that cooresponds to the named abstract node type. If the named node type is unknown, -1 is returned.

main

public static void main(java.lang.String[] arg)
Test routine to echo out the nodes and inherited types in "spec" format. Will complain if an unknown abstract type is encountered.


Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium