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

LearnLib / learnlib / 6673301747

27 Oct 2023 11:46PM UTC coverage: 91.986% (-1.3%) from 93.327%
6673301747

push

github

mtf90
merge the release and sign-artifacts profiles

10984 of 11941 relevant lines covered (91.99%)

1.72 hits per line

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

76.47
/api/src/main/java/de/learnlib/api/query/DefaultQuery.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of LearnLib, http://www.learnlib.de/.
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 de.learnlib.api.query;
17

18
import net.automatalib.word.Word;
19

20
/**
21
 * A query is a container for tests a learning algorithms performs, containing the actual test and the corresponding
22
 * result.
23
 *
24
 * @param <I>
25
 *         input symbol type
26
 * @param <D>
27
 *         output domain type
28
 */
29
public class DefaultQuery<I, D> extends AbstractQuery<I, D> {
30

31
    private D output;
32

33
    public DefaultQuery(Word<I> prefix, Word<I> suffix, D output) {
34
        this(prefix, suffix);
1✔
35
        this.output = output;
1✔
36
    }
1✔
37

38
    public DefaultQuery(Word<I> prefix, Word<I> suffix) {
39
        super(prefix, suffix);
1✔
40
    }
1✔
41

42
    public DefaultQuery(Word<I> input) {
43
        super(input);
1✔
44
    }
1✔
45

46
    public DefaultQuery(Word<I> input, D output) {
47
        super(input);
1✔
48
        this.output = output;
1✔
49
    }
1✔
50

51
    public DefaultQuery(Query<I, ?> query) {
52
        super(query);
×
53
    }
×
54

55
    public D getOutput() {
56
        return output;
1✔
57
    }
58

59
    /**
60
     * Checks if the query is normalized, i.e., if all the information is stored in the {@link #getSuffix() suffix} part
61
     * of the counterexample.
62
     *
63
     * @return {@code true} if the counterexample is normalized, {@code false} otherwise.
64
     */
65
    public boolean isNormalized() {
66
        return prefix.isEmpty();
×
67
    }
68

69
    @Override
70
    public void answer(D output) {
71
        this.output = output;
1✔
72
    }
1✔
73

74
    /**
75
     * @see AbstractQuery#toStringWithAnswer(Object)
76
     */
77
    @Override
78
    public String toString() {
79
        return toStringWithAnswer(output);
×
80
    }
81

82
}
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