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

LearnLib / automatalib / 6673214172

27 Oct 2023 11:30PM UTC coverage: 89.166% (-0.6%) from 89.796%
6673214172

push

github

mtf90
cleanup release configuration

15399 of 17270 relevant lines covered (89.17%)

1.67 hits per line

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

0.0
/adapters/brics/src/main/java/net/automatalib/brics/BricsTransitionProperty.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of AutomataLib, http://www.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.brics;
17

18
import dk.brics.automaton.Transition;
19
import org.checkerframework.checker.nullness.qual.Nullable;
20

21
/**
22
 * The properties of an edge in a Brics automaton.
23
 */
24
public class BricsTransitionProperty {
25

26
    private final char min;
27
    private final char max;
28

29
    /**
30
     * Constructor. Constructs the property from a Brics {@link Transition}.
31
     *
32
     * @param trans
33
     *         the Brics transition object
34
     */
35
    public BricsTransitionProperty(Transition trans) {
36
        this(trans.getMin(), trans.getMax());
×
37
    }
×
38

39
    /**
40
     * Constructor.
41
     *
42
     * @param min
43
     *         lower bound of the character range.
44
     * @param max
45
     *         upper bound of the character range.
46
     */
47
    public BricsTransitionProperty(char min, char max) {
×
48
        this.min = min;
×
49
        this.max = max;
×
50
    }
×
51

52
    /**
53
     * Retrieves the lower bound of the character range.
54
     *
55
     * @return the lower bound of the character range
56
     *
57
     * @see Transition#getMin()
58
     */
59
    public char getMin() {
60
        return min;
×
61
    }
62

63
    /**
64
     * Retrieves the upper bound of the character range.
65
     *
66
     * @return the upper bound of the character range
67
     *
68
     * @see Transition#getMax()
69
     */
70
    public char getMax() {
71
        return max;
×
72
    }
73

74
    @Override
75
    public String toString() {
76
        return toString(min, max);
×
77
    }
78

79
    public static String toString(char min, char max) {
80
        StringBuilder sb = new StringBuilder();
×
81
        sb.append('\'').append(min).append('\'');
×
82
        if (max > min) {
×
83
            sb.append("..'").append(max).append('\'');
×
84
        }
85
        return sb.toString();
×
86
    }
87

88
    @Override
89
    public final boolean equals(@Nullable Object o) {
90
        if (this == o) {
×
91
            return true;
×
92
        }
93
        if (!(o instanceof BricsTransitionProperty)) {
×
94
            return false;
×
95
        }
96

97
        final BricsTransitionProperty that = (BricsTransitionProperty) o;
×
98
        return min == that.min && max == that.max;
×
99
    }
100

101
    @Override
102
    public final int hashCode() {
103
        int result = 1;
×
104
        result = 31 * result + Character.hashCode(min);
×
105
        result = 31 * result + Character.hashCode(max);
×
106
        return result;
×
107
    }
108
}
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

© 2026 Coveralls, Inc