Skip to content

Commit

Permalink
add some Javadocs and fix Licence.txt space
Browse files Browse the repository at this point in the history
Former-commit-id: bb2eb55
  • Loading branch information
Stefan Lindel committed Aug 29, 2014
1 parent 35e62e9 commit e5e6f59
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions check.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="findBugs" name="Create Jar for NetworkParser" xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<project default="checkStyle" name="Create Jar for NetworkParser" xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<target name="checkStyle">
<taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-5.7/checkstyle-5.7-all.jar" />
<checkstyle config="lib/checkstyle-5.7/sun_checks.xml" >
<fileset dir="src/" includes="**/*.java"/>
<fileset dir="src/main/java" includes="**/*.java"/>
<!-- Location of cache-file. Something that is project specific -->
<property key="checkstyle.cache.file" file="target/cachefile"/>
<property key="LineLength.max" value="200"></property>
Expand Down
2 changes: 1 addition & 1 deletion src/Ant/de/uniks/networkparser/test/build/Licence.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/de/uniks/networkparser/AbstractEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -29,6 +29,14 @@
permissions and limitations under the Licence.
*/

/**
* AbstractEntity is a Simple KeyValue - Object.
*
* @author Stefan Lindel
*
* @param <K> Key Element
* @param <V> Value Element
*/
public abstract class AbstractEntity<K, V> implements BaseItem, Entry<K, V>, SendableEntityCreator, SendableEntityCreatorNoIndex {
public static final String PROPERTY_KEY = "key";
public static final String PROPERTY_VALUE = "value";
Expand Down Expand Up @@ -181,4 +189,4 @@ public boolean setValue(Object entity, String attribute, Object value,
}
return false;
}
}
}
8 changes: 2 additions & 6 deletions src/main/java/de/uniks/networkparser/AbstractList.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 extends AbstractList<V>> ST withAllowDuplicate(boolean allowDuplicate) {
this.allowDuplicate = allowDuplicate;
return (ST)this;
return (ST) this;
}

/**
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/uniks/networkparser/xml/XMLEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/test/java/de/uniks/networkparser/test/ColumnTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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());
Expand Down

0 comments on commit e5e6f59

Please sign in to comment.