Class AsnModule

java.lang.Object
net.aifusion.asn.AsnNode
net.aifusion.asn.AsnModule

public class AsnModule extends AsnNode
Class to represent an ASN.1 Module
Author:
Sharad Singhal
  • Constructor Details

    • AsnModule

      public AsnModule(Token token)
      Create a Module definition
      Parameters:
      token - - token containing the name of the module
  • Method Details

    • getTypes

      public HashMap<String,AsnNode> getTypes()
      get a hashmap containing all know types in this module
      Returns:
      - map containing {typeName, definingAstNode} pairs
    • getValues

      public HashMap<String,AsnNode> getValues()
      Get a hashmap containing all known values in this module
      Returns:
      - map containing {valueName, definingAstNode} pairs
    • getType

      public AsnNode getType(String typeName)
      Get the node where a type is defined
      Parameters:
      typeName - - name of the type
      Returns:
      - node containing type definition. Null if none currently defined
    • getValue

      public AsnNode getValue(String valueName)
      Get the node where a value is defined
      Parameters:
      valueName - - name of the value
      Returns:
      - node containing value definition. Null if none currently defined
    • addType

      public void addType(String typeName, AsnNode typeNode)
      Add a type to known types
      Parameters:
      typeName - - name of the type to be added
      typeNode - - node at which the type is defined
    • addValue

      public void addValue(String valueName, AsnNode valueNode)
      Add a value to known values
      Parameters:
      valueName - - name of the value to be added
      valueNode - - node at which the value is defined
    • hasType

      public boolean hasType(String typeName)
      Check if a given type name is known to this module
      Parameters:
      typeName - - name of the type
      Returns:
      true if the type is known to this module, false otherwise
    • hasValue

      public boolean hasValue(String valueName)
      Check if a given value is known to this module
      Parameters:
      valueName - - name of the value
      Returns:
      - true if the name is known to the module, false otherwise