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

it.vige.cities.result.Nodes Maven / Gradle / Ivy

The newest version!
package it.vige.cities.result;

import static java.util.stream.Collectors.toList;

import java.util.ArrayList;
import java.util.List;

/**
 * Nodes containing the informations of the cities from the providers
 * @author lucastancapiano
 */
public class Nodes implements Cloneable {

	/**
	 * Separator for id node
	 */
	public final static String ID_SEPARATOR = "-";
	
	private List zones = new ArrayList();
	
	/**
	 * default nodes
	 */
	public Nodes() {
		
	}

	/**
	 * Zones
	 * @return the list of nodes
	 */
	public List getZones() {
		return zones;
	}

	/**
	 * Zones
	 * @param zones the list of zones
	 */
	public void setZones(List zones) {
		this.zones = zones;
	}

	@Override
	public Object clone() {
		try {
			Nodes nodes = (Nodes) super.clone();
			List zones = nodes.getZones();
			nodes.setZones(zones.parallelStream().map(p -> (Node) p.clone()).collect(toList()));
			return nodes;
		} catch (CloneNotSupportedException e) {
			return null;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy