Class SingleInstruction

  • Direct Known Subclasses:
    FieldAccess, OneVariableInstruction

    public abstract class SingleInstruction
    extends PatternElement
    An abstract PatternElement subclass for pattern elements which must match exactly one instruction and accept any kind of branch. (Subclasses may override acceptBranch() to implement more selective handling of branches.)
    Author:
    David Hovemeyer
    See Also:
    PatternElement
    • Constructor Detail

      • SingleInstruction

        public SingleInstruction()
    • Method Detail

      • acceptBranch

        public boolean acceptBranch​(Edge edge,
                                    org.apache.bcel.generic.InstructionHandle source)
        Description copied from class: PatternElement
        Return whether or not it is acceptable to take the given branch.
        Specified by:
        acceptBranch in class PatternElement
        Parameters:
        edge - the Edge representing the branch
        source - the source instruction of the branch
        Returns:
        true if the Edge is acceptable, false if not
      • minOccur

        public int minOccur()
        Description copied from class: PatternElement
        Return the minimum number of instructions this PatternElement must match in the ByteCodePattern.
        Specified by:
        minOccur in class PatternElement
      • maxOccur

        public int maxOccur()
        Description copied from class: PatternElement
        Return the maximum number of instructions this PatternElement must match in the ByteCodePattern.
        Specified by:
        maxOccur in class PatternElement