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

LearnLib / automatalib / 13138848026

04 Feb 2025 02:53PM UTC coverage: 92.108% (+2.2%) from 89.877%
13138848026

push

github

mtf90
[maven-release-plugin] prepare release automatalib-0.12.0

16609 of 18032 relevant lines covered (92.11%)

1.7 hits per line

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

33.33
/serialization/dot/src/main/java/net/automatalib/serialization/dot/DOTInputModelDeserializer.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://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.serialization.dot;
17

18
import java.io.ByteArrayInputStream;
19
import java.io.File;
20
import java.io.IOException;
21
import java.io.InputStream;
22
import java.net.URL;
23

24
import net.automatalib.common.util.IOUtil;
25
import net.automatalib.exception.FormatException;
26
import net.automatalib.serialization.InputModelDeserializer;
27
import net.automatalib.ts.simple.SimpleTS;
28

29
/**
30
 * A specialization of the {@link InputModelDeserializer} that returns a {@link DOTInputModelData} object which holds
31
 * additional information about the state labels of the de-serialized automaton.
32
 *
33
 * @param <S>
34
 *         the state type of the de-serialized automaton
35
 * @param <I>
36
 *         the type of input symbols
37
 * @param <M>
38
 *         the type of objects implementing classes can deserialize
39
 */
40
public interface DOTInputModelDeserializer<S, I, M extends SimpleTS<S, I>> extends InputModelDeserializer<I, M> {
41

42
    @Override
43
    DOTInputModelData<S, I, M> readModel(InputStream is) throws IOException, FormatException;
44

45
    @Override
46
    default DOTInputModelData<S, I, M> readModel(URL url) throws IOException, FormatException {
47
        try (InputStream is = IOUtil.asBufferedInputStream(url.openStream())) {
2✔
48
            return readModel(is);
2✔
49
        }
50
    }
51

52
    @Override
53
    default DOTInputModelData<S, I, M> readModel(File f) throws IOException, FormatException {
54
        try (InputStream is = IOUtil.asBufferedInputStream(f)) {
×
55
            return readModel(is);
×
56
        }
57
    }
58

59
    @Override
60
    default DOTInputModelData<S, I, M> readModel(byte[] buf) throws IOException, FormatException {
61
        try (ByteArrayInputStream is = new ByteArrayInputStream(buf)) {
×
62
            return readModel(is);
×
63
        }
64
    }
65
}
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