Class ReferenceDesignation

java.lang.Object
neqsim.process.equipment.iec81346.ReferenceDesignation
All Implemented Interfaces:
Serializable

public class ReferenceDesignation extends Object implements Serializable
Represents an IEC 81346 reference designation for a process element.

IEC 81346 defines three orthogonal aspects for identifying objects in industrial plants:

  • Function aspect (prefix =): What the system does (e.g. =K1 for cooling function 1)
  • Product aspect (prefix -): What the physical equipment is (e.g. -B1 for heat exchanger 1)
  • Location aspect (prefix +): Where the equipment is installed (e.g. +R1.L2 for room 1, level 2)

This class stores the three aspects independently and composes the full reference designation string on demand. It also stores the IEC 81346-2 letter code that classifies the equipment.

Examples of composed reference designations:

  • =A1.K1-B1+P1.M1 — Separation function, heat exchanger 1, platform module 1
  • =A1.K2-K1+P1.M2 — Compression function, compressor 1, platform module 2
  • =A1.K1-S1+P1.M1 — Separation function, sensor 1, platform module 1
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • functionDesignation

      private String functionDesignation
      The function aspect designation without prefix (e.g. "A1.K1").
    • productDesignation

      private String productDesignation
      The product aspect designation without prefix (e.g. "B1").
    • locationDesignation

      private String locationDesignation
      The location aspect designation without prefix (e.g. "P1.M1").
    • letterCode

      private IEC81346LetterCode letterCode
      The IEC 81346-2 letter code classifying this equipment.
    • sequenceNumber

      private int sequenceNumber
      The sequence number within the letter code category.
  • Constructor Details

    • ReferenceDesignation

      public ReferenceDesignation()
      Creates an empty reference designation.
    • ReferenceDesignation

      public ReferenceDesignation(String functionDesignation, String productDesignation, String locationDesignation, IEC81346LetterCode letterCode, int sequenceNumber)
      Creates a reference designation with the specified aspects and letter code.
      Parameters:
      functionDesignation - the function aspect (without = prefix), e.g. "A1.K1"
      productDesignation - the product aspect (without - prefix), e.g. "B1"
      locationDesignation - the location aspect (without + prefix), e.g. "P1.M1"
      letterCode - the IEC 81346-2 letter code classifying this equipment
      sequenceNumber - the sequence number within the letter code category (1-based)
  • Method Details

    • parse

      public static ReferenceDesignation parse(String designationString)
      Parses an IEC 81346 reference designation string into its three aspects.

      Accepted formats (order of aspects does not matter):

      • "=A1-B1+P1" — all three aspects
      • "=A1-B1" — function + product
      • "-B1+P1" — product + location
      • "-B1" — product only
      Parameters:
      designationString - the reference designation string to parse
      Returns:
      a new ReferenceDesignation instance, or an empty instance if the input is null or empty
    • findNextAspectStart

      private static int findNextAspectStart(String s, int from)
      Finds the index of the next aspect prefix character (=, -, or +) after the given start position.
      Parameters:
      s - the string to search
      from - the starting index (exclusive of the current prefix)
      Returns:
      the index of the next prefix, or the end of string if none found
    • getFunctionDesignation

      public String getFunctionDesignation()
      Returns the function aspect designation without the = prefix.
      Returns:
      the function designation, e.g. "A1.K1"
    • setFunctionDesignation

      public void setFunctionDesignation(String functionDesignation)
      Sets the function aspect designation.
      Parameters:
      functionDesignation - the function designation without the = prefix
    • getProductDesignation

      public String getProductDesignation()
      Returns the product aspect designation without the - prefix.
      Returns:
      the product designation, e.g. "B1"
    • setProductDesignation

      public void setProductDesignation(String productDesignation)
      Sets the product aspect designation.
      Parameters:
      productDesignation - the product designation without the - prefix
    • getLocationDesignation

      public String getLocationDesignation()
      Returns the location aspect designation without the + prefix.
      Returns:
      the location designation, e.g. "P1.M1"
    • setLocationDesignation

      public void setLocationDesignation(String locationDesignation)
      Sets the location aspect designation.
      Parameters:
      locationDesignation - the location designation without the + prefix
    • getLetterCode

      public IEC81346LetterCode getLetterCode()
      Returns the IEC 81346-2 letter code classifying this equipment.
      Returns:
      the letter code
    • setLetterCode

      public void setLetterCode(IEC81346LetterCode letterCode)
      Sets the IEC 81346-2 letter code classifying this equipment.
      Parameters:
      letterCode - the letter code to set
    • getSequenceNumber

      public int getSequenceNumber()
      Returns the sequence number within the letter code category.
      Returns:
      the sequence number (1-based)
    • setSequenceNumber

      public void setSequenceNumber(int sequenceNumber)
      Sets the sequence number within the letter code category.
      Parameters:
      sequenceNumber - the sequence number (1-based)
    • getFormattedFunctionDesignation

      public String getFormattedFunctionDesignation()
      Returns the full function aspect string including the = prefix.
      Returns:
      the formatted function designation, e.g. "=A1.K1", or empty string if not set
    • getFormattedProductDesignation

      public String getFormattedProductDesignation()
      Returns the full product aspect string including the - prefix.
      Returns:
      the formatted product designation, e.g. "-B1", or empty string if not set
    • getFormattedLocationDesignation

      public String getFormattedLocationDesignation()
      Returns the full location aspect string including the + prefix.
      Returns:
      the formatted location designation, e.g. "+P1.M1", or empty string if not set
    • toReferenceDesignationString

      public String toReferenceDesignationString()
      Composes the full IEC 81346 reference designation from all three aspects.

      The format is: =function-product+location, e.g. =A1.K1-B1+P1.M1. Empty aspects are omitted.

      Returns:
      the full reference designation string, or empty string if no aspects are set
    • getProductCode

      public String getProductCode()
      Returns the product code string composed from the letter code and sequence number.

      Example: for letter code IEC81346LetterCode.B and sequence 3, returns "B3".

      Returns:
      the product code, e.g. "B3"
    • isSet

      public boolean isSet()
      Checks if this reference designation has any aspects set.
      Returns:
      true if at least one aspect (function, product, or location) is non-empty
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object