• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / automatalib / 13138848026

04 Feb 2025 02:53PM UTC coverage: 92.108% (+2.2%) from 89.877%
13138848026

push

github

mtf90
[maven-release-plugin] prepare release automatalib-0.12.0

16609 of 18032 relevant lines covered (92.11%)

1.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/incremental/src/main/java/net/automatalib/incremental/dfa/AbstractIncrementalDFABuilder.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://automatalib.net>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.automatalib.incremental.dfa;
17

18
import net.automatalib.alphabet.Alphabet;
19
import net.automatalib.automaton.concept.InputAlphabetHolder;
20

21
/**
22
 * Abstract base class for {@link IncrementalDFABuilder}s. This class takes care of holding the input alphabet and its
23
 * size.
24
 *
25
 * @param <I>
26
 *         input symbol class
27
 */
28
public abstract class AbstractIncrementalDFABuilder<I> implements IncrementalDFABuilder<I>, InputAlphabetHolder<I> {
29

30
    protected final Alphabet<I> inputAlphabet;
31
    protected int alphabetSize;
32

33
    /**
34
     * Constructor.
35
     *
36
     * @param inputAlphabet
37
     *         the input alphabet
38
     */
39
    public AbstractIncrementalDFABuilder(Alphabet<I> inputAlphabet) {
2✔
40
        this.inputAlphabet = inputAlphabet;
2✔
41
        this.alphabetSize = inputAlphabet.size();
2✔
42
    }
2✔
43

44
    @Override
45
    public Alphabet<I> getInputAlphabet() {
46
        return inputAlphabet;
×
47
    }
48

49
    @Override
50
    public void addAlphabetSymbol(I symbol) {
51
        if (!this.inputAlphabet.containsSymbol(symbol)) {
2✔
52
            this.inputAlphabet.asGrowingAlphabetOrThrowException().addSymbol(symbol);
2✔
53
        }
54

55
        this.alphabetSize = this.inputAlphabet.size();
2✔
56
    }
2✔
57

58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc