package de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes;

import de.uni_stuttgart.vis.vowl.owl2vowl.model.AbstractEntity;

import org.semanticweb.owlapi.model.IRI;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public abstract class AbstractNode extends AbstractEntity implements HasUnions, HasIntersections, HasComplement {

	private IRI complement;
	private Set<IRI> intersectionElements = new HashSet<>();
	private Set<IRI> unionElements = new HashSet<>();

	protected AbstractNode(IRI iri, String type) {
		super(iri, type);
	}

	@Override
	public IRI getComplement() {
		return complement;
	}

	@Override
	public void setComplement(IRI complement) {
		this.complement = complement;
	}

	@Override
	public void addElementToIntersection(IRI iri) {
		intersectionElements.add(iri);
	}

	@Override
	public Set<IRI> getElementOfIntersection() {
		return Collections.unmodifiableSet(intersectionElements);
	}

	@Override
	public void addElementToUnion(IRI iri) {
		unionElements.add(iri);
	}

	@Override
	public Set<IRI> getElementsOfUnion() {
		return Collections.unmodifiableSet(unionElements);
	}
}

@@ -114,17 +114,16 @@
 Entity;%0A
-%0A
 import o
@@ -488,75 +488,336 @@
 ();%0A
-%0A%09protected AbstractNode(IRI iri, String type) %7B%0A%09%09super(iri, type)
+%09private Set%3CIRI%3E inGoingProperties = new HashSet%3C%3E();%0A%09private Set%3CIRI%3E outGoingProperties = new HashSet%3C%3E();%0A%0A%09protected AbstractNode(IRI iri, String type) %7B%0A%09%09super(iri, type);%0A%09%7D%0A%0A%09public Set%3CIRI%3E getInGoingProperties() %7B%0A%09%09return inGoingProperties;%0A%09%7D%0A%0A%09public Set%3CIRI%3E getOutGoingProperties() %7B%0A%09%09return outGoingProperties
 ;%0A%09%7D
@@ -1383,11 +1383,187 @@
 nts);%0A%09%7D
+%0A%0A%09public void addInGoingProperty(IRI property) %7B%0A%09%09inGoingProperties.add(property);%0A%09%7D%0A%0A%09public void addOutGoingProperty(IRI property) %7B%0A%09%09outGoingProperties.add(property);%0A%09%7D
 %0A%7D%0A

Add field to nodes for in-/outgoing properties