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

LearnLib / learnlib / 6433387082

06 Oct 2023 03:10PM UTC coverage: 92.296% (-0.007%) from 92.303%
6433387082

push

github

mtf90
update Falk's developer id

11573 of 12539 relevant lines covered (92.3%)

1.67 hits per line

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

92.86
/algorithms/active/kearns-vazirani/src/main/java/de/learnlib/algorithms/kv/StateInfo.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.algorithms.kv;
17

18
import java.util.ArrayList;
19
import java.util.Collections;
20
import java.util.List;
21

22
import de.learnlib.datastructure.discriminationtree.model.AbstractWordBasedDTNode;
23
import net.automatalib.words.Word;
24
import org.checkerframework.checker.nullness.qual.Nullable;
25

26
/**
27
 * The information associated with a state: it's access sequence (or access string), and the list of incoming
28
 * transitions.
29
 *
30
 * @param <I>
31
 *         input symbol type
32
 * @param <D>
33
 *         data type
34
 */
35
public final class StateInfo<I, D> {
36

37
    public final int id;
38
    public final Word<I> accessSequence;
39
    public AbstractWordBasedDTNode<I, D, StateInfo<I, D>> dtNode;
40
    //private TLongList incoming;
41
    private @Nullable List<Long> incoming; // TODO: replace with primitive specialization
42

43
    public StateInfo(int id, Word<I> accessSequence) {
2✔
44
        this.accessSequence = accessSequence.trimmed();
2✔
45
        this.id = id;
2✔
46
    }
2✔
47

48
    public void addIncoming(int sourceState, int transIdx) {
49
        long encodedTrans = ((long) sourceState << Integer.SIZE) | transIdx;
2✔
50
        if (incoming == null) {
2✔
51
            //incoming = new TLongArrayList();
52
            incoming = new ArrayList<>(); // TODO: replace with primitive specialization
2✔
53
        }
54
        incoming.add(encodedTrans);
2✔
55
    }
2✔
56

57
    //public TLongList fetchIncoming() {
58
    public List<Long> fetchIncoming() { // TODO: replace with primitive specialization
59
        if (incoming == null || incoming.isEmpty()) {
2✔
60
            //return EMPTY_LONG_LIST;
61
            return Collections.emptyList(); // TODO: replace with primitive specialization
×
62
        }
63
        //TLongList result = incoming;
64
        List<Long> result = incoming;
2✔
65
        this.incoming = null;
2✔
66
        return result;
2✔
67
    }
68
}
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