|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.structure.visitor.Visitor
public class Visitor
This self-propelled Visitor knows how to traverse the hierarchy of
data objects contained by a Structure.
The default mode is to visit all Atoms of all Residues (AminoAcids,
Heterogens, and Water) held by a Chain, but not to visit any Regions
(Helices or BetaStrands). Calling clear() will restore this default
mode.
The setMode( RegionMode ) method can be used to change the traversal
mode to visit regions of secondary structure:
RegionMode.LOOPS
RegionMode.HELICES
RegionMode.BETA_STRANDS
RegionMode.ALL_REGIONS
RegionMode.NO_REGIONS.
If the traversal is set to visit any Regions,
setVisitSegments(boolean) will determine whether any Segments
are visited (the default is false).
The setMode( ResidueMode ) method can be used to restrict the
traversal to only certain Residue types:
ResidueMode.ALL
ResidueMode.AMINO_ACIDS
ResidueMode.AA_AND_HETEROGENS,
ResidueMode.AA_AND_WATERS
ResidueMode.HETEROGENS
ResidueMode.WATERS
ResidueMode.HET_AND_WATERS
ResidueMode.NONE
The setMode( AAPortionMode ) method can be used to restrict the
traversal to only a portion of each AminoAcid visited. The
AAPortionMode will have no effect if the ResidueMode is set to
visit only Heterogens and/or Waters.
AAPortionMode.ENTIRE_AA
AAPortionMode.BACKBONE
AAPortionMode.SIDE_CHAIN
AAPortionMode.N
AAPortionMode.CA
AAPortionMode.C
AAPortionMode.O
AAPortionMode.OXT
AAPortionMode.HA_OR_1HA
AAPortionMode.H_OR_HN
The setMode() method will also accept argument of type AminoAcidEnum,
AtomEnum, and String (for an AtomID) to further restrict which Atoms
are visited. The default value for any of these restrictions is null,
and calling clear() will reset all of them to null.
Constructor Summary | |
---|---|
Visitor()
No-arg constuctor sets ResidueMode.ALL, RegionMode.NO_REGIONS, AAPortionMode to ENTIRE_AA, restrictions (AminoAcid type, Atom type, and Atom ID) to null, and debug to false. |
Method Summary | |
---|---|
void |
clear()
Resets Visitor to default of ResidueMode.ALL, RegionMode.NO_REGIONS, AAPortionMode.ENTIRE_AA, and restrictions (AminoAcid type, Atom type, and Atom ID) to null. |
void |
includeAAHetAndWater(boolean includeAminoAcids,
boolean includeHeterogens,
boolean includeWaters)
Sets the mode to include or exclude AminoAcids, Heterogens, and Waters. |
void |
setDebug(boolean debug)
Sets debug to true or false. |
void |
setMode(AAPortionMode aaPortionMode)
Sets the traversal mode with regard to what portion of each AminoAcid should be visited: ENTIRE_AA, BACKBONE, SIDE_CHAIN, N, CA, C, O, or OXT. |
void |
setMode(AminoAcidEnum aminoAcidType)
Restricts the traversal to a particular AminoAcid type (this mode can also be used to restrict which Segments are visited). |
void |
setMode(AtomEnum atomType)
Sets the traversal mode with regard to Atom type. |
void |
setMode(RegionMode regionMode)
Sets the traversal mode with regard to Regions: NO_REGIONS, LOOPS, HELICES, BETA_STRANDS, or ALL_REGIONS. |
void |
setMode(ResidueMode residueMode)
Sets the traversal mode with regard to what kind of Residues should be visited: ALL, AMINO_ACIDS, AA_AND_HETEROGENS, AA_AND_WATERS, HETEROGENS, WATERS, HET_AND_WATERS, or NONE. |
void |
setMode(String atomID)
Restricts the traversal to an atomID (as examples, all alpha carbons have the atomID of "CA", and all carbonyl oxygens have the atomID of "O"). |
void |
setVisitSegments(boolean visitSegments)
Sets a boolean to indicate that Segments should be visited |
void |
visit(AminoAcid aminoAcid)
Traverses all Atoms owned by the AminoAcid if AAPortionMode is set to ENTIRE_AA. |
void |
visit(Atom atom)
Traverses all Bonds owned by the Atom. |
void |
visit(BetaStrand betaStrand)
If debug is true, the betaStrandID, startResidueID, and endResidueID will be printed to standard out. |
void |
visit(Bond bond)
If debug is true, the atomID of both the source Atom and the destination Atom will be printed to standard out. |
void |
visit(Chain chain)
Uses the current ResidueMode to determine if it should traverse the AminoAcids, Heterogens, and/or Waters owned by the Chain. |
void |
visit(Helix helix)
If debug is true, the helixID, startResidueID, and endResidueID will be printed to standard out. |
void |
visit(Heterogen heterogen)
Traverses all Atoms owned by the Heterogen. |
void |
visit(Loop loop)
If debug is true, the loopID will be printed to standard out. |
void |
visit(Model model)
Traverses all Chains owned by the Model. |
void |
visit(Segment segment)
If debug is true, the segmentID will be printed to standard out. |
void |
visit(Structure structure)
Traverses all Models owned by the Structure. |
void |
visit(Water water)
Traverses all Atoms owned by the Water. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Visitor()
Method Detail |
---|
public void clear()
public void setMode(RegionMode regionMode)
regionMode
- the Region(s) to visit.public void setMode(ResidueMode residueMode)
residueMode
- the Residues to visit.public void includeAAHetAndWater(boolean includeAminoAcids, boolean includeHeterogens, boolean includeWaters)
includeAminoAcids
- true if AminoAcids should be visited.includeHeterogens
- true if Heterogens should be visited.includeWaters
- true if Waters should be visited.public void setMode(AAPortionMode aaPortionMode)
aaPortionMode
- the AminoAcid portion to visit.public void setMode(AminoAcidEnum aminoAcidType)
aminoAcidType
- the AminoAcid type as an enum.public void setMode(AtomEnum atomType)
atomType
- the Atom type as an enum.public void setMode(String atomID)
atomID
- the Atom ID as a String.public void setVisitSegments(boolean visitSegments)
visitSegments
- true or false.public void setDebug(boolean debug)
debug
- true or false.public void visit(Structure structure) throws VisitorException
structure
- the Structure to visit.
VisitorException
- if a problem occurs while visiting a
node.public void visit(Model model) throws VisitorException
model
- the Model to visit.
VisitorException
- if a problem occurs while visiting the
Model.public void visit(Chain chain) throws VisitorException
chain
- the Chain to visit.
VisitorException
- if a problem occurs while visiting the
Chain.public void visit(Loop loop) throws VisitorException
loop
- the Loop to visit.
VisitorException
- if a problem occurs while visiting the
Loop.public void visit(Helix helix) throws VisitorException
helix
- the Helix to visit.
VisitorException
- if a problem occurs while visiting the
Helix.public void visit(BetaStrand betaStrand) throws VisitorException
betaStrand
- the BetaStrand to visit.
VisitorException
- if a problem occurs while visiting the
BetaStrand.public void visit(AminoAcid aminoAcid) throws VisitorException
aminoAcid
- the AminoAcid to visit.
VisitorException
- if a problem occurs while visiting the
AminoAcid.public void visit(Heterogen heterogen) throws VisitorException
heterogen
- the Heterogen to visit.
VisitorException
- if a problem occurs while visiting the
Heterogen.public void visit(Water water) throws VisitorException
water
- the Water to visit.
VisitorException
- if a problem occurs while visiting the
Water.public void visit(Atom atom) throws VisitorException
atom
- the Atom to visit.
VisitorException
- if a problem occurs while visiting the
Atom.public void visit(Bond bond) throws VisitorException
bond
- the Bond to visit.
VisitorException
- if a problem occurs while visiting the
Atom.public void visit(Segment segment) throws VisitorException
segment
- the Segment to visit.
VisitorException
- if a problem occurs while visiting the
Segment.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |