Class ReferenceDesignation
java.lang.Object
neqsim.process.equipment.iec81346.ReferenceDesignation
- All Implemented Interfaces:
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.=K1for cooling function 1) - Product aspect (prefix
-): What the physical equipment is (e.g.-B1for heat exchanger 1) - Location aspect (prefix
+): Where the equipment is installed (e.g.+R1.L2for 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 Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe function aspect designation without prefix (e.g.private IEC81346LetterCodeThe IEC 81346-2 letter code classifying this equipment.private StringThe location aspect designation without prefix (e.g.private StringThe product aspect designation without prefix (e.g.private intThe sequence number within the letter code category.private static final long -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty reference designation.ReferenceDesignation(String functionDesignation, String productDesignation, String locationDesignation, IEC81346LetterCode letterCode, int sequenceNumber) Creates a reference designation with the specified aspects and letter code. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprivate static intfindNextAspectStart(String s, int from) Finds the index of the next aspect prefix character (=,-, or+) after the given start position.Returns the full function aspect string including the=prefix.Returns the full location aspect string including the+prefix.Returns the full product aspect string including the-prefix.Returns the function aspect designation without the=prefix.Returns the IEC 81346-2 letter code classifying this equipment.Returns the location aspect designation without the+prefix.Returns the product code string composed from the letter code and sequence number.Returns the product aspect designation without the-prefix.intReturns the sequence number within the letter code category.inthashCode()booleanisSet()Checks if this reference designation has any aspects set.static ReferenceDesignationParses an IEC 81346 reference designation string into its three aspects.voidsetFunctionDesignation(String functionDesignation) Sets the function aspect designation.voidsetLetterCode(IEC81346LetterCode letterCode) Sets the IEC 81346-2 letter code classifying this equipment.voidsetLocationDesignation(String locationDesignation) Sets the location aspect designation.voidsetProductDesignation(String productDesignation) Sets the product aspect designation.voidsetSequenceNumber(int sequenceNumber) Sets the sequence number within the letter code category.Composes the full IEC 81346 reference designation from all three aspects.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
functionDesignation
The function aspect designation without prefix (e.g. "A1.K1"). -
productDesignation
The product aspect designation without prefix (e.g. "B1"). -
locationDesignation
The location aspect designation without prefix (e.g. "P1.M1"). -
letterCode
The IEC 81346-2 letter code classifying this equipment. -
sequenceNumber
private int sequenceNumberThe 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 equipmentsequenceNumber- the sequence number within the letter code category (1-based)
-
-
Method Details
-
parse
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
ReferenceDesignationinstance, or an empty instance if the input is null or empty
-
findNextAspectStart
Finds the index of the next aspect prefix character (=,-, or+) after the given start position.- Parameters:
s- the string to searchfrom- the starting index (exclusive of the current prefix)- Returns:
- the index of the next prefix, or the end of string if none found
-
getFunctionDesignation
Returns the function aspect designation without the=prefix.- Returns:
- the function designation, e.g. "A1.K1"
-
setFunctionDesignation
Sets the function aspect designation.- Parameters:
functionDesignation- the function designation without the=prefix
-
getProductDesignation
Returns the product aspect designation without the-prefix.- Returns:
- the product designation, e.g. "B1"
-
setProductDesignation
Sets the product aspect designation.- Parameters:
productDesignation- the product designation without the-prefix
-
getLocationDesignation
Returns the location aspect designation without the+prefix.- Returns:
- the location designation, e.g. "P1.M1"
-
setLocationDesignation
Sets the location aspect designation.- Parameters:
locationDesignation- the location designation without the+prefix
-
getLetterCode
Returns the IEC 81346-2 letter code classifying this equipment.- Returns:
- the letter code
-
setLetterCode
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
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
Returns the full product aspect string including the-prefix.- Returns:
- the formatted product designation, e.g. "-B1", or empty string if not set
-
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
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
Returns the product code string composed from the letter code and sequence number.Example: for letter code
IEC81346LetterCode.Band 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
-
equals
-
hashCode
-