Skip to content

Commit 74286cf

Browse files
committed
Added SWE Common Quality interface
1 parent 84e414b commit 74286cf

6 files changed

Lines changed: 44 additions & 10 deletions

File tree

Plugins/CoreModelV2/src/main/java/de/fraunhofer/iosb/ilt/frostserver/plugin/coremodelv2/swecommon/simple/AbstractSimpleComponent.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,35 @@
3131
public abstract class AbstractSimpleComponent<T extends AbstractSimpleComponent<T, V>, V> extends AbstractDataComponent<T, V> {
3232

3333
/**
34-
* Axis ID
34+
* Axis ID.
3535
*
3636
* A string that uniquely identifies one of the reference frame’s axes along
3737
* which the coordinate value is given.
3838
*/
3939
private String axisID;
4040

4141
/**
42-
* Reference Frame
42+
* Reference Frame.
4343
*
4444
* The reference frame relative to which the coordinate value is given.
4545
* Commonly an EPSG identifier.
4646
*/
4747
private String referenceFrame;
4848

4949
/**
50-
* NilValues
50+
* NilValues.
5151
*
52-
* a list (i.e. one or more) of NIL values.
52+
* A list (one or more) of NIL values.
5353
*/
5454
private List<NillValue> nilValues;
5555

56-
// TODO
57-
private Object quality;
56+
/**
57+
* Quality.
58+
*
59+
* 8.2.15. Quality Union. A union of the Quantity, QuantityRange, Category
60+
* and Text classes.
61+
*/
62+
private Quality quality;
5863

5964
public String getReferenceFrame() {
6065
return referenceFrame;

Plugins/CoreModelV2/src/main/java/de/fraunhofer/iosb/ilt/frostserver/plugin/coremodelv2/swecommon/simple/Category.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/**
2828
* SWE Category class.
2929
*/
30-
public class Category extends AbstractSimpleComponent<Category, String> {
30+
public class Category extends AbstractSimpleComponent<Category, String> implements Quality<Category, String> {
3131

3232
private static final Logger LOGGER = LoggerFactory.getLogger(Category.class.getName());
3333

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2024 Fraunhofer Institut IOSB, Fraunhoferstr. 1, D 76131
3+
* Karlsruhe, Germany.
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Lesser General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Lesser General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Lesser General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
package de.fraunhofer.iosb.ilt.frostserver.plugin.coremodelv2.swecommon.simple;
19+
20+
/**
21+
* 8.2.15. Quality Union. A union of the Quantity, QuantityRange, Category and
22+
* Text classes.
23+
*
24+
* @param <T> The type of the extending class.
25+
* @param <V> The type of the Value field.
26+
*/
27+
public interface Quality<T extends AbstractSimpleComponent<T, V>, V> {
28+
// Only for inheritance.
29+
}

Plugins/CoreModelV2/src/main/java/de/fraunhofer/iosb/ilt/frostserver/plugin/coremodelv2/swecommon/simple/Quantity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* SWE Quantity class.
3030
*/
31-
public class Quantity extends AbstractSimpleComponent<Quantity, Number> {
31+
public class Quantity extends AbstractSimpleComponent<Quantity, Number> implements Quality<Quantity, Number> {
3232

3333
private static final Logger LOGGER = LoggerFactory.getLogger(Quantity.class.getName());
3434

Plugins/CoreModelV2/src/main/java/de/fraunhofer/iosb/ilt/frostserver/plugin/coremodelv2/swecommon/simple/QuantityRange.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* SWE Class QuantityRange.
3030
*/
31-
public class QuantityRange extends AbstractRange<QuantityRange, BigDecimal> {
31+
public class QuantityRange extends AbstractRange<QuantityRange, BigDecimal> implements Quality<QuantityRange, List<BigDecimal>> {
3232

3333
/**
3434
* The logger for this class.

Plugins/CoreModelV2/src/main/java/de/fraunhofer/iosb/ilt/frostserver/plugin/coremodelv2/swecommon/simple/Text.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* SWE Text class.
2828
*/
29-
public class Text extends AbstractSimpleComponent<Text, String> {
29+
public class Text extends AbstractSimpleComponent<Text, String> implements Quality<Text, String> {
3030

3131
private static final Logger LOGGER = LoggerFactory.getLogger(Text.class.getName());
3232

0 commit comments

Comments
 (0)