Interface DiscreteMeasurement
-
public interface DiscreteMeasurement
A measurement with a discrete value (string, boolean or int) such as: tap position, switch position and so on. Can have properties in addition of explicit fields to add precisions about the measurement if necessary.- Author:
- Miora Ralambotiana
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DiscreteMeasurement.TapChanger
If it is the modelization of a tap position (or any discrete measurement on a tap changer), can explicit which tap changer of the transformer it is applied on.static class
DiscreteMeasurement.Type
Specify what is measured.static class
DiscreteMeasurement.ValueType
Explicit what type of discrete value is used for this measurement (boolean, int or string).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getId()
Get ID of the measurement if it exists.String
getProperty(String name)
Return property value associated to the given property name if it exists, else return null.Set<String>
getPropertyNames()
Get all the property names with values applied to this measurement.DiscreteMeasurement.TapChanger
getTapChanger()
Get the tap changer the measurement is applied on if necessary (seeDiscreteMeasurement.TapChanger
).DiscreteMeasurement.Type
getType()
Get the type of the measurement (specify what it is measured, seeDiscreteMeasurement.Type
).boolean
getValueAsBoolean()
Get value as boolean if the type of measured discrete value is BOOLEAN (seeDiscreteMeasurement.ValueType
).int
getValueAsInt()
Get value as int if the type of measured discrete value is INT (seeDiscreteMeasurement.ValueType
).String
getValueAsString()
Get value as String if the type of measured discrete value is STRING (seeDiscreteMeasurement.ValueType
).DiscreteMeasurement.ValueType
getValueType()
Get the type of measured discrete value (int, boolean or string, seeDiscreteMeasurement.ValueType
).boolean
isValid()
Get validity status of the measurement.DiscreteMeasurement
putProperty(String name, String property)
Put a given property value associated with a given property name.void
remove()
Remove the measurement from the equipment.DiscreteMeasurement
removeProperty(String name)
Remove the property value associated with the given property name if it exists.DiscreteMeasurement
setValid(boolean valid)
Set validity status of the measurement.DiscreteMeasurement
setValue(boolean value)
Set the discrete measured value and set the value type as BOOLEAN (seeDiscreteMeasurement.ValueType
).DiscreteMeasurement
setValue(int value)
Set the discrete measured value and set the value type as INT (seeDiscreteMeasurement.ValueType
).DiscreteMeasurement
setValue(String value)
Set the discrete measured value and set the value type as STRING (seeDiscreteMeasurement.ValueType
).
-
-
-
Method Detail
-
getId
String getId()
Get ID of the measurement if it exists. It is optional (can be null).
-
getType
DiscreteMeasurement.Type getType()
Get the type of the measurement (specify what it is measured, seeDiscreteMeasurement.Type
).
-
getTapChanger
DiscreteMeasurement.TapChanger getTapChanger()
Get the tap changer the measurement is applied on if necessary (seeDiscreteMeasurement.TapChanger
). Must be null if the measurement is not applied to a tap changer. Throw an exception if the extended equipment is not a transformer. Must be not null if the measurement is not applied to a tap changer, else throw an exception.
-
getPropertyNames
Set<String> getPropertyNames()
Get all the property names with values applied to this measurement.
-
getProperty
String getProperty(String name)
Return property value associated to the given property name if it exists, else return null.
-
putProperty
DiscreteMeasurement putProperty(String name, String property)
Put a given property value associated with a given property name.
-
removeProperty
DiscreteMeasurement removeProperty(String name)
Remove the property value associated with the given property name if it exists. Else, do nothing.
-
getValueType
DiscreteMeasurement.ValueType getValueType()
Get the type of measured discrete value (int, boolean or string, seeDiscreteMeasurement.ValueType
).
-
getValueAsString
String getValueAsString()
Get value as String if the type of measured discrete value is STRING (seeDiscreteMeasurement.ValueType
). Else throw an exception.
-
getValueAsInt
int getValueAsInt()
Get value as int if the type of measured discrete value is INT (seeDiscreteMeasurement.ValueType
). Else throw an exception.
-
getValueAsBoolean
boolean getValueAsBoolean()
Get value as boolean if the type of measured discrete value is BOOLEAN (seeDiscreteMeasurement.ValueType
). Else throw an exception.
-
setValue
DiscreteMeasurement setValue(String value)
Set the discrete measured value and set the value type as STRING (seeDiscreteMeasurement.ValueType
). Can not be null if the measurement is valid.
-
setValue
DiscreteMeasurement setValue(int value)
Set the discrete measured value and set the value type as INT (seeDiscreteMeasurement.ValueType
).
-
setValue
DiscreteMeasurement setValue(boolean value)
Set the discrete measured value and set the value type as BOOLEAN (seeDiscreteMeasurement.ValueType
).
-
isValid
boolean isValid()
Get validity status of the measurement. If it is true (i.e. the measurement is valid), the discrete measured value can not be null.
-
setValid
DiscreteMeasurement setValid(boolean valid)
Set validity status of the measurement. If it is true (i.e. the measurement is valid), the discrete measured value can not be null.
-
remove
void remove()
Remove the measurement from the equipment.
-
-