All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nasdanika.graph.SimpleNode Maven / Gradle / Ivy

There is a newer version: 2024.10.0
Show newest version
package org.nasdanika.graph;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

/**
 * A node implementation with synchronized collections of incoming and outgoing connections. 
 * Outgoing connections are treated as node children.
 * Treats 
 */
public class SimpleNode implements Node {
	
	private Collection incomingConnections = Collections.synchronizedCollection(new ArrayList<>());
	private Collection outgoingConnections = Collections.synchronizedCollection(new ArrayList<>());
			
	@Override
	public Collection getIncomingConnections() {
		return incomingConnections;
	}
	@Override
	public Collection getOutgoingConnections() {
		return outgoingConnections;
	}
	
	@Override
	public Collection getChildren() {
		return getOutgoingConnections();
	}	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy