Class StandardRegistry

java.lang.Object
neqsim.process.mechanicaldesign.designstandards.StandardRegistry

public final class StandardRegistry extends Object
Registry and factory for creating design standards based on international standards.

The StandardRegistry provides:

  • Factory methods to create DesignStandard instances from StandardType enum
  • Standard discovery and lookup capabilities
  • Standard version management
  • Mapping between international standards and NeqSim design standard classes

Example usage:

// Get a pressure vessel standard
DesignStandard pvStandard =
    StandardRegistry.createStandard(StandardType.ASME_VIII_DIV1, mechanicalDesign);

// Find all applicable standards for a separator
List<StandardType> sepStandards = StandardRegistry.getApplicableStandards("Separator");

// Get all NORSOK standards
List<StandardType> norsokStandards = StandardRegistry.getStandardsByOrganization("NORSOK");
Version:
1.0
Author:
esol
  • Field Details

    • versionOverrides

      private static final Map<StandardType, String> versionOverrides
      Map of standard type to custom version overrides.
  • Constructor Details

    • StandardRegistry

      private StandardRegistry()
      Private constructor to prevent instantiation.
  • Method Details

    • createStandard

      public static DesignStandard createStandard(StandardType standardType, MechanicalDesign equipment)
      Create a DesignStandard instance for the given standard type.

      This factory method creates the appropriate DesignStandard subclass based on the standard type's category. The standard name is set to the standard code.

      Parameters:
      standardType - the international standard type
      equipment - the mechanical design equipment context
      Returns:
      a new DesignStandard instance
      Throws:
      IllegalArgumentException - if standardType is null
    • createStandard

      public static DesignStandard createStandard(StandardType standardType, String version, MechanicalDesign equipment)
      Create a DesignStandard instance for the given standard type with a specific version.
      Parameters:
      standardType - the international standard type
      version - the specific version to use (null for default)
      equipment - the mechanical design equipment context
      Returns:
      a new DesignStandard instance
      Throws:
      IllegalArgumentException - if standardType is null
    • getEffectiveVersion

      public static String getEffectiveVersion(StandardType standardType)
      Get the effective version for a standard type, considering any overrides.
      Parameters:
      standardType - the standard type
      Returns:
      the effective version string
    • setVersionOverride

      public static void setVersionOverride(StandardType standardType, String version)
      Set a version override for a standard type.
      Parameters:
      standardType - the standard type to override
      version - the version to use (null to clear override)
    • clearVersionOverrides

      public static void clearVersionOverrides()
      Clear all version overrides.
    • getApplicableStandards

      public static List<StandardType> getApplicableStandards(String equipmentClassName)
      Get all standards applicable to a given equipment class name.
      Parameters:
      equipmentClassName - the simple class name of the equipment (e.g., "Separator")
      Returns:
      list of applicable standards
    • getStandardsByOrganization

      public static List<StandardType> getStandardsByOrganization(String organization)
      Get all standards from a specific organization.
      Parameters:
      organization - the organization code (e.g., "NORSOK", "ASME", "API", "DNV", "ISO", "ASTM")
      Returns:
      list of standards from that organization
    • getStandardsByCategory

      public static List<StandardType> getStandardsByCategory(String category)
      Get all standards for a specific design category.
      Parameters:
      category - the design standard category (e.g., "pressure vessel design code")
      Returns:
      list of standards in that category
    • findByCode

      public static StandardType findByCode(String code)
      Find a standard by its code.
      Parameters:
      code - the standard code (e.g., "ASME-VIII-Div1", "NORSOK-L-001")
      Returns:
      the matching StandardType or null if not found
    • getAllCategories

      public static List<String> getAllCategories()
      Get all available design standard categories.
      Returns:
      list of category keys
    • getAllStandards

      public static StandardType[] getAllStandards()
      Get all available standard types.
      Returns:
      array of all StandardType values
    • isApplicable

      public static boolean isApplicable(StandardType standardType, String equipmentClassName)
      Check if a standard type is applicable to an equipment type.
      Parameters:
      standardType - the standard type to check
      equipmentClassName - the equipment class name
      Returns:
      true if the standard applies to the equipment
    • getRecommendedStandards

      public static Map<String, List<StandardType>> getRecommendedStandards(String equipmentClassName)
      Get recommended standards for an equipment type organized by category.
      Parameters:
      equipmentClassName - the equipment class name
      Returns:
      map of category to list of applicable standards
    • getSummary

      public static String getSummary()
      Get a summary of available standards as a formatted string.
      Returns:
      formatted string listing all standards by organization