From 95117bdf8884e62395cb1d87907bcb6f24408f15 Mon Sep 17 00:00:00 2001
From: Robert von Burg
Date: Mon, 24 Mar 2014 15:35:13 +0100
Subject: [PATCH] [Minor] NetBeans didn't play nice... now using tabs, instead
of spaces
---
.../strolch/exception/StrolchException.java | 2 +-
.../strolch/model/AbstractStrolchElement.java | 33 +-
.../model/GroupedParameterizedElement.java | 117 ++--
src/main/java/li/strolch/model/Locator.java | 138 +++--
.../java/li/strolch/model/ModelGenerator.java | 506 +++++++++---------
src/main/java/li/strolch/model/Order.java | 16 +-
.../java/li/strolch/model/ParameterBag.java | 5 +-
.../strolch/model/ParameterizedElement.java | 442 +++++++--------
src/main/java/li/strolch/model/Resource.java | 282 +++++-----
.../li/strolch/model/ResourceVisitor.java | 2 +-
.../java/li/strolch/model/StrolchElement.java | 27 +-
.../li/strolch/model/StrolchRootElement.java | 2 +-
src/main/java/li/strolch/model/Tags.java | 2 +-
.../model/parameter/AbstractParameter.java | 28 +-
.../model/parameter/BooleanParameter.java | 4 +-
.../model/parameter/DateParameter.java | 4 +-
.../model/parameter/FloatParameter.java | 6 +-
.../model/parameter/IntegerParameter.java | 6 +-
.../model/parameter/ListParameter.java | 14 +-
.../model/parameter/LongParameter.java | 6 +-
.../li/strolch/model/parameter/Parameter.java | 29 +-
.../model/parameter/StringListParameter.java | 16 +-
.../model/parameter/StringParameter.java | 8 +-
.../li/strolch/model/query/Navigation.java | 4 +-
.../li/strolch/model/query/NotSelection.java | 3 +-
.../model/query/OrderQueryVisitor.java | 2 +-
.../strolch/model/query/OrderSelection.java | 4 +-
.../model/query/OrderSelectionVisitor.java | 2 +-
.../model/query/ParameterSelection.java | 5 +
.../query/ParameterSelectionVisitor.java | 2 +-
.../java/li/strolch/model/query/Query.java | 3 +-
.../li/strolch/model/query/QueryVisitor.java | 2 +-
.../model/query/ResourceQueryVisitor.java | 2 +-
.../li/strolch/model/query/Selection.java | 1 -
.../strolch/model/query/StateSelection.java | 2 +-
.../model/query/StrolchTypeNavigation.java | 2 +-
.../timedstate/AbstractStrolchTimedState.java | 146 ++---
.../model/timedstate/BooleanTimedState.java | 90 ++--
.../model/timedstate/FloatTimedState.java | 90 ++--
.../strolch/model/timedstate/ITimedState.java | 12 +-
.../model/timedstate/IntegerTimedState.java | 90 ++--
.../model/timedstate/StringSetTimedState.java | 120 ++---
.../model/timedstate/StrolchTimedState.java | 2 +-
.../strolch/model/timevalue/ITimeValue.java | 7 +-
.../model/timevalue/ITimeVariable.java | 32 +-
.../li/strolch/model/timevalue/IValue.java | 14 +-
.../strolch/model/timevalue/IValueChange.java | 8 +-
.../strolch/model/timevalue/impl/AString.java | 27 +-
.../model/timevalue/impl/BooleanValue.java | 17 +-
.../model/timevalue/impl/FloatValue.java | 22 +-
.../model/timevalue/impl/IntegerValue.java | 17 +-
.../model/timevalue/impl/StringSetValue.java | 136 ++---
.../model/timevalue/impl/TimeValue.java | 21 +-
.../model/timevalue/impl/TimeVariable.java | 3 +-
.../model/timevalue/impl/ValueChange.java | 21 +-
.../StrolchElementDeepEqualsVisitor.java | 256 ++++-----
.../strolch/model/visitor/StrolchVisitor.java | 2 +-
.../model/xml/AbstractToSaxWriterVisitor.java | 20 +-
.../xml/SimpleStrolchElementListener.java | 6 +-
.../model/xml/StrolchElementListener.java | 2 +-
.../model/xml/StrolchElementToDomVisitor.java | 12 +-
.../model/xml/XmlModelSaxFileReader.java | 39 +-
.../strolch/model/xml/XmlModelSaxReader.java | 218 ++++----
src/test/java/li/strolch/model/ModelTest.java | 174 +++---
.../model/XmlModelDefaultHandlerTest.java | 2 +-
.../java/li/strolch/model/XmlToDomTest.java | 52 +-
.../timedstate/StrolchTimedStateTest.java | 114 ++--
.../timevalue/FloatTimeVariableTest.java | 12 +-
.../timevalue/IntegerTimeVariableTest.java | 2 +-
69 files changed, 1770 insertions(+), 1745 deletions(-)
diff --git a/src/main/java/li/strolch/exception/StrolchException.java b/src/main/java/li/strolch/exception/StrolchException.java
index cb5114bf7..67c43b706 100644
--- a/src/main/java/li/strolch/exception/StrolchException.java
+++ b/src/main/java/li/strolch/exception/StrolchException.java
@@ -17,7 +17,7 @@ package li.strolch.exception;
/**
* @author Robert von Burg
- *
+ *
*/
public class StrolchException extends RuntimeException {
diff --git a/src/main/java/li/strolch/model/AbstractStrolchElement.java b/src/main/java/li/strolch/model/AbstractStrolchElement.java
index a2d4c000a..e554331ea 100644
--- a/src/main/java/li/strolch/model/AbstractStrolchElement.java
+++ b/src/main/java/li/strolch/model/AbstractStrolchElement.java
@@ -44,11 +44,9 @@ public abstract class AbstractStrolchElement implements StrolchElement {
/**
* Default constructor
- *
- * @param id
- * id of this {@link StrolchElement}
- * @param name
- * name of this {@link StrolchElement}
+ *
+ * @param id id of this {@link StrolchElement}
+ * @param name name of this {@link StrolchElement}
*/
public AbstractStrolchElement(String id, String name) {
setId(id);
@@ -98,15 +96,15 @@ public abstract class AbstractStrolchElement implements StrolchElement {
/**
* Used to build a {@link Locator} for this {@link StrolchElement}. It must be implemented by the concrete
* implemented as parents must first add their {@link Locator} information
- *
- * @param locatorBuilder
- * the {@link LocatorBuilder} to which the {@link StrolchElement} must add its locator information
+ *
+ * @param locatorBuilder the {@link LocatorBuilder} to which the {@link StrolchElement} must add its locator
+ * information
*/
protected abstract void fillLocator(LocatorBuilder locatorBuilder);
/**
* fills the {@link StrolchElement} clone with the id, name and type
- *
+ *
* @param clone
*/
protected void fillClone(StrolchElement clone) {
@@ -122,7 +120,7 @@ public abstract class AbstractStrolchElement implements StrolchElement {
/**
* Builds the fields of this {@link StrolchElement} from a {@link Element}
- *
+ *
* @param element
*/
protected void fromDom(Element element) {
@@ -149,18 +147,23 @@ public abstract class AbstractStrolchElement implements StrolchElement {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
AbstractStrolchElement other = (AbstractStrolchElement) obj;
if (this.id == null) {
- if (other.id != null)
+ if (other.id != null) {
return false;
- } else if (!this.id.equals(other.id))
+ }
+ } else if (!this.id.equals(other.id)) {
return false;
+ }
return true;
}
diff --git a/src/main/java/li/strolch/model/GroupedParameterizedElement.java b/src/main/java/li/strolch/model/GroupedParameterizedElement.java
index 16e7f04d6..aef6552fd 100644
--- a/src/main/java/li/strolch/model/GroupedParameterizedElement.java
+++ b/src/main/java/li/strolch/model/GroupedParameterizedElement.java
@@ -49,7 +49,7 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
/**
* Default Constructor
- *
+ *
* @param id
* @param name
* @param type
@@ -66,9 +66,8 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
/**
* Sets the type of this {@link GroupedParameterizedElement}
- *
- * @param type
- * the type to set
+ *
+ * @param type the type to set
*/
public void setType(String type) {
if (StringHelper.isEmpty(type)) {
@@ -83,38 +82,36 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
/**
* Returns the {@link Parameter} with the given key from the {@link ParameterBag} with the given bagKey, or null if
* the {@link Parameter} or the {@link ParameterBag} does not exist
- *
- * @param bagKey
- * the key of the {@link ParameterBag} from which the {@link Parameter} is to be returned
- * @param paramKey
- * the key of the {@link Parameter} which is to be returned
- *
+ *
+ * @param bagKey the key of the {@link ParameterBag} from which the {@link Parameter} is to be returned
+ * @param paramKey the key of the {@link Parameter} which is to be returned
+ *
* @return the found {@link Parameter} or null if it was not found
*/
public T getParameter(String bagKey, String paramKey) {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
return null;
+ }
ParameterBag bag = this.parameterBagMap.get(bagKey);
- if (bag == null)
+ if (bag == null) {
return null;
+ }
return bag.getParameter(paramKey);
}
/**
* Adds a new {@link Parameter} to the {@link ParameterBag} with the given key
- *
- * @param bagKey
- * the key of the {@link ParameterBag} to which the {@link Parameter} should be added
- * @param parameter
- * the {@link Parameter} to be added to the {@link ParameterBag}
- *
- * @throws StrolchException
- * if the {@link ParameterBag} does not exist
+ *
+ * @param bagKey the key of the {@link ParameterBag} to which the {@link Parameter} should be added
+ * @param parameter the {@link Parameter} to be added to the {@link ParameterBag}
+ *
+ * @throws StrolchException if the {@link ParameterBag} does not exist
*/
public void addParameter(String bagKey, Parameter> parameter) throws StrolchException {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
this.parameterBagMap = new HashMap();
+ }
ParameterBag bag = this.parameterBagMap.get(bagKey);
if (bag == null) {
String msg = "No parameter bag exists with key {0}"; //$NON-NLS-1$
@@ -127,68 +124,68 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
/**
* Removes the {@link Parameter} with the given paramKey from the {@link ParameterBag} with the given bagKey
- *
- * @param bagKey
- * the key of the {@link ParameterBag} from which the {@link Parameter} is to be removed
- * @param paramKey
- * the key of the {@link Parameter} which is to be removed
- *
+ *
+ * @param bagKey the key of the {@link ParameterBag} from which the {@link Parameter} is to be removed
+ * @param paramKey the key of the {@link Parameter} which is to be removed
+ *
* @return the removed {@link Parameter} or null if it did not exist
*/
public Parameter removeParameter(String bagKey, String paramKey) {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
return null;
+ }
ParameterBag bag = this.parameterBagMap.get(bagKey);
- if (bag == null)
+ if (bag == null) {
return null;
+ }
return bag.removeParameter(paramKey);
}
/**
* Returns the {@link ParameterBag} with the given key, or null if it does not exist
- *
- * @param key
- * the key of the {@link ParameterBag} to return
- *
+ *
+ * @param key the key of the {@link ParameterBag} to return
+ *
* @return the {@link ParameterBag} with the given key, or null if it does not exist
*/
public ParameterBag getParameterBag(String key) {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
return null;
+ }
return this.parameterBagMap.get(key);
}
/**
* Adds the given {@link ParameterBag} to this {@link GroupedParameterizedElement}
- *
- * @param bag
- * the {@link ParameterBag} to add
+ *
+ * @param bag the {@link ParameterBag} to add
*/
public void addParameterBag(ParameterBag bag) {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
this.parameterBagMap = new HashMap();
+ }
this.parameterBagMap.put(bag.getId(), bag);
bag.setParent(this);
}
/**
* Removes the {@link ParameterBag} with the given key
- *
- * @param key
- * the key of the {@link ParameterBag} to remove
- *
+ *
+ * @param key the key of the {@link ParameterBag} to remove
+ *
* @return the removed {@link ParameterBag}, or null if it does not exist
*/
public ParameterBag removeParameterBag(String key) {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
return null;
+ }
return this.parameterBagMap.remove(key);
}
/**
* Returns true if this {@link GroupedParameterizedElement} has any {@link ParameterBag ParameterBag}
- *
+ *
* @return true if this {@link GroupedParameterizedElement} has any {@link ParameterBag ParameterBag}
*/
public boolean hasParameterBags() {
@@ -197,9 +194,8 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
/**
* Returns true if the {@link ParameterBag} with the given key exists on this {@link GroupedParameterizedElement}.
- *
- * @param bagKey
- * the key of the {@link ParameterBag} which is to be checked for existence
+ *
+ * @param bagKey the key of the {@link ParameterBag} which is to be checked for existence
* @return true if the {@link ParameterBag} with the given key exists on this {@link GroupedParameterizedElement}.
*/
public boolean hasParameterBag(String bagKey) {
@@ -209,34 +205,35 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
/**
* Returns true if the {@link Parameter} with the given paramKey exists on the {@link ParameterBag} with the given
* bagKey
- *
- * @param bagKey
- * the key of the {@link ParameterBag} on which to find the {@link Parameter}
- * @param paramKey
- * the key of the {@link Parameter} to be found
- *
+ *
+ * @param bagKey the key of the {@link ParameterBag} on which to find the {@link Parameter}
+ * @param paramKey the key of the {@link Parameter} to be found
+ *
* @return true if the {@link Parameter} with the given paramKey exists on the {@link ParameterBag} with the given
- * bagKey. False is returned if the {@link ParameterBag} does not exist, or the {@link Parameter} does not
- * exist on the {@link ParameterBag}
+ * bagKey. False is returned if the {@link ParameterBag} does not exist, or the {@link Parameter} does not exist on
+ * the {@link ParameterBag}
*/
public boolean hasParameter(String bagKey, String paramKey) {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
return false;
+ }
ParameterBag bag = this.parameterBagMap.get(bagKey);
- if (bag == null)
+ if (bag == null) {
return false;
+ }
return bag.hasParameter(paramKey);
}
/**
* Returns the {@link Set} of keys for the {@link ParameterBag}s on this {@link GroupedParameterizedElement}
- *
+ *
* @return the {@link Set} of keys for the {@link ParameterBag}s on this {@link GroupedParameterizedElement}
*/
public Set getParameterBagKeySet() {
- if (this.parameterBagMap == null)
+ if (this.parameterBagMap == null) {
return Collections.emptySet();
+ }
return new HashSet(this.parameterBagMap.keySet());
}
@@ -268,7 +265,7 @@ public abstract class GroupedParameterizedElement extends AbstractStrolchElement
/**
* Fills {@link GroupedParameterizedElement} properties of this clone
- *
+ *
* @param clone
*/
protected void fillClone(GroupedParameterizedElement clone) {
diff --git a/src/main/java/li/strolch/model/Locator.java b/src/main/java/li/strolch/model/Locator.java
index 9e4a5e3e9..186bc6c0f 100644
--- a/src/main/java/li/strolch/model/Locator.java
+++ b/src/main/java/li/strolch/model/Locator.java
@@ -30,16 +30,16 @@ import ch.eitchnet.utils.helper.StringHelper;
* consists of a {@link List} of Strings which starting from the first value, defining the root, with the last item
* defining the objects id.
*
- *
+ *
*
* When the {@link Locator} is formatted to a String, it resembles the same format as is used in Unix based files
* systems, with slashes (/), separating the different list values
*
- *
+ *
*
* A {@link Locator} is always immutable, modifications return a new instance
*
- *
+ *
* @author Robert von Burg
*/
public class Locator {
@@ -56,27 +56,24 @@ public class Locator {
/**
* Constructs a new {@link Locator} with the given list of path elements
- *
- * @param pathElements
- * the elements making up the {@link Locator}
- *
- * @throws StrolchException
- * if the path is invalid, meaning has less than two elements in it
+ *
+ * @param pathElements the elements making up the {@link Locator}
+ *
+ * @throws StrolchException if the path is invalid, meaning has less than two elements in it
*/
public Locator(List pathElements) throws StrolchException {
- if (pathElements == null || pathElements.isEmpty())
+ if (pathElements == null || pathElements.isEmpty()) {
throw new StrolchException("The path elements may not be null and must contain at least 1 item"); //$NON-NLS-1$
+ }
this.pathElements = Collections.unmodifiableList(new ArrayList(pathElements));
}
/**
* Constructs a new {@link Locator} by parsing the given string path.
- *
- * @param path
- * the path to parse for instantiate this {@link Locator} with elements
- *
- * @throws StrolchException
- * if the path is invalid, meaning has less than two elements in it
+ *
+ * @param path the path to parse for instantiate this {@link Locator} with elements
+ *
+ * @throws StrolchException if the path is invalid, meaning has less than two elements in it
*/
public Locator(String path) throws StrolchException {
this.pathElements = Collections.unmodifiableList(parsePath(path));
@@ -84,11 +81,9 @@ public class Locator {
/**
* Internal constructor to append a sub path to a constructor
- *
- * @param path
- * the base path of the locator
- * @param subPath
- * the additional path
+ *
+ * @param path the base path of the locator
+ * @param subPath the additional path
*/
private Locator(List path, List subPath) {
List fullPath = new ArrayList();
@@ -99,11 +94,9 @@ public class Locator {
/**
* Internal constructor to append a element to a constructor
- *
- * @param path
- * the base path of the locator
- * @param element
- * the additional element
+ *
+ * @param path the base path of the locator
+ * @param element the additional element
*/
private Locator(List path, String element) {
List fullPath = new ArrayList();
@@ -114,7 +107,7 @@ public class Locator {
/**
* Returns the immutable list of path elements making up this locator
- *
+ *
* @return the pathElements
*/
public List getPathElements() {
@@ -123,7 +116,7 @@ public class Locator {
/**
* Returns the number of elements which this {@link Locator} contains
- *
+ *
* @return the number of elements which this {@link Locator} contains
*/
public int getSize() {
@@ -132,10 +125,9 @@ public class Locator {
/**
* Returns a new {@link Locator} where the given sub path is appended to the locator
- *
- * @param subPathElements
- * the sub path to append
- *
+ *
+ * @param subPathElements the sub path to append
+ *
* @return the new locator
*/
public Locator append(List subPathElements) {
@@ -144,10 +136,9 @@ public class Locator {
/**
* Returns a new {@link Locator} where the given element is appended to the locator
- *
- * @param element
- * the element to append
- *
+ *
+ * @param element the element to append
+ *
* @return the new locator
*/
public Locator append(String element) {
@@ -165,33 +156,30 @@ public class Locator {
/**
* Parses the given path to a {@link List} of path elements by splitting the string with the {@link #PATH_SEPARATOR}
- *
- * @param path
- * the path to parse
- *
+ *
+ * @param path the path to parse
+ *
* @return the list of path elements for the list
- *
- * @throws StrolchException
- * if the path is empty, or does not contain at least 2 elements separated by {@link #PATH_SEPARATOR}
+ *
+ * @throws StrolchException if the path is empty, or does not contain at least 2 elements separated by
+ * {@link #PATH_SEPARATOR}
*/
private List parsePath(String path) throws StrolchException {
- if (StringHelper.isEmpty(path))
+ if (StringHelper.isEmpty(path)) {
throw new StrolchException("A path may not be empty!"); //$NON-NLS-1$
-
+ }
String[] elements = path.split(Locator.PATH_SEPARATOR);
return Arrays.asList(elements);
}
/**
* Formats the given list of path elements to a String representation of the {@link Locator}
- *
- * @param pathElements
- * the locator elements
- *
+ *
+ * @param pathElements the locator elements
+ *
* @return a string representation of the path elements
- *
- * @throws StrolchException
- * if the path elements does not contain at least two items
+ *
+ * @throws StrolchException if the path elements does not contain at least two items
*/
private String formatPath(List pathElements) throws StrolchException {
StringBuilder sb = new StringBuilder();
@@ -200,8 +188,9 @@ public class Locator {
while (iter.hasNext()) {
String element = iter.next();
sb.append(element);
- if (iter.hasNext())
+ if (iter.hasNext()) {
sb.append(Locator.PATH_SEPARATOR);
+ }
}
return sb.toString();
@@ -217,26 +206,30 @@ public class Locator {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
Locator other = (Locator) obj;
if (this.pathElements == null) {
- if (other.pathElements != null)
+ if (other.pathElements != null) {
return false;
- } else if (!this.pathElements.equals(other.pathElements))
+ }
+ } else if (!this.pathElements.equals(other.pathElements)) {
return false;
+ }
return true;
}
/**
* Instantiates a new immutable {@link Locator} instance from the given string
- *
- * @param locatorPath
- * the path from which to instantiate the locator
+ *
+ * @param locatorPath the path from which to instantiate the locator
* @return the immutable {@link Locator} instance
*/
public static Locator valueOf(String locatorPath) {
@@ -245,10 +238,9 @@ public class Locator {
/**
* Creates a new {@link LocatorBuilder} instance and appends the given root element tag to it
- *
- * @param rootElement
- * the first element on the {@link Locator}
- *
+ *
+ * @param rootElement the first element on the {@link Locator}
+ *
* @return a new {@link LocatorBuilder} instance with the given root element tag as the first element
*/
public static LocatorBuilder newBuilder(String rootElement) {
@@ -258,7 +250,7 @@ public class Locator {
/**
* {@link LocatorBuilder} is used to build {@link Locator}s where a deep hierarchy is to be created. The
* {@link #append(String)} method returns itself for chain building
- *
+ *
* @author Robert von Burg
*/
public static class LocatorBuilder {
@@ -274,10 +266,9 @@ public class Locator {
/**
* Append an element to the path
- *
- * @param element
- * the element to add
- *
+ *
+ * @param element the element to add
+ *
* @return this instance for chaining
*/
public LocatorBuilder append(String element) {
@@ -287,7 +278,7 @@ public class Locator {
/**
* Remove the last element from the path
- *
+ *
* @return this instance for chaining
*/
public LocatorBuilder removeLast() {
@@ -297,12 +288,13 @@ public class Locator {
/**
* Creates an immutable {@link Locator} instance with the current elements
- *
+ *
* @return a new {@link Locator} instance
*/
public Locator build() {
- if (this.pathElements.isEmpty())
+ if (this.pathElements.isEmpty()) {
throw new StrolchException("The path elements must contain at least 1 item"); //$NON-NLS-1$
+ }
return new Locator(this.pathElements);
}
}
diff --git a/src/main/java/li/strolch/model/ModelGenerator.java b/src/main/java/li/strolch/model/ModelGenerator.java
index 6808069cd..a7af23bac 100644
--- a/src/main/java/li/strolch/model/ModelGenerator.java
+++ b/src/main/java/li/strolch/model/ModelGenerator.java
@@ -51,298 +51,298 @@ import li.strolch.model.timevalue.impl.ValueChange;
@SuppressWarnings("nls")
public class ModelGenerator {
- public static final String PARAM_BOOLEAN_ID = "@param1";
- public static final String PARAM_BOOLEAN_NAME = "Boolean Param";
+ public static final String PARAM_BOOLEAN_ID = "@param1";
+ public static final String PARAM_BOOLEAN_NAME = "Boolean Param";
- public static final String PARAM_FLOAT_ID = "@param2";
- public static final String PARAM_FLOAT_NAME = "Float Param";
+ public static final String PARAM_FLOAT_ID = "@param2";
+ public static final String PARAM_FLOAT_NAME = "Float Param";
- public static final String PARAM_INTEGER_ID = "@param3";
- public static final String PARAM_INTEGER_NAME = "Integer Param";
+ public static final String PARAM_INTEGER_ID = "@param3";
+ public static final String PARAM_INTEGER_NAME = "Integer Param";
- public static final String PARAM_LONG_ID = "@param4";
- public static final String PARAM_LONG_NAME = "Long Param";
+ public static final String PARAM_LONG_ID = "@param4";
+ public static final String PARAM_LONG_NAME = "Long Param";
- public static final String PARAM_STRING_ID = "@param5";
- public static final String PARAM_STRING_NAME = "String Param";
+ public static final String PARAM_STRING_ID = "@param5";
+ public static final String PARAM_STRING_NAME = "String Param";
- public static final String PARAM_DATE_ID = "@param6";
- public static final String PARAM_DATE_NAME = "Date Param";
+ public static final String PARAM_DATE_ID = "@param6";
+ public static final String PARAM_DATE_NAME = "Date Param";
- public static final String PARAM_LIST_STRING_ID = "@param7";
- public static final String PARAM_LIST_STRING_NAME = "StringList Param";
+ public static final String PARAM_LIST_STRING_ID = "@param7";
+ public static final String PARAM_LIST_STRING_NAME = "StringList Param";
- public static final String STATE_FLOAT_ID = "@state1";
- public static final String STATE_FLOAT_NAME = "Float State";
+ public static final String STATE_FLOAT_ID = "@state1";
+ public static final String STATE_FLOAT_NAME = "Float State";
- public static final String STATE_INTEGER_ID = "@state2";
- public static final String STATE_INTEGER_NAME = "Float State";
+ public static final String STATE_INTEGER_ID = "@state2";
+ public static final String STATE_INTEGER_NAME = "Float State";
- public static final String STATE_STRING_ID = "@state3";
- public static final String STATE_STRING_NAME = "Float State";
+ public static final String STATE_STRING_ID = "@state3";
+ public static final String STATE_STRING_NAME = "Float State";
- public static final String STATE_BOOLEAN_ID = "@state4";
- public static final String STATE_BOOLEAN_NAME = "Float State";
+ public static final String STATE_BOOLEAN_ID = "@state4";
+ public static final String STATE_BOOLEAN_NAME = "Float State";
- public static final long STATE_TIME_0 = 0L;
- public static final long STATE_TIME_10 = 10L;
- public static final long STATE_TIME_20 = 20L;
- public static final long STATE_TIME_30 = 30L;
+ public static final long STATE_TIME_0 = 0L;
+ public static final long STATE_TIME_10 = 10L;
+ public static final long STATE_TIME_20 = 20L;
+ public static final long STATE_TIME_30 = 30L;
- public static final Double STATE_FLOAT_TIME_0 = 0.0D;
- public static final Double STATE_FLOAT_TIME_10 = 10.0D;
- public static final Double STATE_FLOAT_TIME_20 = 20.0D;
- public static final Double STATE_FLOAT_TIME_30 = 30.0D;
+ public static final Double STATE_FLOAT_TIME_0 = 0.0D;
+ public static final Double STATE_FLOAT_TIME_10 = 10.0D;
+ public static final Double STATE_FLOAT_TIME_20 = 20.0D;
+ public static final Double STATE_FLOAT_TIME_30 = 30.0D;
- public static final Integer STATE_INTEGER_TIME_0 = 0;
- public static final Integer STATE_INTEGER_TIME_10 = 10;
- public static final Integer STATE_INTEGER_TIME_20 = 20;
- public static final Integer STATE_INTEGER_TIME_30 = 30;
+ public static final Integer STATE_INTEGER_TIME_0 = 0;
+ public static final Integer STATE_INTEGER_TIME_10 = 10;
+ public static final Integer STATE_INTEGER_TIME_20 = 20;
+ public static final Integer STATE_INTEGER_TIME_30 = 30;
- public static final String STATE_STRING_TIME_0 = "empty";
- public static final String STATE_STRING_TIME_10 = "a";
- public static final String STATE_STRING_TIME_20 = "b";
- public static final String STATE_STRING_TIME_30 = "c";
+ public static final String STATE_STRING_TIME_0 = "empty";
+ public static final String STATE_STRING_TIME_10 = "a";
+ public static final String STATE_STRING_TIME_20 = "b";
+ public static final String STATE_STRING_TIME_30 = "c";
- public static final Boolean STATE_BOOLEAN_TIME_0 = Boolean.FALSE;
- public static final Boolean STATE_BOOLEAN_TIME_10 = Boolean.TRUE;
- public static final Boolean STATE_BOOLEAN_TIME_20 = Boolean.FALSE;
- public static final Boolean STATE_BOOLEAN_TIME_30 = Boolean.TRUE;
+ public static final Boolean STATE_BOOLEAN_TIME_0 = Boolean.FALSE;
+ public static final Boolean STATE_BOOLEAN_TIME_10 = Boolean.TRUE;
+ public static final Boolean STATE_BOOLEAN_TIME_20 = Boolean.FALSE;
+ public static final Boolean STATE_BOOLEAN_TIME_30 = Boolean.TRUE;
- public static final String BAG_ID = "@bag01";
- public static final String BAG_NAME = "Test Bag";
- public static final String BAG_TYPE = "TestBag";
+ public static final String BAG_ID = "@bag01";
+ public static final String BAG_NAME = "Test Bag";
+ public static final String BAG_TYPE = "TestBag";
- /**
- * Creates an {@link Resource} with the given values and adds a {@link ParameterBag} by calling
- * {@link #createParameterBag(String, String, String)}
- *
- * @param id the id of the {@link Resource}
- * @param name the name of the {@link Resource}
- * @param type the type of the {@link Resource}
- *
- * @return the newly created {@link Resource}
- */
- public static Resource createResource(String id, String name, String type) {
- Resource resource = new Resource(id, name, type);
- ParameterBag bag = createParameterBag(BAG_ID, BAG_NAME, BAG_TYPE);
- resource.addParameterBag(bag);
- addTimedStates(resource);
+ /**
+ * Creates an {@link Resource} with the given values and adds a {@link ParameterBag} by calling
+ * {@link #createParameterBag(String, String, String)}
+ *
+ * @param id the id of the {@link Resource}
+ * @param name the name of the {@link Resource}
+ * @param type the type of the {@link Resource}
+ *
+ * @return the newly created {@link Resource}
+ */
+ public static Resource createResource(String id, String name, String type) {
+ Resource resource = new Resource(id, name, type);
+ ParameterBag bag = createParameterBag(BAG_ID, BAG_NAME, BAG_TYPE);
+ resource.addParameterBag(bag);
+ addTimedStates(resource);
- return resource;
- }
+ return resource;
+ }
- /**
- * Creates {@link StrolchTimedState} instances and adds them to the {@link Resource}
- *
- * @param resource the resource to which to addd the newly created {@link StrolchTimedState}
- */
- public static void addTimedStates(Resource resource) {
+ /**
+ * Creates {@link StrolchTimedState} instances and adds them to the {@link Resource}
+ *
+ * @param resource the resource to which to addd the newly created {@link StrolchTimedState}
+ */
+ public static void addTimedStates(Resource resource) {
- // float state
- FloatTimedState floatTimedState = new FloatTimedState(STATE_FLOAT_ID, STATE_FLOAT_NAME);
- floatTimedState.applyChange(new ValueChange<>(STATE_TIME_0, new FloatValue(STATE_FLOAT_TIME_0)));
- FloatValue floatValueChange = new FloatValue(STATE_FLOAT_TIME_10);
- floatTimedState.applyChange(new ValueChange<>(STATE_TIME_10, floatValueChange));
- floatTimedState.applyChange(new ValueChange<>(STATE_TIME_20, floatValueChange));
- floatTimedState.applyChange(new ValueChange<>(STATE_TIME_30, floatValueChange));
- resource.addTimedState(floatTimedState);
+ // float state
+ FloatTimedState floatTimedState = new FloatTimedState(STATE_FLOAT_ID, STATE_FLOAT_NAME);
+ floatTimedState.applyChange(new ValueChange<>(STATE_TIME_0, new FloatValue(STATE_FLOAT_TIME_0)));
+ FloatValue floatValueChange = new FloatValue(STATE_FLOAT_TIME_10);
+ floatTimedState.applyChange(new ValueChange<>(STATE_TIME_10, floatValueChange));
+ floatTimedState.applyChange(new ValueChange<>(STATE_TIME_20, floatValueChange));
+ floatTimedState.applyChange(new ValueChange<>(STATE_TIME_30, floatValueChange));
+ resource.addTimedState(floatTimedState);
- // integer state
- IntegerTimedState integerTimedState = new IntegerTimedState(STATE_INTEGER_ID, STATE_INTEGER_NAME);
- integerTimedState.applyChange(new ValueChange<>(STATE_TIME_0,
- new IntegerValue(STATE_INTEGER_TIME_0)));
- IntegerValue integerValueChange = new IntegerValue(STATE_INTEGER_TIME_10);
- integerTimedState.applyChange(new ValueChange<>(STATE_TIME_10, integerValueChange));
- integerTimedState.applyChange(new ValueChange<>(STATE_TIME_20, integerValueChange));
- integerTimedState.applyChange(new ValueChange<>(STATE_TIME_30, integerValueChange));
- resource.addTimedState(integerTimedState);
+ // integer state
+ IntegerTimedState integerTimedState = new IntegerTimedState(STATE_INTEGER_ID, STATE_INTEGER_NAME);
+ integerTimedState.applyChange(new ValueChange<>(STATE_TIME_0,
+ new IntegerValue(STATE_INTEGER_TIME_0)));
+ IntegerValue integerValueChange = new IntegerValue(STATE_INTEGER_TIME_10);
+ integerTimedState.applyChange(new ValueChange<>(STATE_TIME_10, integerValueChange));
+ integerTimedState.applyChange(new ValueChange<>(STATE_TIME_20, integerValueChange));
+ integerTimedState.applyChange(new ValueChange<>(STATE_TIME_30, integerValueChange));
+ resource.addTimedState(integerTimedState);
- // boolean state
- BooleanTimedState booleanTimedState = new BooleanTimedState(STATE_BOOLEAN_ID, STATE_BOOLEAN_NAME);
- booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_0,
- new BooleanValue(STATE_BOOLEAN_TIME_0)));
- BooleanValue booleanValueChange = new BooleanValue(STATE_BOOLEAN_TIME_10);
- booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_10, booleanValueChange));
- booleanValueChange = booleanValueChange.getInverse();
- booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_20, booleanValueChange));
- booleanValueChange = booleanValueChange.getInverse();
- booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_30, booleanValueChange));
- resource.addTimedState(booleanTimedState);
+ // boolean state
+ BooleanTimedState booleanTimedState = new BooleanTimedState(STATE_BOOLEAN_ID, STATE_BOOLEAN_NAME);
+ booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_0,
+ new BooleanValue(STATE_BOOLEAN_TIME_0)));
+ BooleanValue booleanValueChange = new BooleanValue(STATE_BOOLEAN_TIME_10);
+ booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_10, booleanValueChange));
+ booleanValueChange = booleanValueChange.getInverse();
+ booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_20, booleanValueChange));
+ booleanValueChange = booleanValueChange.getInverse();
+ booleanTimedState.applyChange(new ValueChange<>(STATE_TIME_30, booleanValueChange));
+ resource.addTimedState(booleanTimedState);
- // string state
- StringSetTimedState stringTimedState = new StringSetTimedState(STATE_STRING_ID, STATE_STRING_NAME);
- StringSetValue change = new StringSetValue(asSet(STATE_STRING_TIME_0));
- stringTimedState.applyChange(new ValueChange<>(STATE_TIME_0, change));
- change = change.getInverse();
- change.add(asSet(STATE_STRING_TIME_10));
- stringTimedState.applyChange(new ValueChange<>(STATE_TIME_10, change));
- removeInverted(change.getValue());
- change = change.getInverse();
- change.add(asSet(STATE_STRING_TIME_20));
- stringTimedState.applyChange(new ValueChange<>(STATE_TIME_20, change));
- removeInverted(change.getValue());
- change = change.getInverse();
- change.add(asSet(STATE_STRING_TIME_30));
- stringTimedState.applyChange(new ValueChange<>(STATE_TIME_30, change));
- resource.addTimedState(stringTimedState);
- }
+ // string state
+ StringSetTimedState stringTimedState = new StringSetTimedState(STATE_STRING_ID, STATE_STRING_NAME);
+ StringSetValue change = new StringSetValue(asSet(STATE_STRING_TIME_0));
+ stringTimedState.applyChange(new ValueChange<>(STATE_TIME_0, change));
+ change = change.getInverse();
+ change.add(asSet(STATE_STRING_TIME_10));
+ stringTimedState.applyChange(new ValueChange<>(STATE_TIME_10, change));
+ removeInverted(change.getValue());
+ change = change.getInverse();
+ change.add(asSet(STATE_STRING_TIME_20));
+ stringTimedState.applyChange(new ValueChange<>(STATE_TIME_20, change));
+ removeInverted(change.getValue());
+ change = change.getInverse();
+ change.add(asSet(STATE_STRING_TIME_30));
+ stringTimedState.applyChange(new ValueChange<>(STATE_TIME_30, change));
+ resource.addTimedState(stringTimedState);
+ }
- private static Set asSet(String value) {
- HashSet hashSet = new HashSet<>();
- hashSet.add(new AString(value));
- return hashSet;
- }
+ private static Set asSet(String value) {
+ HashSet hashSet = new HashSet<>();
+ hashSet.add(new AString(value));
+ return hashSet;
+ }
- private static void removeInverted(Set set) {
- for (Iterator iter = set.iterator(); iter.hasNext();) {
- AString aString = iter.next();
- if (aString.isInverse()) {
- iter.remove();
- }
- }
- }
+ private static void removeInverted(Set set) {
+ for (Iterator iter = set.iterator(); iter.hasNext();) {
+ AString aString = iter.next();
+ if (aString.isInverse()) {
+ iter.remove();
+ }
+ }
+ }
- /**
- * Creates a list of {@link Resource Resources} with the given values and adds a {@link ParameterBag} by calling
- * {@link #createParameterBag(String, String, String)}
- *
- * @param idStart id range start
- * @param count the number of elements to create
- * @param idPrefix the prefix to generate IDs for the {@link Resource Resources}
- * @param name the name of the {@link Resource}
- * @param type the type of the {@link Resource}
- *
- * @return the list of newly created {@link Resource Resources}
- */
- public static List createResources(int idStart, int count, String idPrefix, String name, String type) {
- List resources = new ArrayList<>();
- for (int i = 0; i < count; i++) {
- String id = StringHelper.normalizeLength(String.valueOf((i + idStart)), 8, true, '0');
- resources.add(createResource(idPrefix + "_" + id, name + " " + i, type));
- }
- return resources;
- }
+ /**
+ * Creates a list of {@link Resource Resources} with the given values and adds a {@link ParameterBag} by calling
+ * {@link #createParameterBag(String, String, String)}
+ *
+ * @param idStart id range start
+ * @param count the number of elements to create
+ * @param idPrefix the prefix to generate IDs for the {@link Resource Resources}
+ * @param name the name of the {@link Resource}
+ * @param type the type of the {@link Resource}
+ *
+ * @return the list of newly created {@link Resource Resources}
+ */
+ public static List createResources(int idStart, int count, String idPrefix, String name, String type) {
+ List resources = new ArrayList<>();
+ for (int i = 0; i < count; i++) {
+ String id = StringHelper.normalizeLength(String.valueOf((i + idStart)), 8, true, '0');
+ resources.add(createResource(idPrefix + "_" + id, name + " " + i, type));
+ }
+ return resources;
+ }
- /**
- * Creates an {@link Order} with the given values and adds a {@link ParameterBag} by calling
- * {@link #createParameterBag(String, String, String)}
- *
- * @param id the id of the {@link Order}
- * @param name the name of the {@link Order}
- * @param type the type of the {@link Order}
- *
- * @return the newly created {@link Order}
- */
- public static Order createOrder(String id, String name, String type) {
- return createOrder(id, name, type, new Date(), State.CREATED);
- }
+ /**
+ * Creates an {@link Order} with the given values and adds a {@link ParameterBag} by calling
+ * {@link #createParameterBag(String, String, String)}
+ *
+ * @param id the id of the {@link Order}
+ * @param name the name of the {@link Order}
+ * @param type the type of the {@link Order}
+ *
+ * @return the newly created {@link Order}
+ */
+ public static Order createOrder(String id, String name, String type) {
+ return createOrder(id, name, type, new Date(), State.CREATED);
+ }
- /**
- * Creates an {@link Order} with the given values and adds a {@link ParameterBag} by calling
- * {@link #createParameterBag(String, String, String)}
- *
- * @param id the id of the {@link Order}
- * @param name the name of the {@link Order}
- * @param type the type of the {@link Order}
- * @param date the date of the {@link Order}
- * @param state the {@link State} of the {@link Order}
- *
- * @return the newly created {@link Order}
- */
- public static Order createOrder(String id, String name, String type, Date date, State state) {
+ /**
+ * Creates an {@link Order} with the given values and adds a {@link ParameterBag} by calling
+ * {@link #createParameterBag(String, String, String)}
+ *
+ * @param id the id of the {@link Order}
+ * @param name the name of the {@link Order}
+ * @param type the type of the {@link Order}
+ * @param date the date of the {@link Order}
+ * @param state the {@link State} of the {@link Order}
+ *
+ * @return the newly created {@link Order}
+ */
+ public static Order createOrder(String id, String name, String type, Date date, State state) {
- Order order = new Order(id, name, type, date, state);
- ParameterBag bag = createParameterBag(BAG_ID, BAG_NAME, BAG_TYPE);
- order.addParameterBag(bag);
+ Order order = new Order(id, name, type, date, state);
+ ParameterBag bag = createParameterBag(BAG_ID, BAG_NAME, BAG_TYPE);
+ order.addParameterBag(bag);
- return order;
- }
+ return order;
+ }
- /**
- * Creates a list of {@link Order Orders} with the given values and adds a {@link ParameterBag} by calling
- * {@link #createParameterBag(String, String, String)}
- *
- * @param idStart id range start
- * @param count the number of elements to create
- * @param idPrefix the prefix to generate IDs for the {@link Order Orders}
- * @param name the name of the {@link Order}
- * @param type the type of the {@link Order}
- *
- * @return the list of newly created {@link Order Orders}
- */
- public static List createOrders(int idStart, int count, String idPrefix, String name, String type) {
- List orders = new ArrayList<>();
- for (int i = 0; i < count; i++) {
- String id = StringHelper.normalizeLength(String.valueOf((i + idStart)), 8, true, '0');
- orders.add(createOrder(idPrefix + "_" + id, name + " " + i, type));
- }
- return orders;
- }
+ /**
+ * Creates a list of {@link Order Orders} with the given values and adds a {@link ParameterBag} by calling
+ * {@link #createParameterBag(String, String, String)}
+ *
+ * @param idStart id range start
+ * @param count the number of elements to create
+ * @param idPrefix the prefix to generate IDs for the {@link Order Orders}
+ * @param name the name of the {@link Order}
+ * @param type the type of the {@link Order}
+ *
+ * @return the list of newly created {@link Order Orders}
+ */
+ public static List createOrders(int idStart, int count, String idPrefix, String name, String type) {
+ List orders = new ArrayList<>();
+ for (int i = 0; i < count; i++) {
+ String id = StringHelper.normalizeLength(String.valueOf((i + idStart)), 8, true, '0');
+ orders.add(createOrder(idPrefix + "_" + id, name + " " + i, type));
+ }
+ return orders;
+ }
- /**
- * Creates a {@link ParameterBag} with the given values and calls {@link #addAllParameters(ParameterBag)} to add
- * {@link Parameter}s
- *
- * @param id the id of the {@link ParameterBag}
- * @param name the name of the {@link ParameterBag}
- * @param type the type of the {@link ParameterBag}
- *
- * @return the newly created {@link ParameterBag}
- */
- public static ParameterBag createParameterBag(String id, String name, String type) {
+ /**
+ * Creates a {@link ParameterBag} with the given values and calls {@link #addAllParameters(ParameterBag)} to add
+ * {@link Parameter}s
+ *
+ * @param id the id of the {@link ParameterBag}
+ * @param name the name of the {@link ParameterBag}
+ * @param type the type of the {@link ParameterBag}
+ *
+ * @return the newly created {@link ParameterBag}
+ */
+ public static ParameterBag createParameterBag(String id, String name, String type) {
- ParameterBag bag = new ParameterBag(id, name, type);
- addAllParameters(bag);
- return bag;
- }
+ ParameterBag bag = new ParameterBag(id, name, type);
+ addAllParameters(bag);
+ return bag;
+ }
- /**
- * Adds the following {@link Parameter}s to the given {@link ParameterBag}:
- *
- * - BooleanParameter - true
- * - FloatParameter - 44.3
- * - IntegerParameter - 77
- * - LongParameter - 4453234566L
- * - StringParameter - "Strolch"
- * - DateParameter - 1354295525628L
- * - StringListParameter - Hello, World
- *
- *
- * @param bag
- */
- public static void addAllParameters(ParameterBag bag) {
+ /**
+ * Adds the following {@link Parameter}s to the given {@link ParameterBag}:
+ *
+ * - BooleanParameter - true
+ * - FloatParameter - 44.3
+ * - IntegerParameter - 77
+ * - LongParameter - 4453234566L
+ * - StringParameter - "Strolch"
+ * - DateParameter - 1354295525628L
+ * - StringListParameter - Hello, World
+ *
+ *
+ * @param bag
+ */
+ public static void addAllParameters(ParameterBag bag) {
- BooleanParameter boolParam = new BooleanParameter(PARAM_BOOLEAN_ID, PARAM_BOOLEAN_NAME, true);
- boolParam.setIndex(1);
- bag.addParameter(boolParam);
+ BooleanParameter boolParam = new BooleanParameter(PARAM_BOOLEAN_ID, PARAM_BOOLEAN_NAME, true);
+ boolParam.setIndex(1);
+ bag.addParameter(boolParam);
- FloatParameter floatParam = new FloatParameter(PARAM_FLOAT_ID, PARAM_FLOAT_NAME, 44.3);
- floatParam.setIndex(2);
- bag.addParameter(floatParam);
+ FloatParameter floatParam = new FloatParameter(PARAM_FLOAT_ID, PARAM_FLOAT_NAME, 44.3);
+ floatParam.setIndex(2);
+ bag.addParameter(floatParam);
- IntegerParameter integerParam = new IntegerParameter(PARAM_INTEGER_ID, PARAM_INTEGER_NAME, 77);
- integerParam.setIndex(3);
- bag.addParameter(integerParam);
+ IntegerParameter integerParam = new IntegerParameter(PARAM_INTEGER_ID, PARAM_INTEGER_NAME, 77);
+ integerParam.setIndex(3);
+ bag.addParameter(integerParam);
- LongParameter longParam = new LongParameter(PARAM_LONG_ID, PARAM_LONG_NAME, 4453234566L);
- longParam.setIndex(4);
- bag.addParameter(longParam);
+ LongParameter longParam = new LongParameter(PARAM_LONG_ID, PARAM_LONG_NAME, 4453234566L);
+ longParam.setIndex(4);
+ bag.addParameter(longParam);
- StringParameter stringParam = new StringParameter(PARAM_STRING_ID, PARAM_STRING_NAME, "Strolch");
- stringParam.setIndex(5);
- bag.addParameter(stringParam);
+ StringParameter stringParam = new StringParameter(PARAM_STRING_ID, PARAM_STRING_NAME, "Strolch");
+ stringParam.setIndex(5);
+ bag.addParameter(stringParam);
- DateParameter dateParam = new DateParameter(PARAM_DATE_ID, PARAM_DATE_NAME, new Date(1354295525628L));
- dateParam.setIndex(6);
- bag.addParameter(dateParam);
+ DateParameter dateParam = new DateParameter(PARAM_DATE_ID, PARAM_DATE_NAME, new Date(1354295525628L));
+ dateParam.setIndex(6);
+ bag.addParameter(dateParam);
- ArrayList stringList = new ArrayList();
- stringList.add("Hello");
- stringList.add("World");
- StringListParameter stringListP = new StringListParameter(PARAM_LIST_STRING_ID, PARAM_LIST_STRING_NAME,
- stringList);
- stringListP.setIndex(7);
- bag.addParameter(stringListP);
- }
+ ArrayList stringList = new ArrayList();
+ stringList.add("Hello");
+ stringList.add("World");
+ StringListParameter stringListP = new StringListParameter(PARAM_LIST_STRING_ID, PARAM_LIST_STRING_NAME,
+ stringList);
+ stringListP.setIndex(7);
+ bag.addParameter(stringListP);
+ }
}
diff --git a/src/main/java/li/strolch/model/Order.java b/src/main/java/li/strolch/model/Order.java
index 38bf665db..8da752bb3 100644
--- a/src/main/java/li/strolch/model/Order.java
+++ b/src/main/java/li/strolch/model/Order.java
@@ -30,10 +30,10 @@ import ch.eitchnet.utils.iso8601.ISO8601FormatFactory;
* The Order is an object used in the EDF to transfer data from one range to another. Orders are not to be thought of as
* Resources. Resources are supposed to be thought of as things i.e. a table, a machine and so forth, where a order is
* to be thought of as an object for doing something.
- *
+ *
* In this sense, orders do not need to be verified, so all verifier chracteristics are disabled and the
* getVerifier()-method will return the null reference
- *
+ *
* @author Robert von Burg
*/
public class Order extends GroupedParameterizedElement implements StrolchRootElement {
@@ -52,7 +52,7 @@ public class Order extends GroupedParameterizedElement implements StrolchRootEle
/**
* Default Constructor
- *
+ *
* @param id
* @param name
* @param type
@@ -66,7 +66,7 @@ public class Order extends GroupedParameterizedElement implements StrolchRootEle
/**
* Extended Constructor for date and {@link State}
- *
+ *
* @param id
* @param name
* @param type
@@ -82,7 +82,7 @@ public class Order extends GroupedParameterizedElement implements StrolchRootEle
/**
* DOM Constructor
- *
+ *
* @param element
*/
public Order(Element element) {
@@ -112,8 +112,7 @@ public class Order extends GroupedParameterizedElement implements StrolchRootEle
}
/**
- * @param date
- * the date to set
+ * @param date the date to set
*/
public void setDate(Date date) {
this.date = date;
@@ -127,8 +126,7 @@ public class Order extends GroupedParameterizedElement implements StrolchRootEle
}
/**
- * @param state
- * the state to set
+ * @param state the state to set
*/
public void setState(State state) {
this.state = state;
diff --git a/src/main/java/li/strolch/model/ParameterBag.java b/src/main/java/li/strolch/model/ParameterBag.java
index 6c2f53867..bd3fca218 100644
--- a/src/main/java/li/strolch/model/ParameterBag.java
+++ b/src/main/java/li/strolch/model/ParameterBag.java
@@ -22,6 +22,7 @@ import org.w3c.dom.Element;
* @author Robert von Burg
*/
public class ParameterBag extends ParameterizedElement {
+
private static final long serialVersionUID = 1L;
/**
@@ -33,7 +34,7 @@ public class ParameterBag extends ParameterizedElement {
/**
* Default constructor
- *
+ *
* @param id
* @param name
* @param type
@@ -44,7 +45,7 @@ public class ParameterBag extends ParameterizedElement {
/**
* DOM Constructor
- *
+ *
* @param bagElement
*/
public ParameterBag(Element bagElement) {
diff --git a/src/main/java/li/strolch/model/ParameterizedElement.java b/src/main/java/li/strolch/model/ParameterizedElement.java
index 2696399f7..14299ea50 100644
--- a/src/main/java/li/strolch/model/ParameterizedElement.java
+++ b/src/main/java/li/strolch/model/ParameterizedElement.java
@@ -46,255 +46,255 @@ import ch.eitchnet.utils.helper.StringHelper;
*/
public abstract class ParameterizedElement extends AbstractStrolchElement {
- private static final long serialVersionUID = 0L;
+ private static final long serialVersionUID = 0L;
- protected GroupedParameterizedElement parent;
- protected Map> parameterMap;
- protected String type;
+ protected GroupedParameterizedElement parent;
+ protected Map> parameterMap;
+ protected String type;
- /**
- * Empty Constructor
- */
- protected ParameterizedElement() {
- //
- }
+ /**
+ * Empty Constructor
+ */
+ protected ParameterizedElement() {
+ //
+ }
- /**
- * Default Constructor
- *
- * @param id
- * @param name
- * @param type
- */
- public ParameterizedElement(String id, String name, String type) {
- setId(id);
- setName(name);
- setType(type);
- }
+ /**
+ * Default Constructor
+ *
+ * @param id
+ * @param name
+ * @param type
+ */
+ public ParameterizedElement(String id, String name, String type) {
+ setId(id);
+ setName(name);
+ setType(type);
+ }
- @Override
- public String getType() {
- return this.type;
- }
+ @Override
+ public String getType() {
+ return this.type;
+ }
- /**
- * Sets the type of this {@link ParameterizedElement}
- *
- * @param type the type to set
- */
- public void setType(String type) {
- if (StringHelper.isEmpty(type)) {
- String msg = "Type may not be empty on element {0}"; //$NON-NLS-1$
- msg = MessageFormat.format(msg, getLocator());
- throw new StrolchException(msg);
- }
+ /**
+ * Sets the type of this {@link ParameterizedElement}
+ *
+ * @param type the type to set
+ */
+ public void setType(String type) {
+ if (StringHelper.isEmpty(type)) {
+ String msg = "Type may not be empty on element {0}"; //$NON-NLS-1$
+ msg = MessageFormat.format(msg, getLocator());
+ throw new StrolchException(msg);
+ }
- this.type = type;
- }
+ this.type = type;
+ }
- /**
- * Returns the {@link Parameter} with the given id, or null if it does not exist
- *
- * @param key the id of the parameter to return
- *
- * @return the {@link Parameter} with the given id, or null if it does not exist
- */
- @SuppressWarnings("unchecked")
- public T getParameter(String key) {
- if (this.parameterMap == null) {
- return null;
- }
- return (T) this.parameterMap.get(key);
- }
+ /**
+ * Returns the {@link Parameter} with the given id, or null if it does not exist
+ *
+ * @param key the id of the parameter to return
+ *
+ * @return the {@link Parameter} with the given id, or null if it does not exist
+ */
+ @SuppressWarnings("unchecked")
+ public T getParameter(String key) {
+ if (this.parameterMap == null) {
+ return null;
+ }
+ return (T) this.parameterMap.get(key);
+ }
- /**
- * Adds the given {@link Parameter} to the {@link ParameterizedElement}
- *
- * @param parameter the {@link Parameter} to add
- */
- public void addParameter(Parameter> parameter) {
- if (this.parameterMap == null) {
- this.parameterMap = new HashMap>();
- }
- this.parameterMap.put(parameter.getId(), parameter);
- parameter.setParent(this);
- }
+ /**
+ * Adds the given {@link Parameter} to the {@link ParameterizedElement}
+ *
+ * @param parameter the {@link Parameter} to add
+ */
+ public void addParameter(Parameter> parameter) {
+ if (this.parameterMap == null) {
+ this.parameterMap = new HashMap>();
+ }
+ this.parameterMap.put(parameter.getId(), parameter);
+ parameter.setParent(this);
+ }
- /**
- * Removes the {@link Parameter} with the given key
- *
- * @param key the key of the {@link Parameter} to remove
- *
- * @return the removed {@link Parameter}, or null if it does not exist
- */
- @SuppressWarnings("unchecked")
- public Parameter removeParameter(String key) {
- if (this.parameterMap == null) {
- return null;
- }
- return (Parameter) this.parameterMap.remove(key);
- }
+ /**
+ * Removes the {@link Parameter} with the given key
+ *
+ * @param key the key of the {@link Parameter} to remove
+ *
+ * @return the removed {@link Parameter}, or null if it does not exist
+ */
+ @SuppressWarnings("unchecked")
+ public Parameter removeParameter(String key) {
+ if (this.parameterMap == null) {
+ return null;
+ }
+ return (Parameter) this.parameterMap.remove(key);
+ }
- /**
- * Returns a list of all the {@link Parameter}s in this {@link ParameterizedElement}
- *
- * @return a list of all the {@link Parameter}s in this {@link ParameterizedElement}
- */
- public List> getParameters() {
- if (this.parameterMap == null) {
- return Collections.emptyList();
- }
- return new ArrayList>(this.parameterMap.values());
- }
+ /**
+ * Returns a list of all the {@link Parameter}s in this {@link ParameterizedElement}
+ *
+ * @return a list of all the {@link Parameter}s in this {@link ParameterizedElement}
+ */
+ public List> getParameters() {
+ if (this.parameterMap == null) {
+ return Collections.emptyList();
+ }
+ return new ArrayList>(this.parameterMap.values());
+ }
- /**
- * Returns true, if the this {@link ParameterizedElement} has any {@link Parameter Parameters}, false otherwise
- *
- * @return true, if the this {@link ParameterizedElement} has any {@link Parameter Parameters}, false otherwise
- */
- public boolean hasParameters() {
- return this.parameterMap != null && !this.parameterMap.isEmpty();
- }
+ /**
+ * Returns true, if the this {@link ParameterizedElement} has any {@link Parameter Parameters}, false otherwise
+ *
+ * @return true, if the this {@link ParameterizedElement} has any {@link Parameter Parameters}, false otherwise
+ */
+ public boolean hasParameters() {
+ return this.parameterMap != null && !this.parameterMap.isEmpty();
+ }
- /**
- * Returns true, if the {@link Parameter} exists with the given key, false otherwise
- *
- * @param key the key of the {@link Parameter} to check for
- *
- * @return true, if the {@link Parameter} exists with the given key, false otherwise
- */
- public boolean hasParameter(String key) {
- if (this.parameterMap == null) {
- return false;
- }
- return this.parameterMap.containsKey(key);
- }
+ /**
+ * Returns true, if the {@link Parameter} exists with the given key, false otherwise
+ *
+ * @param key the key of the {@link Parameter} to check for
+ *
+ * @return true, if the {@link Parameter} exists with the given key, false otherwise
+ */
+ public boolean hasParameter(String key) {
+ if (this.parameterMap == null) {
+ return false;
+ }
+ return this.parameterMap.containsKey(key);
+ }
- /**
- * Returns a {@link Set} of all the {@link Parameter} keys in this {@link ParameterizedElement}
- *
- * @return a {@link Set} of all the {@link Parameter} keys in this {@link ParameterizedElement}
- */
- public Set getParameterKeySet() {
- if (this.parameterMap == null) {
- return Collections.emptySet();
- }
- return new HashSet(this.parameterMap.keySet());
- }
+ /**
+ * Returns a {@link Set} of all the {@link Parameter} keys in this {@link ParameterizedElement}
+ *
+ * @return a {@link Set} of all the {@link Parameter} keys in this {@link ParameterizedElement}
+ */
+ public Set getParameterKeySet() {
+ if (this.parameterMap == null) {
+ return Collections.emptySet();
+ }
+ return new HashSet(this.parameterMap.keySet());
+ }
- @Override
- public void fillLocator(LocatorBuilder lb) {
- this.parent.fillLocator(lb);
- lb.append(this.id);
- }
+ @Override
+ public void fillLocator(LocatorBuilder lb) {
+ this.parent.fillLocator(lb);
+ lb.append(this.id);
+ }
- @Override
- public Locator getLocator() {
- LocatorBuilder lb = new LocatorBuilder();
- fillLocator(lb);
- return lb.build();
- }
+ @Override
+ public Locator getLocator() {
+ LocatorBuilder lb = new LocatorBuilder();
+ fillLocator(lb);
+ return lb.build();
+ }
- @Override
- protected void fromDom(Element element) {
- super.fromDom(element);
+ @Override
+ protected void fromDom(Element element) {
+ super.fromDom(element);
- String type = element.getAttribute(Tags.TYPE);
- setType(type);
+ String type = element.getAttribute(Tags.TYPE);
+ setType(type);
- // add all the parameters
- NodeList parameterElements = element.getElementsByTagName(Tags.PARAMETER);
- for (int i = 0; i < parameterElements.getLength(); i++) {
- Element paramElement = (Element) parameterElements.item(i);
- String paramtype = paramElement.getAttribute(Tags.TYPE);
+ // add all the parameters
+ NodeList parameterElements = element.getElementsByTagName(Tags.PARAMETER);
+ for (int i = 0; i < parameterElements.getLength(); i++) {
+ Element paramElement = (Element) parameterElements.item(i);
+ String paramtype = paramElement.getAttribute(Tags.TYPE);
- DBC.PRE.assertNotEmpty("Type must be set on Parameter for bag with id " + id, paramtype);
+ DBC.PRE.assertNotEmpty("Type must be set on Parameter for bag with id " + id, paramtype);
- if (paramtype.equals(StringParameter.TYPE)) {
- StringParameter param = new StringParameter(paramElement);
- addParameter(param);
- } else if (paramtype.equals(IntegerParameter.TYPE)) {
- IntegerParameter param = new IntegerParameter(paramElement);
- addParameter(param);
- } else if (paramtype.equals(FloatParameter.TYPE)) {
- FloatParameter param = new FloatParameter(paramElement);
- addParameter(param);
- } else if (paramtype.equals(LongParameter.TYPE)) {
- LongParameter param = new LongParameter(paramElement);
- addParameter(param);
- } else if (paramtype.equals(DateParameter.TYPE)) {
- DateParameter param = new DateParameter(paramElement);
- addParameter(param);
- } else if (paramtype.equals(BooleanParameter.TYPE)) {
- BooleanParameter param = new BooleanParameter(paramElement);
- addParameter(param);
- } else if (paramtype.equals(StringListParameter.TYPE)) {
- StringListParameter param = new StringListParameter(paramElement);
- addParameter(param);
- } else {
- String msg = "What kind of parameter is this: {0}"; //$NON-NLS-1$
- msg = MessageFormat.format(msg, paramtype);
- throw new StrolchException(msg);
- }
- }
- }
+ if (paramtype.equals(StringParameter.TYPE)) {
+ StringParameter param = new StringParameter(paramElement);
+ addParameter(param);
+ } else if (paramtype.equals(IntegerParameter.TYPE)) {
+ IntegerParameter param = new IntegerParameter(paramElement);
+ addParameter(param);
+ } else if (paramtype.equals(FloatParameter.TYPE)) {
+ FloatParameter param = new FloatParameter(paramElement);
+ addParameter(param);
+ } else if (paramtype.equals(LongParameter.TYPE)) {
+ LongParameter param = new LongParameter(paramElement);
+ addParameter(param);
+ } else if (paramtype.equals(DateParameter.TYPE)) {
+ DateParameter param = new DateParameter(paramElement);
+ addParameter(param);
+ } else if (paramtype.equals(BooleanParameter.TYPE)) {
+ BooleanParameter param = new BooleanParameter(paramElement);
+ addParameter(param);
+ } else if (paramtype.equals(StringListParameter.TYPE)) {
+ StringListParameter param = new StringListParameter(paramElement);
+ addParameter(param);
+ } else {
+ String msg = "What kind of parameter is this: {0}"; //$NON-NLS-1$
+ msg = MessageFormat.format(msg, paramtype);
+ throw new StrolchException(msg);
+ }
+ }
+ }
- @Override
- protected void fillElement(Element element) {
- super.fillElement(element);
+ @Override
+ protected void fillElement(Element element) {
+ super.fillElement(element);
- if (this.parameterMap != null) {
- for (Parameter> parameter : this.parameterMap.values()) {
- element.appendChild(parameter.toDom(element.getOwnerDocument()));
- }
- }
- }
+ if (this.parameterMap != null) {
+ for (Parameter> parameter : this.parameterMap.values()) {
+ element.appendChild(parameter.toDom(element.getOwnerDocument()));
+ }
+ }
+ }
- @Override
- protected void fillClone(StrolchElement clone) {
- super.fillClone(clone);
- ParameterizedElement peClone = (ParameterizedElement) clone;
- peClone.setType(this.type);
- if (this.parameterMap != null) {
- for (Parameter> param : this.parameterMap.values()) {
- peClone.addParameter(param.getClone());
- }
- }
- }
+ @Override
+ protected void fillClone(StrolchElement clone) {
+ super.fillClone(clone);
+ ParameterizedElement peClone = (ParameterizedElement) clone;
+ peClone.setType(this.type);
+ if (this.parameterMap != null) {
+ for (Parameter> param : this.parameterMap.values()) {
+ peClone.addParameter(param.getClone());
+ }
+ }
+ }
- @Override
- public GroupedParameterizedElement getParent() {
- return this.parent;
- }
+ @Override
+ public GroupedParameterizedElement getParent() {
+ return this.parent;
+ }
- /**
- * Set the parent for this {@link ParameterizedElement}
- *
- * @param parent the parent to set
- */
- public void setParent(GroupedParameterizedElement parent) {
- this.parent = parent;
- }
+ /**
+ * Set the parent for this {@link ParameterizedElement}
+ *
+ * @param parent the parent to set
+ */
+ public void setParent(GroupedParameterizedElement parent) {
+ this.parent = parent;
+ }
- @Override
- public StrolchRootElement getRootElement() {
- return this.parent.getRootElement();
- }
+ @Override
+ public StrolchRootElement getRootElement() {
+ return this.parent.getRootElement();
+ }
- @SuppressWarnings("nls")
- @Override
- public String toString() {
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
- StringBuilder builder = new StringBuilder();
+ StringBuilder builder = new StringBuilder();
- builder.append("ParameterizedElement [id=");
- builder.append(this.id);
- builder.append(", name=");
- builder.append(this.name);
- builder.append(", type=");
- builder.append(this.type);
- builder.append("]");
+ builder.append("ParameterizedElement [id=");
+ builder.append(this.id);
+ builder.append(", name=");
+ builder.append(this.name);
+ builder.append(", type=");
+ builder.append(this.type);
+ builder.append("]");
- return builder.toString();
- }
+ return builder.toString();
+ }
}
diff --git a/src/main/java/li/strolch/model/Resource.java b/src/main/java/li/strolch/model/Resource.java
index 86b012e7e..54a3bd5dd 100644
--- a/src/main/java/li/strolch/model/Resource.java
+++ b/src/main/java/li/strolch/model/Resource.java
@@ -41,176 +41,176 @@ import org.w3c.dom.NodeList;
*/
public class Resource extends GroupedParameterizedElement implements StrolchRootElement {
- private static final long serialVersionUID = 0L;
+ private static final long serialVersionUID = 0L;
- private Map> timedStateMap;
+ private Map> timedStateMap;
- /**
- * Empty constructor
- */
- public Resource() {
- //
- }
+ /**
+ * Empty constructor
+ */
+ public Resource() {
+ //
+ }
- /**
- * Default constructor
- *
- * @param id
- * @param name
- * @param type
- */
- public Resource(String id, String name, String type) {
- super(id, name, type);
- }
+ /**
+ * Default constructor
+ *
+ * @param id
+ * @param name
+ * @param type
+ */
+ public Resource(String id, String name, String type) {
+ super(id, name, type);
+ }
- /**
- * DOM Constructor
- *
- * @param element
- */
- public Resource(Element element) {
- super.fromDom(element);
+ /**
+ * DOM Constructor
+ *
+ * @param element
+ */
+ public Resource(Element element) {
+ super.fromDom(element);
- NodeList timedStateElems = element.getElementsByTagName(Tags.TIMED_STATE);
- for (int i = 0; i < timedStateElems.getLength(); i++) {
- Element timedStateElem = (Element) timedStateElems.item(i);
- String typeS = timedStateElem.getAttribute(Tags.TYPE);
+ NodeList timedStateElems = element.getElementsByTagName(Tags.TIMED_STATE);
+ for (int i = 0; i < timedStateElems.getLength(); i++) {
+ Element timedStateElem = (Element) timedStateElems.item(i);
+ String typeS = timedStateElem.getAttribute(Tags.TYPE);
- DBC.PRE.assertNotEmpty("Type must be set on TimedState for resource with id " + id, typeS);
+ DBC.PRE.assertNotEmpty("Type must be set on TimedState for resource with id " + id, typeS);
- if (typeS.equals(FloatTimedState.TYPE)) {
- StrolchTimedState timedState = new FloatTimedState(timedStateElem);
- addTimedState(timedState);
- } else if (typeS.equals(IntegerTimedState.TYPE)) {
- StrolchTimedState timedState = new IntegerTimedState(timedStateElem);
- addTimedState(timedState);
- } else if (typeS.equals(BooleanTimedState.TYPE)) {
- StrolchTimedState timedState = new BooleanTimedState(timedStateElem);
- addTimedState(timedState);
- } else if (typeS.equals(StringSetTimedState.TYPE)) {
- StrolchTimedState timedState = new StringSetTimedState(timedStateElem);
- addTimedState(timedState);
- } else {
- String msg = "What kind of TimedState is this: {0}"; //$NON-NLS-1$
- msg = MessageFormat.format(msg, typeS);
- throw new StrolchException(msg);
- }
- }
- }
+ if (typeS.equals(FloatTimedState.TYPE)) {
+ StrolchTimedState timedState = new FloatTimedState(timedStateElem);
+ addTimedState(timedState);
+ } else if (typeS.equals(IntegerTimedState.TYPE)) {
+ StrolchTimedState timedState = new IntegerTimedState(timedStateElem);
+ addTimedState(timedState);
+ } else if (typeS.equals(BooleanTimedState.TYPE)) {
+ StrolchTimedState timedState = new BooleanTimedState(timedStateElem);
+ addTimedState(timedState);
+ } else if (typeS.equals(StringSetTimedState.TYPE)) {
+ StrolchTimedState timedState = new StringSetTimedState(timedStateElem);
+ addTimedState(timedState);
+ } else {
+ String msg = "What kind of TimedState is this: {0}"; //$NON-NLS-1$
+ msg = MessageFormat.format(msg, typeS);
+ throw new StrolchException(msg);
+ }
+ }
+ }
- public void addTimedState(StrolchTimedState> strolchTimedState) {
- if (this.timedStateMap == null) {
- this.timedStateMap = new HashMap<>();
- }
+ public void addTimedState(StrolchTimedState> strolchTimedState) {
+ if (this.timedStateMap == null) {
+ this.timedStateMap = new HashMap<>();
+ }
- this.timedStateMap.put(strolchTimedState.getId(), strolchTimedState);
- strolchTimedState.setParent(this);
- }
+ this.timedStateMap.put(strolchTimedState.getId(), strolchTimedState);
+ strolchTimedState.setParent(this);
+ }
- @SuppressWarnings({"rawtypes", "unchecked"})
- public T getTimedState(String id) {
- if (this.timedStateMap == null) {
- return null;
- }
- return (T) this.timedStateMap.get(id);
- }
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ public T getTimedState(String id) {
+ if (this.timedStateMap == null) {
+ return null;
+ }
+ return (T) this.timedStateMap.get(id);
+ }
- @SuppressWarnings({"unchecked", "rawtypes"})
- public T removeTimedState(String id) {
- if (this.timedStateMap == null) {
- return null;
- }
- return (T) this.timedStateMap.remove(id);
- }
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public T removeTimedState(String id) {
+ if (this.timedStateMap == null) {
+ return null;
+ }
+ return (T) this.timedStateMap.remove(id);
+ }
- public Set getTimedStateKeySet() {
- if (this.timedStateMap == null) {
- return Collections.emptySet();
- }
- return new HashSet<>(this.timedStateMap.keySet());
- }
+ public Set getTimedStateKeySet() {
+ if (this.timedStateMap == null) {
+ return Collections.emptySet();
+ }
+ return new HashSet<>(this.timedStateMap.keySet());
+ }
- public List> getTimedStates() {
- if (this.timedStateMap == null) {
- return Collections.emptyList();
- }
- return new ArrayList<>(this.timedStateMap.values());
- }
+ public List> getTimedStates() {
+ if (this.timedStateMap == null) {
+ return Collections.emptyList();
+ }
+ return new ArrayList<>(this.timedStateMap.values());
+ }
- public boolean hasTimedStates() {
- return this.timedStateMap != null && !this.timedStateMap.isEmpty();
- }
+ public boolean hasTimedStates() {
+ return this.timedStateMap != null && !this.timedStateMap.isEmpty();
+ }
- public boolean hasTimedState(String id) {
- return this.timedStateMap != null && this.timedStateMap.containsKey(id);
- }
+ public boolean hasTimedState(String id) {
+ return this.timedStateMap != null && this.timedStateMap.containsKey(id);
+ }
- @Override
- public Element toDom(Document doc) {
+ @Override
+ public Element toDom(Document doc) {
- Element element = doc.createElement(Tags.RESOURCE);
- fillElement(element);
+ Element element = doc.createElement(Tags.RESOURCE);
+ fillElement(element);
- if (this.timedStateMap != null) {
- for (StrolchTimedState> state : this.timedStateMap.values()) {
- Element timedStateElem = state.toDom(element.getOwnerDocument());
- element.appendChild(timedStateElem);
- }
- }
+ if (this.timedStateMap != null) {
+ for (StrolchTimedState> state : this.timedStateMap.values()) {
+ Element timedStateElem = state.toDom(element.getOwnerDocument());
+ element.appendChild(timedStateElem);
+ }
+ }
- return element;
- }
+ return element;
+ }
- @Override
- public Resource getClone() {
- Resource clone = new Resource();
+ @Override
+ public Resource getClone() {
+ Resource clone = new Resource();
- super.fillClone(clone);
+ super.fillClone(clone);
- return clone;
- }
+ return clone;
+ }
- @Override
- public void fillLocator(LocatorBuilder lb) {
- lb.append(Tags.RESOURCE).append(getType()).append(getId());
- }
+ @Override
+ public void fillLocator(LocatorBuilder lb) {
+ lb.append(Tags.RESOURCE).append(getType()).append(getId());
+ }
- @Override
- public Locator getLocator() {
- LocatorBuilder lb = new LocatorBuilder();
- fillLocator(lb);
- return lb.build();
- }
+ @Override
+ public Locator getLocator() {
+ LocatorBuilder lb = new LocatorBuilder();
+ fillLocator(lb);
+ return lb.build();
+ }
- @Override
- public StrolchElement getParent() {
- return null;
- }
+ @Override
+ public StrolchElement getParent() {
+ return null;
+ }
- @Override
- public Resource getRootElement() {
- return this;
- }
+ @Override
+ public Resource getRootElement() {
+ return this;
+ }
- @Override
- public T accept(StrolchRootElementVisitor visitor) {
- return visitor.visitResource(this);
- }
+ @Override
+ public T accept(StrolchRootElementVisitor visitor) {
+ return visitor.visitResource(this);
+ }
- @SuppressWarnings("nls")
- @Override
- public String toString() {
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
- StringBuilder builder = new StringBuilder();
+ StringBuilder builder = new StringBuilder();
- builder.append("Resource [id=");
- builder.append(this.id);
- builder.append(", name=");
- builder.append(this.name);
- builder.append(", type=");
- builder.append(this.type);
- builder.append("]");
+ builder.append("Resource [id=");
+ builder.append(this.id);
+ builder.append(", name=");
+ builder.append(this.name);
+ builder.append(", type=");
+ builder.append(this.type);
+ builder.append("]");
- return builder.toString();
- }
+ return builder.toString();
+ }
}
diff --git a/src/main/java/li/strolch/model/ResourceVisitor.java b/src/main/java/li/strolch/model/ResourceVisitor.java
index e96909b97..5d3816a63 100644
--- a/src/main/java/li/strolch/model/ResourceVisitor.java
+++ b/src/main/java/li/strolch/model/ResourceVisitor.java
@@ -20,7 +20,7 @@ import li.strolch.model.visitor.StrolchElementVisitor;
/**
* @author Robert von Burg
*/
-public interface ResourceVisitor extends StrolchElementVisitor{
+public interface ResourceVisitor extends StrolchElementVisitor {
@Override
public void visit(Resource element);
diff --git a/src/main/java/li/strolch/model/StrolchElement.java b/src/main/java/li/strolch/model/StrolchElement.java
index e556f42e2..85f171a21 100644
--- a/src/main/java/li/strolch/model/StrolchElement.java
+++ b/src/main/java/li/strolch/model/StrolchElement.java
@@ -27,7 +27,7 @@ public interface StrolchElement extends Serializable, Comparable
/**
* Return the {@link Locator} for this element
- *
+ *
* @return the {@link Locator} for this element
*/
public Locator getLocator();
@@ -35,7 +35,7 @@ public interface StrolchElement extends Serializable, Comparable
/**
* Set the semi unique id of this {@link StrolchElement}. This value should be unique under all concrete
* implementations of this interface
- *
+ *
* @param id
*/
public void setId(String id);
@@ -43,53 +43,52 @@ public interface StrolchElement extends Serializable, Comparable
/**
* Returns the semi unique id of this {@link StrolchElement}. This value should be unique under all concrete
* implementations of this interface
- *
+ *
* @return
*/
public String getId();
/**
* Set the name of this {@link StrolchElement}
- *
+ *
* @param name
*/
public void setName(String name);
/**
* Returns the name of this {@link StrolchElement}
- *
+ *
* @return
*/
public String getName();
/**
* Set the currently set long value which defines the primary key for use in RDBM-Systems
- *
+ *
* @param dbid
*/
public void setDbid(long dbid);
/**
* Returns the currently set long value which defines the primary key for use in RDBM-Systems
- *
+ *
* @return
*/
public long getDbid();
/**
* Returns an {@link Element} object which is an XML representation of this object
- *
- * @param doc
- * the document to which this element is being written. The client must not append to the document, the
- * caller will perform this as needed
- *
+ *
+ * @param doc the document to which this element is being written. The client must not append to the document, the
+ * caller will perform this as needed
+ *
* @return
*/
public Element toDom(Document doc);
/**
* Returns the type of this {@link StrolchElement}
- *
+ *
* @return
*/
public String getType();
@@ -100,7 +99,7 @@ public interface StrolchElement extends Serializable, Comparable
/**
* Return a clone of this {@link StrolchElement}
- *
+ *
* @return
*/
public StrolchElement getClone();
diff --git a/src/main/java/li/strolch/model/StrolchRootElement.java b/src/main/java/li/strolch/model/StrolchRootElement.java
index 265cd185d..42ac8942c 100644
--- a/src/main/java/li/strolch/model/StrolchRootElement.java
+++ b/src/main/java/li/strolch/model/StrolchRootElement.java
@@ -20,7 +20,7 @@ import li.strolch.model.visitor.StrolchRootElementVisitor;
/**
* Root element for all top level {@link StrolchElement}. These are elements which have no parent, e.g. {@link Resource
* Resources} and {@link Order Orders}
- *
+ *
* @author Robert von Burg
*/
public interface StrolchRootElement extends StrolchElement {
diff --git a/src/main/java/li/strolch/model/Tags.java b/src/main/java/li/strolch/model/Tags.java
index 52733c40f..879b36a56 100644
--- a/src/main/java/li/strolch/model/Tags.java
+++ b/src/main/java/li/strolch/model/Tags.java
@@ -25,7 +25,7 @@ public class Tags {
public static final String DATE = "Date";
public static final String STATE = "State";
public static final String VALUE = "Value";
- public static final String TIME = "Time";
+ public static final String TIME = "Time";
public static final String INTERPRETATION = "Interpretation";
public static final String UOM = "Uom";
public static final String HIDDEN = "Hidden";
diff --git a/src/main/java/li/strolch/model/parameter/AbstractParameter.java b/src/main/java/li/strolch/model/parameter/AbstractParameter.java
index a2895713a..95ea81de5 100644
--- a/src/main/java/li/strolch/model/parameter/AbstractParameter.java
+++ b/src/main/java/li/strolch/model/parameter/AbstractParameter.java
@@ -33,7 +33,7 @@ import ch.eitchnet.utils.helper.StringHelper;
/**
* @author Robert von Burg
- *
+ *
* @param
*/
public abstract class AbstractParameter extends AbstractStrolchElement implements Parameter {
@@ -56,7 +56,7 @@ public abstract class AbstractParameter extends AbstractStrolchElement implem
/**
* Default constructor
- *
+ *
* @param id
* @param name
*/
@@ -134,14 +134,18 @@ public abstract class AbstractParameter extends AbstractStrolchElement implem
element.setAttribute(Tags.VALUE, getValueAsString());
- if (!this.interpretation.equals(Parameter.INTERPRETATION_NONE))
+ if (!this.interpretation.equals(Parameter.INTERPRETATION_NONE)) {
element.setAttribute(Tags.INTERPRETATION, this.interpretation);
- if (!this.uom.equals(Parameter.UOM_NONE))
+ }
+ if (!this.uom.equals(Parameter.UOM_NONE)) {
element.setAttribute(Tags.UOM, this.uom);
- if (this.hidden)
+ }
+ if (this.hidden) {
element.setAttribute(Tags.HIDDEN, Boolean.toString(this.hidden));
- if (this.index != 0)
+ }
+ if (this.index != 0) {
element.setAttribute(Tags.INDEX, Integer.toString(this.index));
+ }
return element;
}
@@ -206,12 +210,10 @@ public abstract class AbstractParameter extends AbstractStrolchElement implem
/**
* Validates that the value is legal. This is the case when it is not null in this implementation
- *
- * @param value
- * the value to check for this parameter instance
- *
- * @throws StrolchException
- * if the value is null
+ *
+ * @param value the value to check for this parameter instance
+ *
+ * @throws StrolchException if the value is null
*/
protected void validateValue(T value) throws StrolchException {
if (value == null) {
@@ -223,7 +225,7 @@ public abstract class AbstractParameter extends AbstractStrolchElement implem
/**
* Fills the {@link Parameter} clone with the id, name, hidden, interpretation and uom
- *
+ *
* @param clone
*/
protected void fillClone(Parameter> clone) {
diff --git a/src/main/java/li/strolch/model/parameter/BooleanParameter.java b/src/main/java/li/strolch/model/parameter/BooleanParameter.java
index ea380dc5e..2596dba0c 100644
--- a/src/main/java/li/strolch/model/parameter/BooleanParameter.java
+++ b/src/main/java/li/strolch/model/parameter/BooleanParameter.java
@@ -44,7 +44,7 @@ public class BooleanParameter extends AbstractParameter {
/**
* Default constructors
- *
+ *
* @param id
* @param name
* @param value
@@ -56,7 +56,7 @@ public class BooleanParameter extends AbstractParameter {
/**
* DOM Constructor
- *
+ *
* @param element
*/
public BooleanParameter(Element element) {
diff --git a/src/main/java/li/strolch/model/parameter/DateParameter.java b/src/main/java/li/strolch/model/parameter/DateParameter.java
index 86f19f2ad..ffffb8462 100644
--- a/src/main/java/li/strolch/model/parameter/DateParameter.java
+++ b/src/main/java/li/strolch/model/parameter/DateParameter.java
@@ -46,7 +46,7 @@ public class DateParameter extends AbstractParameter {
/**
* Default Constructor
- *
+ *
* @param id
* @param name
* @param value
@@ -58,7 +58,7 @@ public class DateParameter extends AbstractParameter {
/**
* DOM Constructor
- *
+ *
* @param element
*/
public DateParameter(Element element) {
diff --git a/src/main/java/li/strolch/model/parameter/FloatParameter.java b/src/main/java/li/strolch/model/parameter/FloatParameter.java
index 7d322dc56..565ce2738 100644
--- a/src/main/java/li/strolch/model/parameter/FloatParameter.java
+++ b/src/main/java/li/strolch/model/parameter/FloatParameter.java
@@ -27,7 +27,7 @@ import ch.eitchnet.utils.helper.StringHelper;
/**
* @author Robert von Burg
- *
+ *
*/
public class FloatParameter extends AbstractParameter {
@@ -45,7 +45,7 @@ public class FloatParameter extends AbstractParameter {
/**
* Default constructor
- *
+ *
* @param id
* @param name
* @param value
@@ -58,7 +58,7 @@ public class FloatParameter extends AbstractParameter {
/**
* DOM Constructor
- *
+ *
* @param element
*/
public FloatParameter(Element element) {
diff --git a/src/main/java/li/strolch/model/parameter/IntegerParameter.java b/src/main/java/li/strolch/model/parameter/IntegerParameter.java
index a1db56027..cf29997d4 100644
--- a/src/main/java/li/strolch/model/parameter/IntegerParameter.java
+++ b/src/main/java/li/strolch/model/parameter/IntegerParameter.java
@@ -27,7 +27,7 @@ import ch.eitchnet.utils.helper.StringHelper;
/**
* @author Robert von Burg
- *
+ *
*/
public class IntegerParameter extends AbstractParameter {
@@ -45,7 +45,7 @@ public class IntegerParameter extends AbstractParameter {
/**
* Default constructor
- *
+ *
* @param id
* @param name
* @param value
@@ -57,7 +57,7 @@ public class IntegerParameter extends AbstractParameter {
/**
* DOM Constructor
- *
+ *
* @param element
*/
public IntegerParameter(Element element) {
diff --git a/src/main/java/li/strolch/model/parameter/ListParameter.java b/src/main/java/li/strolch/model/parameter/ListParameter.java
index d7d46a6c1..149b91c8d 100644
--- a/src/main/java/li/strolch/model/parameter/ListParameter.java
+++ b/src/main/java/li/strolch/model/parameter/ListParameter.java
@@ -19,7 +19,7 @@ import java.util.List;
/**
* @author Robert von Burg
- *
+ *
*/
public interface ListParameter extends Parameter> {
@@ -27,18 +27,16 @@ public interface ListParameter extends Parameter> {
/**
* Adds a single value to the {@link List} of values
- *
- * @param value
- * the value to add
+ *
+ * @param value the value to add
*/
public void addValue(E value);
/**
* Removes a single value from the {@link List} of values
- *
- * @param value
- * the value to remove
- *
+ *
+ * @param value the value to remove
+ *
* @return true if the value was removed, false if it did not exist
*/
public boolean removeValue(E value);
diff --git a/src/main/java/li/strolch/model/parameter/LongParameter.java b/src/main/java/li/strolch/model/parameter/LongParameter.java
index 42573a443..0e47f51a9 100644
--- a/src/main/java/li/strolch/model/parameter/LongParameter.java
+++ b/src/main/java/li/strolch/model/parameter/LongParameter.java
@@ -27,7 +27,7 @@ import ch.eitchnet.utils.helper.StringHelper;
/**
* @author Robert von Burg
- *
+ *
*/
public class LongParameter extends AbstractParameter {
@@ -45,7 +45,7 @@ public class LongParameter extends AbstractParameter {
/**
* Default constructor
- *
+ *
* @param id
* @param name
* @param value
@@ -57,7 +57,7 @@ public class LongParameter extends AbstractParameter {
/**
* DOM Constructor
- *
+ *
* @param element
*/
public LongParameter(Element element) {
diff --git a/src/main/java/li/strolch/model/parameter/Parameter.java b/src/main/java/li/strolch/model/parameter/Parameter.java
index 71bb27f4e..e9c46140e 100644
--- a/src/main/java/li/strolch/model/parameter/Parameter.java
+++ b/src/main/java/li/strolch/model/parameter/Parameter.java
@@ -23,7 +23,7 @@ import li.strolch.model.visitor.ParameterVisitor;
/**
* @author Robert von Burg
- *
+ *
*/
public interface Parameter extends StrolchElement {
@@ -51,71 +51,70 @@ public interface Parameter extends StrolchElement {
/**
* the value of the parameter as string
- *
+ *
* @return String
*/
public String getValueAsString();
/**
* the value of the parameter
- *
+ *
* @return
*/
public T getValue();
/**
* the value of the parameter
- *
+ *
* @param value
*/
public void setValue(T value);
/**
* get the hidden attribute
- *
+ *
* @return
*/
public boolean isHidden();
/**
* set the hidden attribute
- *
+ *
* @param hidden
*/
public void setHidden(boolean hidden);
/**
* Get the UOM of this {@link Parameter}
- *
+ *
* @return
*/
public String getUom();
/**
* Set the UOM of this {@link Parameter}
- *
+ *
* @param uom
*/
public void setUom(String uom);
/**
* Returns the index of this {@link Parameter}. This can be used to sort the parameters in a UI
- *
+ *
* @return the index of this {@link Parameter}. This can be used to sort the parameters in a UI
*/
public int getIndex();
/**
* Set the index of this {@link Parameter}. This can be used to sort the parameters in a UI
- *
- * @param index
- * the index to set
+ *
+ * @param index the index to set
*/
public void setIndex(int index);
/**
* The {@link ParameterizedElement} parent to which this {@link Parameter} belongs
- *
+ *
* @return
*/
public ParameterizedElement getParent();
@@ -133,7 +132,7 @@ public interface Parameter extends StrolchElement {
* {@link Parameter#INTERPRETATION_ORDER_REF}
* {@link Parameter#INTERPRETATION_RESOURCE_REF}
*
- *
+ *
* @return string value
*/
public String getInterpretation();
@@ -146,7 +145,7 @@ public interface Parameter extends StrolchElement {
* {@link Parameter#INTERPRETATION_ORDER_REF}
* {@link Parameter#INTERPRETATION_RESOURCE_REF}
*
- *
+ *
* @param interpretation
*/
public void setInterpretation(String interpretation);
diff --git a/src/main/java/li/strolch/model/parameter/StringListParameter.java b/src/main/java/li/strolch/model/parameter/StringListParameter.java
index 0f7722076..3068011f9 100644
--- a/src/main/java/li/strolch/model/parameter/StringListParameter.java
+++ b/src/main/java/li/strolch/model/parameter/StringListParameter.java
@@ -49,7 +49,7 @@ public class StringListParameter extends AbstractParameter> impleme
/**
* Default constructor
- *
+ *
* @param id
* @param name
* @param value
@@ -62,7 +62,7 @@ public class StringListParameter extends AbstractParameter> impleme
/**
* DOM Constructor
- *
+ *
* @param element
*/
public StringListParameter(Element element) {
@@ -79,8 +79,9 @@ public class StringListParameter extends AbstractParameter> impleme
@Override
public String getValueAsString() {
- if (this.value.isEmpty())
+ if (this.value.isEmpty()) {
return StringHelper.EMPTY;
+ }
StringBuilder sb = new StringBuilder();
Iterator iter = this.value.iterator();
@@ -88,8 +89,9 @@ public class StringListParameter extends AbstractParameter> impleme
sb.append(iter.next());
- if (iter.hasNext())
+ if (iter.hasNext()) {
sb.append(VALUE_SEPARATOR);
+ }
}
return sb.toString();
@@ -103,8 +105,9 @@ public class StringListParameter extends AbstractParameter> impleme
@Override
public void setValue(List value) {
validateValue(value);
- if (this.value == null)
+ if (this.value == null) {
this.value = new ArrayList(value.size());
+ }
this.value.clear();
this.value.addAll(value);
}
@@ -141,8 +144,9 @@ public class StringListParameter extends AbstractParameter> impleme
}
public static List parseFromString(String value) {
- if (value.isEmpty())
+ if (value.isEmpty()) {
return Collections.emptyList();
+ }
String[] valueArr = value.split(VALUE_SEPARATOR);
return Arrays.asList(valueArr);
diff --git a/src/main/java/li/strolch/model/parameter/StringParameter.java b/src/main/java/li/strolch/model/parameter/StringParameter.java
index 262a57a09..b7c65b897 100644
--- a/src/main/java/li/strolch/model/parameter/StringParameter.java
+++ b/src/main/java/li/strolch/model/parameter/StringParameter.java
@@ -27,7 +27,7 @@ import ch.eitchnet.utils.helper.StringHelper;
/**
* @author Robert von Burg
- *
+ *
*/
public class StringParameter extends AbstractParameter {
@@ -39,7 +39,7 @@ public class StringParameter extends AbstractParameter {
/**
* Empty constructor
- *
+ *
*/
public StringParameter() {
//
@@ -47,7 +47,7 @@ public class StringParameter extends AbstractParameter {
/**
* Default constructor
- *
+ *
* @param id
* @param name
* @param value
@@ -59,7 +59,7 @@ public class StringParameter extends AbstractParameter {
/**
* DOM Constructor
- *
+ *
* @param element
*/
public StringParameter(Element element) {
diff --git a/src/main/java/li/strolch/model/query/Navigation.java b/src/main/java/li/strolch/model/query/Navigation.java
index 9ff8d23f2..3ddb304fe 100644
--- a/src/main/java/li/strolch/model/query/Navigation.java
+++ b/src/main/java/li/strolch/model/query/Navigation.java
@@ -15,14 +15,12 @@
*/
package li.strolch.model.query;
-
/**
* @author Robert von Burg
- *
+ *
*/
public interface Navigation {
// marker interface
-
public void accept(QueryVisitor visitor);
}
diff --git a/src/main/java/li/strolch/model/query/NotSelection.java b/src/main/java/li/strolch/model/query/NotSelection.java
index a6ea2e0cf..195ae6b86 100644
--- a/src/main/java/li/strolch/model/query/NotSelection.java
+++ b/src/main/java/li/strolch/model/query/NotSelection.java
@@ -28,8 +28,7 @@ public class NotSelection extends BooleanSelection {
}
/**
- * @throws UnsupportedOperationException
- * because a {@link NotSelection} can only work on a single {@link Selection}
+ * @throws UnsupportedOperationException because a {@link NotSelection} can only work on a single {@link Selection}
*/
@Override
public NotSelection with(Selection selection) {
diff --git a/src/main/java/li/strolch/model/query/OrderQueryVisitor.java b/src/main/java/li/strolch/model/query/OrderQueryVisitor.java
index 5923efce8..91196a0f3 100644
--- a/src/main/java/li/strolch/model/query/OrderQueryVisitor.java
+++ b/src/main/java/li/strolch/model/query/OrderQueryVisitor.java
@@ -17,7 +17,7 @@ package li.strolch.model.query;
/**
* @author Robert von Burg
- *
+ *
*/
public interface OrderQueryVisitor extends OrderSelectionVisitor, ParameterSelectionVisitor {
diff --git a/src/main/java/li/strolch/model/query/OrderSelection.java b/src/main/java/li/strolch/model/query/OrderSelection.java
index 9549ed8a3..ab6479c42 100644
--- a/src/main/java/li/strolch/model/query/OrderSelection.java
+++ b/src/main/java/li/strolch/model/query/OrderSelection.java
@@ -17,7 +17,7 @@ package li.strolch.model.query;
/**
* @author Robert von Burg
- *
+ *
*/
public abstract class OrderSelection implements Selection {
@@ -25,6 +25,6 @@ public abstract class OrderSelection implements Selection {
public void accept(QueryVisitor visitor) {
accept((OrderSelectionVisitor) visitor);
}
-
+
public abstract void accept(OrderSelectionVisitor visitor);
}
diff --git a/src/main/java/li/strolch/model/query/OrderSelectionVisitor.java b/src/main/java/li/strolch/model/query/OrderSelectionVisitor.java
index 708bbce7a..700208027 100644
--- a/src/main/java/li/strolch/model/query/OrderSelectionVisitor.java
+++ b/src/main/java/li/strolch/model/query/OrderSelectionVisitor.java
@@ -17,7 +17,7 @@ package li.strolch.model.query;
/**
* @author Robert von Burg
- *
+ *
*/
public interface OrderSelectionVisitor extends StrolchElementSelectionVisitor {
diff --git a/src/main/java/li/strolch/model/query/ParameterSelection.java b/src/main/java/li/strolch/model/query/ParameterSelection.java
index b57df7137..a3cc17bdf 100644
--- a/src/main/java/li/strolch/model/query/ParameterSelection.java
+++ b/src/main/java/li/strolch/model/query/ParameterSelection.java
@@ -139,6 +139,7 @@ public abstract class ParameterSelection implements Selection {
}
public static class BooleanParameterSelection extends ParameterSelection {
+
private Boolean value;
public BooleanParameterSelection(String bagKey, String paramKey, Boolean value) {
@@ -157,6 +158,7 @@ public abstract class ParameterSelection implements Selection {
}
public static class LongParameterSelection extends ParameterSelection {
+
private Long value;
public LongParameterSelection(String bagKey, String paramKey, Long value) {
@@ -175,6 +177,7 @@ public abstract class ParameterSelection implements Selection {
}
public static class FloatParameterSelection extends ParameterSelection {
+
private Double value;
public FloatParameterSelection(String bagKey, String paramKey, Double value) {
@@ -193,6 +196,7 @@ public abstract class ParameterSelection implements Selection {
}
public static class DateParameterSelection extends ParameterSelection {
+
private Date value;
public DateParameterSelection(String bagKey, String paramKey, Date value) {
@@ -211,6 +215,7 @@ public abstract class ParameterSelection implements Selection {
}
public static class StringListParameterSelection extends ParameterSelection {
+
private List value;
public StringListParameterSelection(String bagKey, String paramKey, List value) {
diff --git a/src/main/java/li/strolch/model/query/ParameterSelectionVisitor.java b/src/main/java/li/strolch/model/query/ParameterSelectionVisitor.java
index 065e862be..b8b767474 100644
--- a/src/main/java/li/strolch/model/query/ParameterSelectionVisitor.java
+++ b/src/main/java/li/strolch/model/query/ParameterSelectionVisitor.java
@@ -25,7 +25,7 @@ import li.strolch.model.query.ParameterSelection.StringParameterSelection;
/**
* @author Robert von Burg
- *
+ *
*/
public interface ParameterSelectionVisitor extends QueryVisitor {
diff --git a/src/main/java/li/strolch/model/query/Query.java b/src/main/java/li/strolch/model/query/Query.java
index 83dc7ef58..1f2b7057c 100644
--- a/src/main/java/li/strolch/model/query/Query.java
+++ b/src/main/java/li/strolch/model/query/Query.java
@@ -15,10 +15,9 @@
*/
package li.strolch.model.query;
-
/**
* @author Robert von Burg
- *
+ *
*/
public interface Query {
diff --git a/src/main/java/li/strolch/model/query/QueryVisitor.java b/src/main/java/li/strolch/model/query/QueryVisitor.java
index f1a9dbe55..e14ccc566 100644
--- a/src/main/java/li/strolch/model/query/QueryVisitor.java
+++ b/src/main/java/li/strolch/model/query/QueryVisitor.java
@@ -23,6 +23,6 @@ public interface QueryVisitor {
public void visitAnd(AndSelection andSelection);
public void visitOr(OrSelection orSelection);
-
+
public void visitNot(NotSelection notSelection);
}
diff --git a/src/main/java/li/strolch/model/query/ResourceQueryVisitor.java b/src/main/java/li/strolch/model/query/ResourceQueryVisitor.java
index 8710a65f0..850b6950c 100644
--- a/src/main/java/li/strolch/model/query/ResourceQueryVisitor.java
+++ b/src/main/java/li/strolch/model/query/ResourceQueryVisitor.java
@@ -17,7 +17,7 @@ package li.strolch.model.query;
/**
* @author Robert von Burg
- *
+ *
*/
public interface ResourceQueryVisitor extends StrolchElementSelectionVisitor, ParameterSelectionVisitor {
diff --git a/src/main/java/li/strolch/model/query/Selection.java b/src/main/java/li/strolch/model/query/Selection.java
index 3b658fe44..aeaded229 100644
--- a/src/main/java/li/strolch/model/query/Selection.java
+++ b/src/main/java/li/strolch/model/query/Selection.java
@@ -21,6 +21,5 @@ package li.strolch.model.query;
public interface Selection {
// marker interface
-
public void accept(QueryVisitor visitor);
}
diff --git a/src/main/java/li/strolch/model/query/StateSelection.java b/src/main/java/li/strolch/model/query/StateSelection.java
index 393838f6c..542776e99 100644
--- a/src/main/java/li/strolch/model/query/StateSelection.java
+++ b/src/main/java/li/strolch/model/query/StateSelection.java
@@ -19,7 +19,7 @@ import li.strolch.model.State;
/**
* @author Robert von Burg
- *
+ *
*/
public class StateSelection {
diff --git a/src/main/java/li/strolch/model/query/StrolchTypeNavigation.java b/src/main/java/li/strolch/model/query/StrolchTypeNavigation.java
index 82cc8760d..32b23f84a 100644
--- a/src/main/java/li/strolch/model/query/StrolchTypeNavigation.java
+++ b/src/main/java/li/strolch/model/query/StrolchTypeNavigation.java
@@ -17,7 +17,7 @@ package li.strolch.model.query;
/**
* @author Robert von Burg
- *
+ *
*/
public class StrolchTypeNavigation implements Navigation {
diff --git a/src/main/java/li/strolch/model/timedstate/AbstractStrolchTimedState.java b/src/main/java/li/strolch/model/timedstate/AbstractStrolchTimedState.java
index 61f118599..30faffef5 100644
--- a/src/main/java/li/strolch/model/timedstate/AbstractStrolchTimedState.java
+++ b/src/main/java/li/strolch/model/timedstate/AbstractStrolchTimedState.java
@@ -32,96 +32,96 @@ import li.strolch.model.timevalue.IValueChange;
*/
@SuppressWarnings("rawtypes")
public abstract class AbstractStrolchTimedState extends AbstractStrolchElement implements
- StrolchTimedState {
+ StrolchTimedState {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- protected Resource parent;
- protected ITimedState state;
+ protected Resource parent;
+ protected ITimedState state;
- public AbstractStrolchTimedState() {
- this.state = new TimedState<>();
- }
+ public AbstractStrolchTimedState() {
+ this.state = new TimedState<>();
+ }
- public AbstractStrolchTimedState(String id, String name) {
- super(id, name);
- this.state = new TimedState<>();
- }
+ public AbstractStrolchTimedState(String id, String name) {
+ super(id, name);
+ this.state = new TimedState<>();
+ }
- @Override
- public ITimeValue getNextMatch(Long time, T value) {
- return this.state.getNextMatch(time, value);
- }
+ @Override
+ public ITimeValue getNextMatch(Long time, T value) {
+ return this.state.getNextMatch(time, value);
+ }
- @Override
- public ITimeValue getPreviousMatch(Long time, T value) {
- return this.state.getPreviousMatch(time, value);
- }
+ @Override
+ public ITimeValue getPreviousMatch(Long time, T value) {
+ return this.state.getPreviousMatch(time, value);
+ }
- @Override
- public > void applyChange(U change) {
- this.state.applyChange(change);
- }
+ @Override
+ public > void applyChange(U change) {
+ this.state.applyChange(change);
+ }
- @Override
- public ITimeValue getStateAt(Long time) {
- return this.state.getStateAt(time);
- }
+ @Override
+ public ITimeValue getStateAt(Long time) {
+ return this.state.getStateAt(time);
+ }
- @Override
- public ITimeVariable getTimeEvolution() {
- return this.state.getTimeEvolution();
- }
+ @Override
+ public ITimeVariable getTimeEvolution() {
+ return this.state.getTimeEvolution();
+ }
- @Override
- public StrolchElement getParent() {
- return this.parent;
- }
+ @Override
+ public StrolchElement getParent() {
+ return this.parent;
+ }
- @Override
- public void setParent(Resource parent) {
- this.parent = parent;
- }
+ @Override
+ public void setParent(Resource parent) {
+ this.parent = parent;
+ }
- @Override
- public StrolchRootElement getRootElement() {
- return this.parent;
- }
+ @Override
+ public StrolchRootElement getRootElement() {
+ return this.parent;
+ }
- @Override
- protected void fillLocator(LocatorBuilder locatorBuilder) {
- locatorBuilder.append(Tags.TIMED_STATE);
- locatorBuilder.append(getId());
- }
+ @Override
+ protected void fillLocator(LocatorBuilder locatorBuilder) {
+ locatorBuilder.append(Tags.TIMED_STATE);
+ locatorBuilder.append(getId());
+ }
- @Override
- public Locator getLocator() {
- LocatorBuilder lb = new LocatorBuilder();
- this.parent.fillLocator(lb);
- fillLocator(lb);
- return lb.build();
- }
+ @Override
+ public Locator getLocator() {
+ LocatorBuilder lb = new LocatorBuilder();
+ this.parent.fillLocator(lb);
+ fillLocator(lb);
+ return lb.build();
+ }
- protected void fillClone(AbstractStrolchTimedState clone) {
- super.fillClone(clone);
- clone.state = this.state.getCopy();
- }
+ protected void fillClone(AbstractStrolchTimedState clone) {
+ super.fillClone(clone);
+ clone.state = this.state.getCopy();
+ }
- @SuppressWarnings("nls")
- @Override
- public String toString() {
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
- StringBuilder builder = new StringBuilder();
+ StringBuilder builder = new StringBuilder();
- builder.append(getClass().getSimpleName());
- builder.append(" [id=");
- builder.append(this.id);
- builder.append(", name=");
- builder.append(this.name);
- builder.append(", valueNow=");
- builder.append(this.state.getStateAt(System.currentTimeMillis()));
- builder.append("]");
+ builder.append(getClass().getSimpleName());
+ builder.append(" [id=");
+ builder.append(this.id);
+ builder.append(", name=");
+ builder.append(this.name);
+ builder.append(", valueNow=");
+ builder.append(this.state.getStateAt(System.currentTimeMillis()));
+ builder.append("]");
- return builder.toString();
- }
+ return builder.toString();
+ }
}
diff --git a/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java b/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java
index fce5aa0c1..725570c51 100644
--- a/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java
+++ b/src/main/java/li/strolch/model/timedstate/BooleanTimedState.java
@@ -29,60 +29,60 @@ import org.w3c.dom.NodeList;
*/
public class BooleanTimedState extends AbstractStrolchTimedState {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- public static final String TYPE = "BooleanState";
+ public static final String TYPE = "BooleanState";
- public BooleanTimedState() {
- super();
- }
+ public BooleanTimedState() {
+ super();
+ }
- public BooleanTimedState(String id, String name) {
- super(id, name);
- }
+ public BooleanTimedState(String id, String name) {
+ super(id, name);
+ }
- public BooleanTimedState(Element element) {
- super.fromDom(element);
+ public BooleanTimedState(Element element) {
+ super.fromDom(element);
- this.state = new TimedState<>();
+ this.state = new TimedState<>();
- NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
- for (int i = 0; i < timeValueElems.getLength(); i++) {
- Element timeValueElem = (Element) timeValueElems.item(i);
- Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
- Boolean value = Boolean.valueOf(timeValueElem.getAttribute(Tags.VALUE));
- BooleanValue booleanValue = new BooleanValue(value);
- this.state.getTimeEvolution().setValueAt(time, booleanValue);
- }
- }
+ NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
+ for (int i = 0; i < timeValueElems.getLength(); i++) {
+ Element timeValueElem = (Element) timeValueElems.item(i);
+ Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
+ Boolean value = Boolean.valueOf(timeValueElem.getAttribute(Tags.VALUE));
+ BooleanValue booleanValue = new BooleanValue(value);
+ this.state.getTimeEvolution().setValueAt(time, booleanValue);
+ }
+ }
- @Override
- public Element toDom(Document doc) {
+ @Override
+ public Element toDom(Document doc) {
- Element stateElement = doc.createElement(Tags.TIMED_STATE);
- super.fillElement(stateElement);
- SortedSet> values = this.state.getTimeEvolution().getValues();
- for (ITimeValue timeValue : values) {
- Long time = timeValue.getTime();
- BooleanValue value = timeValue.getValue();
- Element valueElem = doc.createElement(Tags.VALUE);
- valueElem.setAttribute(Tags.TIME, time.toString());
- valueElem.setAttribute(Tags.VALUE, value.getValue().toString());
- stateElement.appendChild(valueElem);
- }
+ Element stateElement = doc.createElement(Tags.TIMED_STATE);
+ super.fillElement(stateElement);
+ SortedSet> values = this.state.getTimeEvolution().getValues();
+ for (ITimeValue timeValue : values) {
+ Long time = timeValue.getTime();
+ BooleanValue value = timeValue.getValue();
+ Element valueElem = doc.createElement(Tags.VALUE);
+ valueElem.setAttribute(Tags.TIME, time.toString());
+ valueElem.setAttribute(Tags.VALUE, value.getValue().toString());
+ stateElement.appendChild(valueElem);
+ }
- return stateElement;
- }
+ return stateElement;
+ }
- @Override
- public String getType() {
- return TYPE;
- }
+ @Override
+ public String getType() {
+ return TYPE;
+ }
- @Override
- public StrolchElement getClone() {
- BooleanTimedState clone = new BooleanTimedState();
- fillClone(clone);
- return clone;
- }
+ @Override
+ public StrolchElement getClone() {
+ BooleanTimedState clone = new BooleanTimedState();
+ fillClone(clone);
+ return clone;
+ }
}
diff --git a/src/main/java/li/strolch/model/timedstate/FloatTimedState.java b/src/main/java/li/strolch/model/timedstate/FloatTimedState.java
index 9c153af55..4a6c90713 100644
--- a/src/main/java/li/strolch/model/timedstate/FloatTimedState.java
+++ b/src/main/java/li/strolch/model/timedstate/FloatTimedState.java
@@ -29,60 +29,60 @@ import org.w3c.dom.NodeList;
*/
public class FloatTimedState extends AbstractStrolchTimedState {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- public static final String TYPE = "FloatState";
+ public static final String TYPE = "FloatState";
- public FloatTimedState() {
- super();
- }
+ public FloatTimedState() {
+ super();
+ }
- public FloatTimedState(String id, String name) {
- super(id, name);
- }
+ public FloatTimedState(String id, String name) {
+ super(id, name);
+ }
- public FloatTimedState(Element element) {
- super.fromDom(element);
+ public FloatTimedState(Element element) {
+ super.fromDom(element);
- this.state = new TimedState<>();
+ this.state = new TimedState<>();
- NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
- for (int i = 0; i < timeValueElems.getLength(); i++) {
- Element timeValueElem = (Element) timeValueElems.item(i);
- Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
- Double value = Double.valueOf(timeValueElem.getAttribute(Tags.VALUE));
- FloatValue floatValue = new FloatValue(value);
- this.state.getTimeEvolution().setValueAt(time, floatValue);
- }
- }
+ NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
+ for (int i = 0; i < timeValueElems.getLength(); i++) {
+ Element timeValueElem = (Element) timeValueElems.item(i);
+ Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
+ Double value = Double.valueOf(timeValueElem.getAttribute(Tags.VALUE));
+ FloatValue floatValue = new FloatValue(value);
+ this.state.getTimeEvolution().setValueAt(time, floatValue);
+ }
+ }
- @Override
- public Element toDom(Document doc) {
+ @Override
+ public Element toDom(Document doc) {
- Element stateElement = doc.createElement(Tags.TIMED_STATE);
- super.fillElement(stateElement);
- SortedSet> values = this.state.getTimeEvolution().getValues();
- for (ITimeValue timeValue : values) {
- Long time = timeValue.getTime();
- FloatValue value = timeValue.getValue();
- Element valueElem = doc.createElement(Tags.VALUE);
- valueElem.setAttribute(Tags.TIME, time.toString());
- valueElem.setAttribute(Tags.VALUE, value.getValue().toString());
- stateElement.appendChild(valueElem);
- }
+ Element stateElement = doc.createElement(Tags.TIMED_STATE);
+ super.fillElement(stateElement);
+ SortedSet> values = this.state.getTimeEvolution().getValues();
+ for (ITimeValue timeValue : values) {
+ Long time = timeValue.getTime();
+ FloatValue value = timeValue.getValue();
+ Element valueElem = doc.createElement(Tags.VALUE);
+ valueElem.setAttribute(Tags.TIME, time.toString());
+ valueElem.setAttribute(Tags.VALUE, value.getValue().toString());
+ stateElement.appendChild(valueElem);
+ }
- return stateElement;
- }
+ return stateElement;
+ }
- @Override
- public String getType() {
- return TYPE;
- }
+ @Override
+ public String getType() {
+ return TYPE;
+ }
- @Override
- public StrolchElement getClone() {
- FloatTimedState clone = new FloatTimedState();
- fillClone(clone);
- return clone;
- }
+ @Override
+ public StrolchElement getClone() {
+ FloatTimedState clone = new FloatTimedState();
+ fillClone(clone);
+ return clone;
+ }
}
diff --git a/src/main/java/li/strolch/model/timedstate/ITimedState.java b/src/main/java/li/strolch/model/timedstate/ITimedState.java
index 6115a5b1e..42e765f17 100644
--- a/src/main/java/li/strolch/model/timedstate/ITimedState.java
+++ b/src/main/java/li/strolch/model/timedstate/ITimedState.java
@@ -22,11 +22,10 @@ import li.strolch.model.timevalue.IValueChange;
/**
* A time based state characterized by a {@link IValue} object implementation.
- *
+ *
* @author Martin Smock
- *
- * @param
- * IValue implementation representing the state at a given time
+ *
+ * @param IValue implementation representing the state at a given time
*/
@SuppressWarnings("rawtypes")
public interface ITimedState {
@@ -42,8 +41,7 @@ public interface ITimedState {
ITimeValue getPreviousMatch(final Long time, T value);
/**
- * @param change
- * the state change to be applied
+ * @param change the state change to be applied
*/
> void applyChange(final U change);
@@ -61,4 +59,4 @@ public interface ITimedState {
* @return a copy of this timed state
*/
ITimedState getCopy();
-}
\ No newline at end of file
+}
diff --git a/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java b/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java
index 31e7cec32..220c53b0b 100644
--- a/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java
+++ b/src/main/java/li/strolch/model/timedstate/IntegerTimedState.java
@@ -29,60 +29,60 @@ import org.w3c.dom.NodeList;
*/
public class IntegerTimedState extends AbstractStrolchTimedState {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- public static final String TYPE = "IntegerState";
+ public static final String TYPE = "IntegerState";
- public IntegerTimedState() {
- super();
- }
+ public IntegerTimedState() {
+ super();
+ }
- public IntegerTimedState(String id, String name) {
- super(id, name);
- }
+ public IntegerTimedState(String id, String name) {
+ super(id, name);
+ }
- public IntegerTimedState(Element element) {
- super.fromDom(element);
+ public IntegerTimedState(Element element) {
+ super.fromDom(element);
- this.state = new TimedState<>();
+ this.state = new TimedState<>();
- NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
- for (int i = 0; i < timeValueElems.getLength(); i++) {
- Element timeValueElem = (Element) timeValueElems.item(i);
- Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
- Integer value = Integer.valueOf(timeValueElem.getAttribute(Tags.VALUE));
- IntegerValue integerValue = new IntegerValue(value);
- this.state.getTimeEvolution().setValueAt(time, integerValue);
- }
- }
+ NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
+ for (int i = 0; i < timeValueElems.getLength(); i++) {
+ Element timeValueElem = (Element) timeValueElems.item(i);
+ Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
+ Integer value = Integer.valueOf(timeValueElem.getAttribute(Tags.VALUE));
+ IntegerValue integerValue = new IntegerValue(value);
+ this.state.getTimeEvolution().setValueAt(time, integerValue);
+ }
+ }
- @Override
- public Element toDom(Document doc) {
+ @Override
+ public Element toDom(Document doc) {
- Element stateElement = doc.createElement(Tags.TIMED_STATE);
- super.fillElement(stateElement);
- SortedSet> values = this.state.getTimeEvolution().getValues();
- for (ITimeValue timeValue : values) {
- Long time = timeValue.getTime();
- IntegerValue value = timeValue.getValue();
- Element valueElem = doc.createElement(Tags.VALUE);
- valueElem.setAttribute(Tags.TIME, time.toString());
- valueElem.setAttribute(Tags.VALUE, value.getValue().toString());
- stateElement.appendChild(valueElem);
- }
+ Element stateElement = doc.createElement(Tags.TIMED_STATE);
+ super.fillElement(stateElement);
+ SortedSet> values = this.state.getTimeEvolution().getValues();
+ for (ITimeValue timeValue : values) {
+ Long time = timeValue.getTime();
+ IntegerValue value = timeValue.getValue();
+ Element valueElem = doc.createElement(Tags.VALUE);
+ valueElem.setAttribute(Tags.TIME, time.toString());
+ valueElem.setAttribute(Tags.VALUE, value.getValue().toString());
+ stateElement.appendChild(valueElem);
+ }
- return stateElement;
- }
+ return stateElement;
+ }
- @Override
- public String getType() {
- return TYPE;
- }
+ @Override
+ public String getType() {
+ return TYPE;
+ }
- @Override
- public StrolchElement getClone() {
- IntegerTimedState clone = new IntegerTimedState();
- fillClone(clone);
- return clone;
- }
+ @Override
+ public StrolchElement getClone() {
+ IntegerTimedState clone = new IntegerTimedState();
+ fillClone(clone);
+ return clone;
+ }
}
diff --git a/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java b/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java
index 13722527e..99193c401 100644
--- a/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java
+++ b/src/main/java/li/strolch/model/timedstate/StringSetTimedState.java
@@ -33,79 +33,79 @@ import org.w3c.dom.NodeList;
*/
public class StringSetTimedState extends AbstractStrolchTimedState {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- public static final String TYPE = "StringSetState";
+ public static final String TYPE = "StringSetState";
- public StringSetTimedState() {
- super();
- }
+ public StringSetTimedState() {
+ super();
+ }
- public StringSetTimedState(String id, String name) {
- super(id, name);
- }
+ public StringSetTimedState(String id, String name) {
+ super(id, name);
+ }
- public StringSetTimedState(Element element) {
- super.fromDom(element);
+ public StringSetTimedState(Element element) {
+ super.fromDom(element);
- this.state = new TimedState<>();
+ this.state = new TimedState<>();
- NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
- for (int i = 0; i < timeValueElems.getLength(); i++) {
- Element timeValueElem = (Element) timeValueElems.item(i);
- Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
+ NodeList timeValueElems = element.getElementsByTagName(Tags.VALUE);
+ for (int i = 0; i < timeValueElems.getLength(); i++) {
+ Element timeValueElem = (Element) timeValueElems.item(i);
+ Long time = Long.valueOf(timeValueElem.getAttribute(Tags.TIME));
- String valueAsString = timeValueElem.getAttribute(Tags.VALUE);
- Set value = new HashSet<>();
- String[] values = valueAsString.split(",");
- for (String s : values) {
- value.add(new AString(s.trim()));
- }
+ String valueAsString = timeValueElem.getAttribute(Tags.VALUE);
+ Set value = new HashSet<>();
+ String[] values = valueAsString.split(",");
+ for (String s : values) {
+ value.add(new AString(s.trim()));
+ }
- StringSetValue integerValue = new StringSetValue(value);
- this.state.getTimeEvolution().setValueAt(time, integerValue);
- }
- }
+ StringSetValue integerValue = new StringSetValue(value);
+ this.state.getTimeEvolution().setValueAt(time, integerValue);
+ }
+ }
- @Override
- public Element toDom(Document doc) {
+ @Override
+ public Element toDom(Document doc) {
- Element stateElement = doc.createElement(Tags.TIMED_STATE);
- super.fillElement(stateElement);
- SortedSet> values = this.state.getTimeEvolution().getValues();
- for (ITimeValue timeValue : values) {
- Long time = timeValue.getTime();
- StringSetValue stringSetValue = timeValue.getValue();
+ Element stateElement = doc.createElement(Tags.TIMED_STATE);
+ super.fillElement(stateElement);
+ SortedSet> values = this.state.getTimeEvolution().getValues();
+ for (ITimeValue timeValue : values) {
+ Long time = timeValue.getTime();
+ StringSetValue stringSetValue = timeValue.getValue();
- Set value = stringSetValue.getValue();
- StringBuilder sb = new StringBuilder();
- Iterator iter = value.iterator();
- while (iter.hasNext()) {
- sb.append(iter.next().getString());
- if (iter.hasNext()) {
- sb.append(", ");
- }
- }
- String valueAsString = sb.toString();
+ Set value = stringSetValue.getValue();
+ StringBuilder sb = new StringBuilder();
+ Iterator iter = value.iterator();
+ while (iter.hasNext()) {
+ sb.append(iter.next().getString());
+ if (iter.hasNext()) {
+ sb.append(", ");
+ }
+ }
+ String valueAsString = sb.toString();
- Element valueElem = doc.createElement(Tags.VALUE);
- valueElem.setAttribute(Tags.TIME, time.toString());
- valueElem.setAttribute(Tags.VALUE, valueAsString);
- stateElement.appendChild(valueElem);
- }
+ Element valueElem = doc.createElement(Tags.VALUE);
+ valueElem.setAttribute(Tags.TIME, time.toString());
+ valueElem.setAttribute(Tags.VALUE, valueAsString);
+ stateElement.appendChild(valueElem);
+ }
- return stateElement;
- }
+ return stateElement;
+ }
- @Override
- public String getType() {
- return TYPE;
- }
+ @Override
+ public String getType() {
+ return TYPE;
+ }
- @Override
- public StrolchElement getClone() {
- StringSetTimedState clone = new StringSetTimedState();
- fillClone(clone);
- return clone;
- }
+ @Override
+ public StrolchElement getClone() {
+ StringSetTimedState clone = new StringSetTimedState();
+ fillClone(clone);
+ return clone;
+ }
}
diff --git a/src/main/java/li/strolch/model/timedstate/StrolchTimedState.java b/src/main/java/li/strolch/model/timedstate/StrolchTimedState.java
index f2ab09454..f70d406c3 100644
--- a/src/main/java/li/strolch/model/timedstate/StrolchTimedState.java
+++ b/src/main/java/li/strolch/model/timedstate/StrolchTimedState.java
@@ -38,5 +38,5 @@ public interface StrolchTimedState extends StrolchElement {
public ITimeVariable getTimeEvolution();
- public void setParent(Resource aThis);
+ public void setParent(Resource aThis);
}
diff --git a/src/main/java/li/strolch/model/timevalue/ITimeValue.java b/src/main/java/li/strolch/model/timevalue/ITimeValue.java
index de87f9190..97e9c9643 100644
--- a/src/main/java/li/strolch/model/timevalue/ITimeValue.java
+++ b/src/main/java/li/strolch/model/timevalue/ITimeValue.java
@@ -19,11 +19,10 @@ import li.strolch.model.timevalue.impl.TimeVariable;
/**
* Interface for timed value objects to be used with the {@link TimeVariable}
- *
+ *
* @author Martin Smock
- *
- * @param
- * the backing value of the timed value object
+ *
+ * @param the backing value of the timed value object
*/
@SuppressWarnings("rawtypes")
public interface ITimeValue extends Comparable> {
diff --git a/src/main/java/li/strolch/model/timevalue/ITimeVariable.java b/src/main/java/li/strolch/model/timevalue/ITimeVariable.java
index 0e7347f79..f16f9aeb8 100644
--- a/src/main/java/li/strolch/model/timevalue/ITimeVariable.java
+++ b/src/main/java/li/strolch/model/timevalue/ITimeVariable.java
@@ -20,22 +20,19 @@ import java.util.SortedSet;
/**
* A timed variable storing a ordered sequence of {@link ITimeValue} objects modeling a time evolution of a quantity.
- *
+ *
* @author Martin Smock
- *
- * @param
- * the backing value of the timed value object
+ *
+ * @param the backing value of the timed value object
*/
@SuppressWarnings("rawtypes")
public interface ITimeVariable {
/**
* set the value at a point in time to a given time value object
- *
- * @param time
- * the time to set the {@link IValue}
- * @param value
- * the {@link IValue} to set
+ *
+ * @param time the time to set the {@link IValue}
+ * @param value the {@link IValue} to set
*/
void setValueAt(final Long time, final T value);
@@ -46,33 +43,30 @@ public interface ITimeVariable {
/**
* Applies a {@link IValueChange} propagating the change to all future values starting from the time of the change.
- *
- * @param change
- * the {@link IValueChange} to be applied
+ *
+ * @param change the {@link IValueChange} to be applied
*/
void applyChange(final IValueChange change);
/**
* Get all {@link ITimeValue} objects whose time field is greater or equal to the given time
- *
- * @param time
- * the time the sequence starts with
+ *
+ * @param time the time the sequence starts with
* @return the sequence of {@link ITimeValue} objects in the future
*/
Collection> getFutureValues(final Long time);
/**
* Get all {@link ITimeValue} objects whose time field is strictly smaller than the given time
- *
- * @param time
- * the time the sequence starts with
+ *
+ * @param time the time the sequence starts with
* @return the sequence of {@link ITimeValue} objects in the future
*/
Collection> getPastValues(final Long time);
/**
* Get all {@link ITimeValue} objects
- *
+ *
* @return a defensive copy of the {@link ITimeValue}s
*/
SortedSet> getValues();
diff --git a/src/main/java/li/strolch/model/timevalue/IValue.java b/src/main/java/li/strolch/model/timevalue/IValue.java
index 83446b94a..94f1d6074 100644
--- a/src/main/java/li/strolch/model/timevalue/IValue.java
+++ b/src/main/java/li/strolch/model/timevalue/IValue.java
@@ -16,13 +16,12 @@
package li.strolch.model.timevalue;
/**
- * A value object defining some basic algebraic operations. Mathematically
- * speaking {@link IValue} objects define a group with a addition operation.
- *
+ * A value object defining some basic algebraic operations. Mathematically speaking {@link IValue} objects define a
+ * group with a addition operation.
+ *
* @author Martin Smock
- *
- * @param
- * any object for which a (generalized) add operation can be defined.
+ *
+ * @param any object for which a (generalized) add operation can be defined.
*/
public interface IValue {
@@ -42,8 +41,7 @@ public interface IValue {
boolean matches(IValue other);
/**
- * @return the inverse value, such that add(value.getInverse()) returns the
- * neutral element of the group
+ * @return the inverse value, such that add(value.getInverse()) returns the neutral element of the group
*/
IValue getInverse();
diff --git a/src/main/java/li/strolch/model/timevalue/IValueChange.java b/src/main/java/li/strolch/model/timevalue/IValueChange.java
index c4e391cd3..3821f7913 100644
--- a/src/main/java/li/strolch/model/timevalue/IValueChange.java
+++ b/src/main/java/li/strolch/model/timevalue/IValueChange.java
@@ -16,9 +16,8 @@
package li.strolch.model.timevalue;
/**
- * Interface for operators to be used to change the values of {@link ITimeValue}
- * in a {@link ITimeVariable}.
- *
+ * Interface for operators to be used to change the values of {@link ITimeValue} in a {@link ITimeVariable}.
+ *
* @author Martin Smock
*/
@SuppressWarnings("rawtypes")
@@ -35,8 +34,7 @@ public interface IValueChange {
T getValue();
/**
- * @return the inverse neutralizing a change. Very useful to undo changes
- * applied.
+ * @return the inverse neutralizing a change. Very useful to undo changes applied.
*/
IValueChange getInverse();
diff --git a/src/main/java/li/strolch/model/timevalue/impl/AString.java b/src/main/java/li/strolch/model/timevalue/impl/AString.java
index e66567552..5626bef3a 100644
--- a/src/main/java/li/strolch/model/timevalue/impl/AString.java
+++ b/src/main/java/li/strolch/model/timevalue/impl/AString.java
@@ -18,15 +18,14 @@ package li.strolch.model.timevalue.impl;
import java.io.Serializable;
/**
- * Wrapper for java.util.String object defining a inverse to support algebraic
- * operations.
- *
+ * Wrapper for java.util.String object defining a inverse to support algebraic operations.
+ *
* @author Martin Smock
*/
public class AString implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
+
private final String string;
private final boolean inverse;
@@ -63,20 +62,26 @@ public class AString implements Serializable {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
AString other = (AString) obj;
- if (this.inverse != other.inverse)
+ if (this.inverse != other.inverse) {
return false;
+ }
if (this.string == null) {
- if (other.string != null)
+ if (other.string != null) {
return false;
- } else if (!this.string.equals(other.string))
+ }
+ } else if (!this.string.equals(other.string)) {
return false;
+ }
return true;
}
diff --git a/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java b/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java
index bde39dab3..10bc9cbe0 100644
--- a/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java
+++ b/src/main/java/li/strolch/model/timevalue/impl/BooleanValue.java
@@ -22,7 +22,7 @@ import li.strolch.model.timevalue.IValue;
/**
* {@link IValue} implementation to work with Boolean valued {@link ITimeValue} objects
- *
+ *
* @author Martin Smock
*/
public class BooleanValue implements IValue, Serializable {
@@ -91,18 +91,23 @@ public class BooleanValue implements IValue, Serializable {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
BooleanValue other = (BooleanValue) obj;
if (this.value == null) {
- if (other.value != null)
+ if (other.value != null) {
return false;
- } else if (!this.value.equals(other.value))
+ }
+ } else if (!this.value.equals(other.value)) {
return false;
+ }
return true;
}
}
diff --git a/src/main/java/li/strolch/model/timevalue/impl/FloatValue.java b/src/main/java/li/strolch/model/timevalue/impl/FloatValue.java
index 98209b787..452686870 100644
--- a/src/main/java/li/strolch/model/timevalue/impl/FloatValue.java
+++ b/src/main/java/li/strolch/model/timevalue/impl/FloatValue.java
@@ -22,7 +22,7 @@ import li.strolch.model.timevalue.IValue;
/**
* {@link IValue} implementation to work with Double valued {@link ITimeValue} objects
- *
+ *
* @author Martin Smock
*/
public class FloatValue implements IValue, Serializable {
@@ -85,8 +85,8 @@ public class FloatValue implements IValue, Serializable {
}
@Override
- public FloatValue getCopy(){
- return new FloatValue(this.value);
+ public FloatValue getCopy() {
+ return new FloatValue(this.value);
}
@Override
@@ -99,20 +99,24 @@ public class FloatValue implements IValue, Serializable {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
FloatValue other = (FloatValue) obj;
if (this.value == null) {
- if (other.value != null)
+ if (other.value != null) {
return false;
- } else if (!this.value.equals(other.value))
+ }
+ } else if (!this.value.equals(other.value)) {
return false;
+ }
return true;
}
-
}
diff --git a/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java b/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java
index 50bb2abd2..da7936f64 100644
--- a/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java
+++ b/src/main/java/li/strolch/model/timevalue/impl/IntegerValue.java
@@ -22,7 +22,7 @@ import li.strolch.model.timevalue.IValue;
/**
* {@link IValue} implementation to work with Integer valued {@link ITimeValue} objects
- *
+ *
* @author Martin Smock
*/
public class IntegerValue implements IValue, Serializable {
@@ -91,18 +91,23 @@ public class IntegerValue implements IValue, Serializable {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
IntegerValue other = (IntegerValue) obj;
if (this.value == null) {
- if (other.value != null)
+ if (other.value != null) {
return false;
- } else if (!this.value.equals(other.value))
+ }
+ } else if (!this.value.equals(other.value)) {
return false;
+ }
return true;
}
diff --git a/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java b/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java
index b754b5c1e..76bb82284 100644
--- a/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java
+++ b/src/main/java/li/strolch/model/timevalue/impl/StringSetValue.java
@@ -33,85 +33,85 @@ import li.strolch.model.timevalue.IValue;
*/
public class StringSetValue implements IValue>, Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- private static Set neu = Collections.emptySet();
- public static final IValue> NEUTRAL = new StringSetValue(neu);
+ private static Set neu = Collections.emptySet();
+ public static final IValue> NEUTRAL = new StringSetValue(neu);
- private Set aStrings = new HashSet<>();
+ private Set aStrings = new HashSet<>();
- public StringSetValue() {
- }
+ public StringSetValue() {
+ }
- public StringSetValue(final Set aStrings) {
- // assert no null values in set
- for (AString aString : aStrings) {
- if (StringHelper.isEmpty(aString.getString())) {
- throw new StrolchException("StringSetValue may not contain null values in set!");
- }
- }
- this.aStrings = aStrings;
- }
+ public StringSetValue(final Set aStrings) {
+ // assert no null values in set
+ for (AString aString : aStrings) {
+ if (StringHelper.isEmpty(aString.getString())) {
+ throw new StrolchException("StringSetValue may not contain null values in set!");
+ }
+ }
+ this.aStrings = aStrings;
+ }
- @Override
- public Set getValue() {
- return this.aStrings;
- }
+ @Override
+ public Set getValue() {
+ return this.aStrings;
+ }
- @Override
- public IValue> add(Set o) {
+ @Override
+ public IValue> add(Set o) {
- Set toBeAdded = new HashSet<>(o);
+ Set toBeAdded = new HashSet<>(o);
- for (Iterator iter1 = toBeAdded.iterator(); iter1.hasNext();) {
- AString toAdd = iter1.next();
- if (StringHelper.isEmpty(toAdd.getString())) {
- throw new StrolchException("StringSetValue may not contain null values in set!");
- }
+ for (Iterator iter1 = toBeAdded.iterator(); iter1.hasNext();) {
+ AString toAdd = iter1.next();
+ if (StringHelper.isEmpty(toAdd.getString())) {
+ throw new StrolchException("StringSetValue may not contain null values in set!");
+ }
- for (Iterator iter = this.aStrings.iterator(); iter.hasNext();) {
- AString aString = iter.next();
- boolean valueMatch = aString.getString().equals(toAdd.getString());
- boolean compensate = (toAdd.isInverse() && !aString.isInverse())
- || (!toAdd.isInverse() && aString.isInverse());
- if (valueMatch && compensate) {
- iter.remove();
- iter1.remove();
- }
- }
- }
- this.aStrings.addAll(toBeAdded);
- return this;
- }
+ for (Iterator iter = this.aStrings.iterator(); iter.hasNext();) {
+ AString aString = iter.next();
+ boolean valueMatch = aString.getString().equals(toAdd.getString());
+ boolean compensate = (toAdd.isInverse() && !aString.isInverse())
+ || (!toAdd.isInverse() && aString.isInverse());
+ if (valueMatch && compensate) {
+ iter.remove();
+ iter1.remove();
+ }
+ }
+ }
+ this.aStrings.addAll(toBeAdded);
+ return this;
+ }
- @Override
- public boolean matches(IValue> other) {
- return getValue().equals(other.getValue());
- }
+ @Override
+ public boolean matches(IValue> other) {
+ return getValue().equals(other.getValue());
+ }
- @Override
- public StringSetValue getInverse() {
- Set inverseSet = new HashSet<>();
- for (AString as : this.aStrings) {
- inverseSet.add(as.getInverse());
- }
- StringSetValue inverse = new StringSetValue();
- inverse.aStrings = inverseSet;
- return inverse;
- }
+ @Override
+ public StringSetValue getInverse() {
+ Set inverseSet = new HashSet<>();
+ for (AString as : this.aStrings) {
+ inverseSet.add(as.getInverse());
+ }
+ StringSetValue inverse = new StringSetValue();
+ inverse.aStrings = inverseSet;
+ return inverse;
+ }
- @Override
- public StringSetValue getCopy() {
- return new StringSetValue(new HashSet<>(this.aStrings));
- }
+ @Override
+ public StringSetValue getCopy() {
+ return new StringSetValue(new HashSet<>(this.aStrings));
+ }
- @SuppressWarnings("nls")
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("StringSetValue [aStrings=");
- sb.append(this.aStrings);
- sb.append("]");
- return sb.toString();
- }
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("StringSetValue [aStrings=");
+ sb.append(this.aStrings);
+ sb.append("]");
+ return sb.toString();
+ }
}
diff --git a/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java b/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java
index c400c7ba4..9af00ffe2 100644
--- a/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java
+++ b/src/main/java/li/strolch/model/timevalue/impl/TimeValue.java
@@ -98,24 +98,31 @@ public class TimeValue implements ITimeValue