net.sourceforge.nrl.parser.model
Class PrimitiveTypeFactory

java.lang.Object
  extended by net.sourceforge.nrl.parser.model.PrimitiveTypeFactory

public class PrimitiveTypeFactory
extends Object

A factory singleton that returns data types corresponding to the internal NRL data types.

Call getInstance() to get a handle on the singleton.

Author:
Christian Nentwich

Method Summary
 List<String> getAllTypeNames()
          Return a list of all built-in type names
 Collection<IDataType> getAllTypes()
           
static PrimitiveTypeFactory getInstance()
           
 NRLDataType getNrlType(String name)
          Return the NRL data type of a built-in type, given its name
 IDataType getType(NRLDataType nrlType)
          Return a data type object corresponding to the given NRL type.
 IDataType getType(String name)
          Return a data type by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PrimitiveTypeFactory getInstance()

getAllTypeNames

public List<String> getAllTypeNames()
Return a list of all built-in type names

Returns:
the type names

getAllTypes

public Collection<IDataType> getAllTypes()

getType

public IDataType getType(NRLDataType nrlType)
Return a data type object corresponding to the given NRL type. The type must be one of: If it is not one of those, null is returned.

Parameters:
nrlType -
Returns:
the type or null

getNrlType

public NRLDataType getNrlType(String name)
Return the NRL data type of a built-in type, given its name

Parameters:
name - the name
Returns:
the data type or NRLDataType.UNKNOWN if not possible

getType

public IDataType getType(String name)
Return a data type by name. This will return a non-null value if the name is one of:

Parameters:
name - the type name
Returns:
the type or null


Copyright © 2006-2013. All Rights Reserved.