private CompoundByteTransition()

in src/main/software/amazon/event/ruler/CompoundByteTransition.java [37:64]


    private CompoundByteTransition(Set<SingleByteTransition> byteTransitions) {
        this.byteTransitions = Collections.unmodifiableSet(byteTransitions);

        Set<ShortcutTransition> shortcutTransitions = new HashSet<>();
        Set<SingleByteTransition> matchableTransitions = new HashSet<>();
        Set<SingleByteTransition> nextByteStates = new HashSet<>();

        this.byteTransitions.forEach(t -> {
            if (t.isShortcutTrans()) {
                shortcutTransitions.add((ShortcutTransition) t);
            }
            if (t.isMatchTrans()) {
                matchableTransitions.add(t);
            }
            ByteState nextByteState = t.getNextByteState();
            if (nextByteState != null) {
                nextByteStates.add(nextByteState);
            }
        });

        this.shortcutTransitions = Collections.unmodifiableSet(shortcutTransitions);
        this.matchableTransitions = Collections.unmodifiableSet(matchableTransitions);
        if (nextByteStates.equals(byteTransitions)) {
            this.transitionForNextByteState = this;
        } else {
            this.transitionForNextByteState = coalesce(nextByteStates);
        }
    }