/*
 * Copyright 2009, 2010, 2011, 2012 Contributors (see credits.txt)
 *
 * This file is part of jEveAssets.
 *
 * jEveAssets is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * jEveAssets is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with jEveAssets; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 */

package net.nikr.eve.jeveasset.gui.tabs.overview;

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


public class OverviewGroup {
	private List<OverviewLocation> locations;
	private String name;

	public OverviewGroup(final String name) {
		this.name = name;
		locations = new ArrayList<OverviewLocation>();
	}

	public void add(final OverviewLocation location) {
		if (locations.contains(location)) {
			locations.remove(location);
		}
		locations.add(location);
	}

	public void addAll(final List<OverviewLocation> list) {
		for (OverviewLocation location : list) {
			add(location);
		}
	}

	public void remove(final OverviewLocation location) {
		locations.remove(location);
	}
	public void removeAll(final List<OverviewLocation> list) {
		locations.removeAll(list);
	}

	public List<OverviewLocation> getLocations() {
		return locations;
	}

	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return name;
	}
}
