public class EnzymeCommissionNumber extends DomainObject implements Comparable<EnzymeCommissionNumber>
\d+(?:\.\d+(?:\.\d+(?:\.n?\d+){0,1}){0,1}){0,1}
For instance, the first enzyme has the EC 1.1.1.1
.
The first digit is the number of the class the enzyme belongs to.n
.
Instances of this class are immutable.Modifier and Type | Class and Description |
---|---|
static class |
EnzymeCommissionNumber.Type
Type of EC number.
|
Modifier and Type | Field and Description |
---|---|
static char |
PRELIMINARY_PREFIX
The character prefixing the fourth digit in preliminary EC numbers.
|
static EnzymeCommissionNumber |
UNDEF
Constant for an undefined EC which can be used for new enzyme suggestions where the EC number is not known (yet).
|
id
Modifier and Type | Method and Description |
---|---|
int |
compareTo(EnzymeCommissionNumber ec)
Compares this EC number with another one.
|
static EnzymeCommissionNumber |
copy(EnzymeCommissionNumber ecToCopy)
Creates a copy of the given
EnzymeCommissionNumber . |
boolean |
equals(Object obj) |
int |
getEc1()
Returns the enzyme's class number.
|
int |
getEc2()
Returns the enzyme's subclass number.
|
int |
getEc3()
Returns the enzyme's sub-subclass number.
|
int |
getEc4()
Returns the enzyme's number.
|
EnzymeCommissionNumber.Type |
getType()
Returns the type of this EC number.
|
int |
hashCode() |
static boolean |
isPreliminary(String ecString)
Checks lazily if the given EC number is preliminary (according to UniProt
format of preliminary EC numbers, see
PRELIMINARY_PREFIX ). |
static boolean |
isValid(String ecString)
Checks whether a given EC number is valid.
|
String |
toString()
Returns a string representation of this EC number.
|
static EnzymeCommissionNumber |
valueOf(int ec1)
Returns an
EnzymeCommissionNumber instance defined by the given integer. |
static EnzymeCommissionNumber |
valueOf(int ec1,
int ec2)
Returns an
EnzymeCommissionNumber instance defined by the given integers. |
static EnzymeCommissionNumber |
valueOf(int ec1,
int ec2,
int ec3)
Returns an
EnzymeCommissionNumber instance defined by the given integers. |
static EnzymeCommissionNumber |
valueOf(int ec1,
int ec2,
int ec3,
int ec4)
Returns an
EnzymeCommissionNumber instance defined by the given integers. |
static EnzymeCommissionNumber |
valueOf(int ec1,
int ec2,
int ec3,
int ec4,
boolean preliminary)
Constructor allowing preliminary EC numbers.
|
static EnzymeCommissionNumber |
valueOf(String ecString)
Returns an
EnzymeCommissionNumber instance defined by the given string. |
getId
public static final EnzymeCommissionNumber UNDEF
public static final char PRELIMINARY_PREFIX
public static EnzymeCommissionNumber valueOf(int ec1) throws EcException
EnzymeCommissionNumber
instance defined by the given integer.
If this requirement is met the EC number is valid. However, it does not implicitly mean, that
this EC number is a valid number of the official Enzyme List. This has to be checked separately, outside this class.ec1
- The enzyme's class number (must be a pos. integer).EnzymeCommissionNumber
instance.EcException
- if one of the parameters is invalid.public static EnzymeCommissionNumber valueOf(int ec1, int ec2) throws EcException
EnzymeCommissionNumber
instance defined by the given integers.
All parameters have to be positive integers. A parameter can only be 0 if the succeeding parameter in
the formal parameters list is > 0.
Creating a class by giving 1,0 as parameters is alright, but it is invalid to create an EC number as follows:
0,1.ec1
- The enzyme's class number.ec2
- The enzyme's subclass number.EnzymeCommissionNumber
instance.EcException
- if one of the parameters is invalid.public static EnzymeCommissionNumber valueOf(int ec1, int ec2, int ec3) throws EcException
EnzymeCommissionNumber
instance defined by the given integers.
All parameters have to be positive integers. A parameter can only be 0 if none of the succeeding parameters in
the formal parameters list is > 0.
Creating a class by giving 1,0,0 as parameters is alright, but it is invalid to create an EC number as follows:
0,1,1.ec1
- The enzyme's class number.ec2
- The enzyme's subclass number.ec3
- The enzyme's sub-subclass number.EnzymeCommissionNumber
instance.EcException
- if one of the parameters is invalid.public static EnzymeCommissionNumber valueOf(int ec1, int ec2, int ec3, int ec4) throws EcException
EnzymeCommissionNumber
instance defined by the given integers.
A parameter can only be 0 if none of the succeeding parameters in the formal parameters list is > 0.
Creating a class by giving 1,0,0,0 as parameters is alright, but it is invalid to create an EC number as follows:
0,1,1,1.ec1
- The enzyme's class number.ec2
- The enzyme's subclass number.ec3
- The enzyme's sub-subclass number.ec4
- The enzyme's number.EnzymeCommissionNumber
instance.EcException
- if one of the parameters is invalid.public static EnzymeCommissionNumber valueOf(int ec1, int ec2, int ec3, int ec4, boolean preliminary) throws EcException
ec1
- ec2
- ec3
- ec4
- preliminary
- is this a preliminary EC number?EcException
- if the EC number is not valid.public static EnzymeCommissionNumber valueOf(String ecString) throws EcException, NumberFormatException
EnzymeCommissionNumber
instance defined by the given string.
Calls valueOf(int, int, int, int, boolean)
.ecString
- A string representing an EC number.NullPointerException
- if ecString
is null
.EcException
- if one of the parameters is invalid.NumberFormatException
- if ecString
contained invalid characters.public static EnzymeCommissionNumber copy(EnzymeCommissionNumber ecToCopy)
EnzymeCommissionNumber
.ecToCopy
- The EC to be copied.EnzymeCommissionNumber
.NullPointerException
- if ecToCopy
is null
.public int compareTo(EnzymeCommissionNumber ec)
compareTo
in interface Comparable<EnzymeCommissionNumber>
ec
- The object to be compared to this instance.public EnzymeCommissionNumber.Type getType()
public static boolean isValid(String ecString)
\d+(?:\.\d+(?:\.\d+(?:\.\d+){0,1}){0,1}){0,1}
Examples:ecString
- The EC string to be checked.true
, if the EC is valid.public static boolean isPreliminary(String ecString)
PRELIMINARY_PREFIX
).ecString
- true
if the parameter contains the prefix for
preliminary EC numbers.public String toString()
public int hashCode()
hashCode
in class DomainObject
public boolean equals(Object obj)
equals
in class DomainObject
public int getEc1()
public int getEc2()
public int getEc3()
public int getEc4()
Copyright © 2014 EMBL-EBI. All rights reserved.