Class RGroupList

  • All Implemented Interfaces:
    IRGroupList

    public class RGroupList
    extends Object
    implements 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 Detail

      • DEFAULT_OCCURRENCE

        public static final String DEFAULT_OCCURRENCE
        Default value for occurrence field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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 number
        restH - restH
        occurrence - occurrence
        requiredRGroupNumber - number of other R-Group required
        Throws:
        CDKException
    • Method Detail

      • 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 interface IRGroupList
        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 interface IRGroupList
      • 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 interface IRGroupList
        Returns:
        the required Rgroup number.
      • setRGroups

        public void setRGroups​(List<IRGroup> rGroups)
      • getOccurrence

        public String getOccurrence()
        Returns the occurrence value.
        Specified by:
        getOccurrence in interface IRGroupList
        Returns:
        occurrence
      • setOccurrence

        public void setOccurrence​(String occurrence)
                           throws CDKException
        Picky setter for occurrence fields. Validates user input to be conform the (Symyx) specification.
        Parameters:
        occurrence - occurence value
        Throws:
        CDKException
      • isValidOccurrenceSyntax

        public static boolean isValidOccurrenceSyntax​(String occ)
        Validates the occurrence value.
        • n : exactly n ;
        • n - m : n through m ;
        • > n : greater than n ;
        • < n : fewer than n ;
        • default (blank) is > 0 ;
        Any combination of the preceding values is also allowed; for example "1, 3-7, 9, >11".
        Parameters:
        occ - String to validate.
        Returns:
        true if valid String provided.
      • matchOccurence

        public List<Integer> matchOccurence​(int maxAttachments)
        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 interface IRGroupList
        Parameters:
        maxAttachments - number of attachments
        Returns:
        valid values by combining a max for R# with the occurrence cond.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object