I have the Java app which takes some rdf dataset as input and works on this data.
I used TreeMap
in which the key is instance name and the value is TreeSet
including the list of properties that instance have and the int which let us .
static TreeMap<String, TreeSet<PropertyIsTyped>> instanceListPropertiesTreeMap = new TreeMap<String, TreeSet<PropertyIsTyped>>();
String instancemapKey = s[0];
TreeSet<PropertyIsTyped> setOfPropertiesPerInstance = new TreeSet<PropertyIsTyped>();
if (instanceListPropertiesTreeMap.get(instancemapKey) == null) {
setOfPropertiesPerInstance.add(new PropertyIsTyped(s[1], 1));
instanceListPropertiesTreeMap.put(instancemapKey, setOfPropertiesPerInstance);
} else if (instanceListPropertiesTreeMap.get(instancemapKey) != null
&& !setOfPropertiesPerInstance.contains(s[1])) {
setOfPropertiesPerInstance = instanceListPropertiesTreeMap.get(instancemapKey);
PropertyIsTyped currentListproperties = new PropertyIsTyped(s[1], 1);
setOfPropertiesPerInstance.add(currentListproperties);
}
On the other hand my PropertyIsTyped
class is like:
public class PropertyIsTyped {
public int isTyped;
public List<String> PropertySet;
public PropertyIsTyped(String properties, int typevalue) {
// this.propertyId = id;
if (properties != "")
PropertySet.add(properties);
if (typevalue == 1) {
this.isTyped = 1;
} else {
this.isTyped = 0;
}
}
}
Problem: When I give my data set when it wants to insert my new propeties in my List PropertySet it gives my the NullpointerExceptionError
Any Ideas?