• 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

76.47
/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/IncomingList.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.ttt.base;
17

18
import de.learnlib.datastructure.list.IntrusiveList;
19

20
/**
21
 * The head of the intrusive linked list for storing incoming transitions of a DT node.
22
 *
23
 * @param <I>
24
 *         input symbol type
25
 */
26
public class IncomingList<I, D> extends IntrusiveList<TTTTransition<I, D>> {
2✔
27

28
    public void insertIncoming(TTTTransition<I, D> transition) {
29
        transition.removeFromList();
2✔
30

31
        transition.setNextElement(next);
2✔
32
        transition.prevIncoming = this;
2✔
33
        if (next != null) {
2✔
34
            next.prevIncoming = transition;
2✔
35
        }
36
        this.next = transition;
2✔
37
    }
2✔
38

39
    public void insertAllIncoming(IncomingList<I, D> list) {
40
        insertAllIncoming(list.next);
2✔
41
        list.next = null;
2✔
42
    }
2✔
43

44
    public void insertAllIncoming(TTTTransition<I, D> firstTransition) {
45
        if (firstTransition == null) {
2✔
46
            return;
2✔
47
        }
48
        firstTransition.prevIncoming.setNextElement(null);
2✔
49

50
        if (next == null) {
2✔
51
            next = firstTransition;
2✔
52
            firstTransition.prevIncoming = this;
2✔
53
        } else {
54
            TTTTransition<I, D> oldNext = next;
×
55
            next = firstTransition;
×
56
            firstTransition.prevIncoming = this;
×
57
            TTTTransition<I, D> last = firstTransition;
×
58

59
            while (last.getNextElement() != null) {
×
60
                last = last.getNextElement();
×
61
            }
62

63
            last.setNextElement(oldNext);
×
64
            oldNext.prevIncoming = last;
×
65
        }
66
    }
2✔
67

68
    public TTTTransition<I, D> poll() {
69
        TTTTransition<I, D> result = next;
2✔
70
        if (result != null) {
2✔
71
            this.next = result.getNextElement();
2✔
72
            if (this.next != null) {
2✔
73
                this.next.prevIncoming = this;
2✔
74
            }
75
            result.prevIncoming = null;
2✔
76
            result.setNextElement(null);
2✔
77
        }
78
        return result;
2✔
79
    }
80
}
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