From e5e6f59fbe6e29f2187341bee426ff1b52e3aa6b Mon Sep 17 00:00:00 2001 From: Stefan Lindel Date: Fri, 29 Aug 2014 15:08:09 +0200 Subject: [PATCH] add some Javadocs and fix Licence.txt space Former-commit-id: bb2eb55455a54d6c7014298b60f74f154d4e5545 --- check.xml | 4 ++-- .../de/uniks/networkparser/test/build/Licence.txt | 2 +- .../java/de/uniks/networkparser/AbstractEntity.java | 12 ++++++++++-- .../java/de/uniks/networkparser/AbstractList.java | 8 ++------ .../java/de/uniks/networkparser/xml/XMLEntity.java | 2 +- .../java/de/uniks/networkparser/test/ColumnTest.java | 7 ++++++- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/check.xml b/check.xml index 73af9674e..e42783e4f 100644 --- a/check.xml +++ b/check.xml @@ -1,9 +1,9 @@ - + - + diff --git a/src/Ant/de/uniks/networkparser/test/build/Licence.txt b/src/Ant/de/uniks/networkparser/test/build/Licence.txt index 4fb24f0ba..9a0cad986 100644 --- a/src/Ant/de/uniks/networkparser/test/build/Licence.txt +++ b/src/Ant/de/uniks/networkparser/test/build/Licence.txt @@ -2,7 +2,7 @@ NetworkParser Copyright (c) 2011 - 2013, Stefan Lindel All rights reserved. - + Licensed under the EUPL, Version 1.1 or (as soon they will be approved by the European Commission) subsequent versions of the EUPL (the "Licence"); diff --git a/src/main/java/de/uniks/networkparser/AbstractEntity.java b/src/main/java/de/uniks/networkparser/AbstractEntity.java index f980630e8..1dec715be 100644 --- a/src/main/java/de/uniks/networkparser/AbstractEntity.java +++ b/src/main/java/de/uniks/networkparser/AbstractEntity.java @@ -11,7 +11,7 @@ NetworkParser Copyright (c) 2011 - 2013, Stefan Lindel All rights reserved. - + Licensed under the EUPL, Version 1.1 or (as soon they will be approved by the European Commission) subsequent versions of the EUPL (the "Licence"); @@ -29,6 +29,14 @@ permissions and limitations under the Licence. */ +/** + * AbstractEntity is a Simple KeyValue - Object. + * + * @author Stefan Lindel + * + * @param Key Element + * @param Value Element + */ public abstract class AbstractEntity implements BaseItem, Entry, SendableEntityCreator, SendableEntityCreatorNoIndex { public static final String PROPERTY_KEY = "key"; public static final String PROPERTY_VALUE = "value"; @@ -181,4 +189,4 @@ public boolean setValue(Object entity, String attribute, Object value, } return false; } -} \ No newline at end of file +} diff --git a/src/main/java/de/uniks/networkparser/AbstractList.java b/src/main/java/de/uniks/networkparser/AbstractList.java index 8c0d55e1a..edad9c9f4 100644 --- a/src/main/java/de/uniks/networkparser/AbstractList.java +++ b/src/main/java/de/uniks/networkparser/AbstractList.java @@ -493,15 +493,10 @@ public boolean isAllowDuplicate() { return allowDuplicate; } - /** - * Set the Flag for Duplicate Entities - * @param allowDuplicate isAllowDuplicate - * @return the List - */ @SuppressWarnings("unchecked") public > ST withAllowDuplicate(boolean allowDuplicate) { this.allowDuplicate = allowDuplicate; - return (ST)this; + return (ST) this; } /** @@ -693,6 +688,7 @@ public int getPositionKey(Object o) /** * Get the HashKey from a Object with Max HashTableIndex and StepSize of EntitySize * @param hashKey the hashKey of a Object + * @param len the max Length of all Hashvalues * @return the hasKey */ public int hashKey(int hashKey, int len) diff --git a/src/main/java/de/uniks/networkparser/xml/XMLEntity.java b/src/main/java/de/uniks/networkparser/xml/XMLEntity.java index 016670fc1..be1bcb528 100644 --- a/src/main/java/de/uniks/networkparser/xml/XMLEntity.java +++ b/src/main/java/de/uniks/networkparser/xml/XMLEntity.java @@ -165,7 +165,7 @@ public String getValueItem() { * * @param value * the new value - * @return + * @return the XMLEntity Instance */ public XMLEntity withValueItem(String value) { this.value = value; diff --git a/src/test/java/de/uniks/networkparser/test/ColumnTest.java b/src/test/java/de/uniks/networkparser/test/ColumnTest.java index 3cd53700c..e7bed61b0 100644 --- a/src/test/java/de/uniks/networkparser/test/ColumnTest.java +++ b/src/test/java/de/uniks/networkparser/test/ColumnTest.java @@ -7,6 +7,7 @@ import de.uniks.networkparser.gui.table.Column; import de.uniks.networkparser.gui.table.ColumnListener; import de.uniks.networkparser.gui.table.util.ColumnCreator; +import de.uniks.networkparser.interfaces.GUIPosition; import de.uniks.networkparser.interfaces.SendableEntityCreator; import de.uniks.networkparser.json.JsonIdMap; @@ -22,7 +23,11 @@ public void testColumn(){ @Test public void testColumnSerialization(){ - Column column=new Column().withAttrName("Name"); + Column column=new Column().withAttrName("Name").withResizable(true); + column.withVisible(true); + column.withMovable(true); + Assert.assertEquals(column.getBrowserId(), GUIPosition.CENTER); + JsonIdMap map=(JsonIdMap) new JsonIdMap().withCreator(new ColumnCreator()); Assert.assertEquals("{\"class\":\"de.uniks.networkparser.gui.table.Column\",\"id\":\"J1.C1\",\"prop\":{\"attrName\":\"Name\"}}", map.toJsonObject(column).toString());