Class RGroupList
java.lang.Object
org.openscience.cdk.isomorphism.matchers.RGroupList
- All Implemented Interfaces:
IRGroupList
Represents a list of Rgroup substitutes to be associated with some
RGroupQuery
.- Author:
- Mark Rijnbeek
- Source code:
- main
- Belongs to CDK module:
- isomorphism
- Keywords:
- Rgroup, R group, R-group
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRGroupList
(int rGroupNumber) Default constructor.RGroupList
(int rGroupNumber, boolean restH, String occurrence, int requiredRGroupNumber) Constructor with attributes given. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the occurrence value.int
Access the dependant Rgroup number if R1 then R2.int
Get the Rgroup number, for example R1 => 1.Access the list of possible RGroups.int
hashCode()
boolean
isRestH()
Indicates that sites labeled with this Rgroup may only be substituted with a member of the Rgroup or with hydrogen.static boolean
Validates the occurrence value.matchOccurence
(int maxAttachments) Matches the 'occurrence' condition with a provided maximum number of RGroup attachments.void
setOccurrence
(String occurrence) Picky setter for occurrence fields.void
setRequiredRGroupNumber
(int rGroupNumberImplicated) void
setRestH
(boolean restH) void
setRGroupNumber
(int rGroupNumber) Setter for rGroupNumber, checks for valid range.void
setRGroups
(List<IRGroup> rGroups)
-
Field Details
-
DEFAULT_OCCURRENCE
Default value for occurrence field.- See Also:
-
-
Constructor Details
-
RGroupList
public RGroupList(int rGroupNumber) Default constructor. -
RGroupList
public RGroupList(int rGroupNumber, boolean restH, String occurrence, int requiredRGroupNumber) throws CDKException Constructor with attributes given.- Parameters:
rGroupNumber
- R-Group numberrestH
- restHoccurrence
- occurrencerequiredRGroupNumber
- number of other R-Group required- Throws:
CDKException
-
-
Method Details
-
setRGroupNumber
public void setRGroupNumber(int rGroupNumber) Setter for rGroupNumber, checks for valid range. Spec: "value from 1 to 32 *, labels position of Rgroup on root."- Parameters:
rGroupNumber
- R-Group number
-
getRGroupNumber
public int getRGroupNumber()Description copied from interface:IRGroupList
Get the Rgroup number, for example R1 => 1.- Specified by:
getRGroupNumber
in interfaceIRGroupList
- Returns:
- the Rgroup number
-
setRestH
public void setRestH(boolean restH) -
isRestH
public boolean isRestH()Description copied from interface:IRGroupList
Indicates that sites labeled with this Rgroup may only be substituted with a member of the Rgroup or with hydrogen.- Specified by:
isRestH
in interfaceIRGroupList
-
setRequiredRGroupNumber
public void setRequiredRGroupNumber(int rGroupNumberImplicated) -
getRequiredRGroupNumber
public int getRequiredRGroupNumber()Description copied from interface:IRGroupList
Access the dependant Rgroup number if R1 then R2.- Specified by:
getRequiredRGroupNumber
in interfaceIRGroupList
- Returns:
- the required Rgroup number.
-
setRGroups
-
getRGroups
Description copied from interface:IRGroupList
Access the list of possible RGroups.- Specified by:
getRGroups
in interfaceIRGroupList
- Returns:
- the rgroups.
-
getOccurrence
Returns the occurrence value.- Specified by:
getOccurrence
in interfaceIRGroupList
- Returns:
- occurrence
-
setOccurrence
Picky setter for occurrence fields. Validates user input to be conform the (Symyx) specification.- Parameters:
occurrence
- occurence value- Throws:
CDKException
-
isValidOccurrenceSyntax
Validates the occurrence value.- n : exactly n ;
- n - m : n through m ;
- > n : greater than n ;
- < n : fewer than n ;
- default (blank) is > 0 ;
- Parameters:
occ
- String to validate.- Returns:
- true if valid String provided.
-
matchOccurence
Matches the 'occurrence' condition with a provided maximum number of RGroup attachments. Returns the valid occurrences (numeric) for these two combined. If none found, returns empty list.
Example: if R1 occurs 3 times attached to some root structure, then stating ">5" as an occurrence for that RGoupList does not make sense: the example R1 can occur 0..3 times. Empty would be returned.
If the occurence would be >2, then 3 would be returned. Etcetera.- Specified by:
matchOccurence
in interfaceIRGroupList
- Parameters:
maxAttachments
- number of attachments- Returns:
- valid values by combining a max for R# with the occurrence cond.
-
equals
-
hashCode
public int hashCode()
-