Class SwitchHelper


  • public final class SwitchHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SwitchHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends Exprent>
      void
      findExprents​(Statement start, java.lang.Class<? extends T> exprClass, java.util.function.Predicate<T> predicate, boolean onlyOneStat, java.util.function.BiConsumer<Statement,​T> consumer)
      Recursively searches one statement for matching exprents.
      static boolean simplifySwitches​(Statement stat, StructMethod mt, RootStatement root)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • SwitchHelper

        public SwitchHelper()
    • Method Detail

      • findExprents

        public static <T extends Exprent> void findExprents​(Statement start,
                                                            java.lang.Class<? extends T> exprClass,
                                                            java.util.function.Predicate<T> predicate,
                                                            boolean onlyOneStat,
                                                            java.util.function.BiConsumer<Statement,​T> consumer)
        Recursively searches one statement for matching exprents.
        Parameters:
        start - the statement to search
        exprClass - the wanted exprent type
        predicate - a predicate for filtering the exprents
        onlyOneStat - if true, will return eagerly after the first matching statement
        consumer - the consumer that receives the exprents and their parent statements