Class ECIndexNumberValidator
- All Implemented Interfaces:
Serializable
The European Community index number is a unique nine-digit identifier
that is assigned to hazardous chemical substances.
For example, the EC index number of lithium is 003-001-00-4
The Index number for each substance is in the form of a digit sequence of the type
ABC-RST-VW-Y.
ABC corresponds to the atomic number of the most characteristic element
or the most characteristic organic group in the molecule.
RST is the consecutive number of the substance in the series ABC.
VW denotes the form in which the substance is produced or placed on the market.
Y is the check-digit. Check digit calculation is based on modulus 11
with digits being weighted based on their position (from left to right).
For further information see CLP_Regulation - ANNEX VI 1.1.1.1.Index numbers
- Since:
- 1.9.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ECIndexNumberValidatorGets the singleton instance of this validator.booleanTests whether the code is a valid EC index number.Checks the code is valid EC index number.
-
Method Details
-
getInstance
Gets the singleton instance of this validator.- Returns:
- A singleton instance of the EC Index Number validator.
-
isValid
Tests whether the code is a valid EC index number.- Parameters:
code- The code to validate.- Returns:
trueif a EC index number, otherwisefalse.
-
validate
Checks the code is valid EC index number.- Parameters:
code- The code to validate.- Returns:
- An EC index number code with dashes removed if valid, otherwise
null.
-