• 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

72.73
/api/src/main/java/de/learnlib/api/query/AbstractQuery.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
public abstract class AbstractQuery<I, D> extends Query<I, D> {
21

22
    protected final Word<I> prefix;
23
    protected final Word<I> suffix;
24

25
    public AbstractQuery(Word<I> queryWord) {
26
        this(Word.epsilon(), queryWord);
1✔
27
    }
1✔
28

29
    public AbstractQuery(Word<I> prefix, Word<I> suffix) {
1✔
30
        this.prefix = prefix;
1✔
31
        this.suffix = suffix;
1✔
32
    }
1✔
33

34
    public AbstractQuery(Query<I, ?> query) {
35
        this(query.getPrefix(), query.getSuffix());
×
36
    }
×
37

38
    @Override
39
    public Word<I> getPrefix() {
40
        return prefix;
1✔
41
    }
42

43
    @Override
44
    public Word<I> getSuffix() {
45
        return suffix;
1✔
46
    }
47

48
    /**
49
     * Returns the string representation of this query, including a possible answer. This method should be used by
50
     * classes extending {@link AbstractQuery} for their toString method to ensure output consistency.
51
     *
52
     * @return A string of the form {@code "Query[<prefix>|<suffix> / <answer>]"}. If the query has not been answered
53
     * yet, {@code <answer>} will be null.
54
     */
55
    public String toStringWithAnswer(D answer) {
56
        return "Query[" + prefix + '|' + suffix + " / " + answer + ']';
×
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