19package denoptim.graph.rings;
21import java.util.ArrayList;
23import denoptim.graph.Fragment;
24import denoptim.graph.Vertex;
25import denoptim.graph.Vertex.BBType;
39 private ArrayList<ChainLink>
links;
55 this.links =
new ArrayList<ChainLink>();
66 links =
new ArrayList<ChainLink>();
68 String words[] = str.trim().split(
"%");
70 String[] parts = words[0].split(
"_");
71 for (
int i=0; i<parts.length; i++)
73 String clStr = parts[i];
74 String[] clParts = clStr.trim().split(
"/");
75 int molID = Integer.parseInt(clParts[0]);
77 String[] partsAps = clParts[2].split(
"ap");
78 int apLeft = Integer.
parseInt(partsAps[1]);
79 int apRight = Integer.
parseInt(partsAps[2]);
105 this.tuningPoint = tp;
173 int vertIdx = ((
Fragment)vert).getBuildingBlockId();
174 Vertex.BBType vertFrgTyp = ((
Fragment)vert).getBuildingBlockType();
175 for (
int i=0; i<
links.size(); i++)
178 if (cl.
getIdx() == vertIdx &&
208 int vertMolID = ((
Fragment)vert).getBuildingBlockId();
209 Vertex.BBType vertFrgTyp = ((
Fragment)vert).getBuildingBlockType();
210 for (
int i=0; i<
links.size(); i++)
213 if (cl.
getIdx() == vertMolID &&
251 String str =
" ClosableChain[";
Class representing a continuously connected portion of chemical object holding attachment points.
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
ChainLink represents a vertex in a closable chain.
Vertex.BBType getFragType()
ClosableChain represents a chain of fragments (chain links) that is closable (or candidate closable).
ArrayList< ChainLink > links
List of ChainLinks in this chain.
ChainLink getLink(int i)
Get a specific ChainLink
ClosableChain clone()
Returns a deep-copy.
int involvesVertexAndAP(Vertex vert, int apIDA, int apIDB)
Check whether a combination of vertex and attachment points ID is involved in this chain.
int getTurningPointIdx()
Get the vertex ID of the turning point.Note that since the chain is a path in a graph the relative di...
void appendLink(ChainLink l)
Append a link to this chain.
void setTurningPoint(int tp)
Defined the turning point in the list of links.
ClosableChain(String str)
Constructs a ClosableChain from the string representation.
int involvesVertex(Vertex vert)
Check whether a given vertex is involved in this chain.
ClosableChain()
Constructs an empty ClosableChain.
ArrayList< ChainLink > getLinks()
Get the list of ChainLinks.
int getSize()
Get length of chain.
int tuningPoint
The position of the scaffold vertex: turning point for the direction of the chain.
The type of building block.
static BBType parseInt(int i)
Translates the integer into the enum.