All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.structurizr.view.SequenceNumber Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
package com.structurizr.view;

class SequenceNumber {

    private SequenceCounter counter = new SequenceCounter();

    SequenceNumber() {
    }

    String getNext() {
        counter.increment();
        return counter.toString();
    }

    void startParallelSequence() {
        this.counter = new ParallelSequenceCounter(this.counter);
    }

    void endParallelSequence(boolean endAllParallelSequencesAndContinueNumbering) {
        if (endAllParallelSequencesAndContinueNumbering) {
            int sequence = this.counter.getSequence();
            this.counter = this.counter.getParent();
            this.counter.setSequence(sequence);
        } else {
            this.counter = this.counter.getParent();
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy