Repository navigation
Expand file tree
/
Copy pathEntityType.java
More file actions
111 lines (95 loc) · 2.53 KB
/
Copy pathEntityType.java
File metadata and controls
111 lines (95 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
* BioJava development code
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. If you do not have a copy,
* see:
*
* http://www.gnu.org/copyleft/lesser.html
*
* Copyright for this code is held jointly by the individual
* authors. These should be listed in @author doc comments.
*
* For more information on the BioJava project and its aims,
* or to join the biojava-l mailing list, visit the home page
* at:
*
* http://www.biojava.org/
*
*/
package org.biojava.nbio.structure;
/**
*
* The type of entity (polymer, non-polymer, water, macrolide)
* as defined in the mmCIF dictionary: <a href="http://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v40.dic/Items/_entity.type.html"></a>
* <p>
* Entities are of four types: polymer, non-polymer, macrolide and water.
* <p>
* Note that the water category includes only water; ordered
* solvent such as sulfate ion or acetone would be described as
* individual non-polymer entities.
* It is not clear what macrolides are, but they appear to be supported since mmCIF 4.0.
*
*
* @author Anthony Bradley
* @author Jose Duarte
*
*/
public enum EntityType {
/**
* Polymeric entities: poly-peptides and nucleotide chains
*/
POLYMER("polymer"),
/**
* Non-polymeric entities: ligands, metal ions, buffer molecules, etc
*/
NONPOLYMER("non-polymer"),
/**
* Water
*/
WATER("water"),
/**
* Macrolide. Supported in mmCIF 4.0 dictionary. Not clear what it refers to.
*/
MACROLIDE("macrolide");
private String entityType;
/**
* @param entType the type of the Entity
*/
private EntityType(String entType) {
this.setEntityType(entType);
}
/**
* Returns the type of the Entity as a String
*
* @return String representation of the entity type.
*/
public String getEntityType() {
return entityType;
}
private void setEntityType(String entityType) {
this.entityType = entityType;
}
/**
* Creates a new EntityType from a String value.
* Returns null if entityType is null or not one of the supported
* standard types.
*
* @param entityType String value , should be one of "polymer","non-polymer","water","macrolide"
* @return an EntityType object
*/
public static EntityType entityTypeFromString(String entityType)
{
if ( entityType == null)
return null;
for(EntityType et : EntityType.values())
{
if(entityType.equals(et.entityType))
{
return et;
}
}
return null;
}
}