Class AMADIRPEIConfigReader

java.lang.Object
com.nt.udc.ei.node.amadirpei.configReader.AMADIRPEIConfigReader

public class AMADIRPEIConfigReader extends Object
This class reads the file containing the description of all AMA structures and modules
 Example of a config file :

 STRUCTURE NAME="x0510" CODE=(x0510)
 {
  hexadecimal_identifier                2,
  structure_code                        6,
  call_type_code                        4,
  sensor_type                         4
 }

 MODULE NAME="025" CODE=(025)
 {
  circuit_release_module_code_025       4,
  circuit_release_date          6,
  circuit_release_time          8
 }
 
  • Constructor Details

    • AMADIRPEIConfigReader

      public AMADIRPEIConfigReader(File configFileName) throws Exception
      Constructor of AMAEIConfigReader. It parses the AMA config file and store the information into a table
      Parameters:
      configFileName - file name of the AMA config file
      Throws:
      Exception - if cannot find the AMA reference file or if syntax error in the reference file
  • Method Details

    • getStructOrModName

      public String getStructOrModName(String structOrModCode)
      Get a structure or a module name (this name is used to create a counter variable giving the number of occurrences of a structure or a module in one AMA record)
      Parameters:
      structOrModCode - structure or module code
      Returns:
      structure or a module name or null is the structure/module code doesn't exist
    • getStructOrModFieldsNames

      public Vector getStructOrModFieldsNames(String structOrModCode)
      Get the list of fields names contained in a given structure or module
      Parameters:
      structOrModCode - structure or module code
      Returns:
      list of fields names or null is the structure/module code doesn't exist
    • getStructOrModFieldsLength

      public Vector getStructOrModFieldsLength(String structOrModCode)
      Get the length of each fields for a given structure or module
      Parameters:
      structOrModCode - structure or module code
      Returns:
      list of lengths or null is the structure/module code doesn't exist
    • getStructOrModTotalLength

      public int getStructOrModTotalLength(String structOrModCode)
      Add up the length of each field to get the total length of a structure or a module
      Parameters:
      structOrModCode - structure or module code
      Returns:
      structure or module total length or 0 if the structure/module code doesn't exist
    • getFieldsTypes

      public Vector getFieldsTypes(String structOrModCode)
      Get the list of the fields types for a given structure or module Note : this method shouldn't be used and is kept for future versions
      Parameters:
      structOrModCode - structure or module code
      Returns:
      list of types or null if the structure/module code doesn't exist
    • getAllStructOrModCodes

      public Vector getAllStructOrModCodes()
      Get all the structures and modules codes contained in the configuration file
      Returns:
      all codes
    • getAllStructAndModNames

      public Vector getAllStructAndModNames()
      Get all structures and modules names
      Returns:
      all names
    • toString

      public String toString()
      Returns a String representation of the object for debug purposes : returns all the informations concerning the structures, modules and the fields read from the config file
      Overrides:
      toString in class Object
      Returns:
      string representation