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
- 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 TypeMethodDescriptionbooleanReturns the occurrence value.intAccess the dependant Rgroup number if R1 then R2.intGet the Rgroup number, for example R1 => 1.Access the list of possible RGroups.inthashCode()booleanisRestH()Indicates that sites labeled with this Rgroup may only be substituted with a member of the Rgroup or with hydrogen.static booleanValidates the occurrence value.matchOccurence(int maxAttachments) Matches the 'occurrence' condition with a provided maximum number of RGroup attachments.voidsetOccurrence(String occurrence) Picky setter for occurrence fields.voidsetRequiredRGroupNumber(int rGroupNumberImplicated) voidsetRestH(boolean restH) voidsetRGroupNumber(int rGroupNumber) Setter for rGroupNumber, checks for valid range.voidsetRGroups(List<IRGroup> rGroups)
-
Field Details
-
DEFAULT_OCCURRENCE
-
-
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 0 to 32 *, labels position of Rgroup on root."- Parameters:
rGroupNumber- R-Group number
-
getRGroupNumber
public int getRGroupNumber()Description copied from interface:IRGroupListGet the Rgroup number, for example R1 => 1.- Specified by:
getRGroupNumberin interfaceIRGroupList- Returns:
- the Rgroup number
-
setRestH
public void setRestH(boolean restH) -
isRestH
public boolean isRestH()Description copied from interface:IRGroupListIndicates that sites labeled with this Rgroup may only be substituted with a member of the Rgroup or with hydrogen.- Specified by:
isRestHin interfaceIRGroupList
-
setRequiredRGroupNumber
public void setRequiredRGroupNumber(int rGroupNumberImplicated) -
getRequiredRGroupNumber
public int getRequiredRGroupNumber()Description copied from interface:IRGroupListAccess the dependant Rgroup number if R1 then R2.- Specified by:
getRequiredRGroupNumberin interfaceIRGroupList- Returns:
- the required Rgroup number.
-
setRGroups
-
getRGroups
Description copied from interface:IRGroupListAccess the list of possible RGroups.- Specified by:
getRGroupsin interfaceIRGroupList- Returns:
- the rgroups.
-
getOccurrence
Returns the occurrence value.- Specified by:
getOccurrencein 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:
matchOccurencein interfaceIRGroupList- Parameters:
maxAttachments- number of attachments- Returns:
- valid values by combining a max for R# with the occurrence cond.
-
equals
-
hashCode
-