Class StandardRegistry
java.lang.Object
neqsim.process.mechanicaldesign.designstandards.StandardRegistry
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<StandardType, String> Map of standard type to custom version overrides. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent instantiation. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear all version overrides.static DesignStandardcreateStandard(StandardType standardType, String version, MechanicalDesign equipment) Create a DesignStandard instance for the given standard type with a specific version.static DesignStandardcreateStandard(StandardType standardType, MechanicalDesign equipment) Create a DesignStandard instance for the given standard type.static StandardTypefindByCode(String code) Find a standard by its code.Get all available design standard categories.static StandardType[]Get all available standard types.static List<StandardType> getApplicableStandards(String equipmentClassName) Get all standards applicable to a given equipment class name.static StringgetEffectiveVersion(StandardType standardType) Get the effective version for a standard type, considering any overrides.static Map<String, List<StandardType>> getRecommendedStandards(String equipmentClassName) Get recommended standards for an equipment type organized by category.static List<StandardType> getStandardsByCategory(String category) Get all standards for a specific design category.static List<StandardType> getStandardsByOrganization(String organization) Get all standards from a specific organization.static StringGet a summary of available standards as a formatted string.static booleanisApplicable(StandardType standardType, String equipmentClassName) Check if a standard type is applicable to an equipment type.static voidsetVersionOverride(StandardType standardType, String version) Set a version override for a standard type.
-
Field Details
-
versionOverrides
Map of standard type to custom version overrides.
-
-
Constructor Details
-
StandardRegistry
private StandardRegistry()Private constructor to prevent instantiation.
-
-
Method Details
-
createStandard
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 typeequipment- 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 typeversion- 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
Get the effective version for a standard type, considering any overrides.- Parameters:
standardType- the standard type- Returns:
- the effective version string
-
setVersionOverride
Set a version override for a standard type.- Parameters:
standardType- the standard type to overrideversion- the version to use (null to clear override)
-
clearVersionOverrides
public static void clearVersionOverrides()Clear all version overrides. -
getApplicableStandards
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
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
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
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
-
getAllStandards
Get all available standard types.- Returns:
- array of all StandardType values
-
isApplicable
Check if a standard type is applicable to an equipment type.- Parameters:
standardType- the standard type to checkequipmentClassName- the equipment class name- Returns:
- true if the standard applies to the equipment
-
getRecommendedStandards
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
Get a summary of available standards as a formatted string.- Returns:
- formatted string listing all standards by organization
-