/* Copyright (c) 1997-2004
 Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
 http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.de
 
 This program 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, or (at your option) any
 later version: http://www.gnu.org/licenses/gpl.txt.
 
 This program 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.
 
 $Project: polymake $$Id: PolymakePoint.java,v 1.3 2005/11/01 09:15:11 thilosch Exp $
 */

package de.tuberlin.polymake.common;


public class PolymakePoint {
	
	/** the name of the pointset */
	protected String label;
	
	/** */
	protected double[] coords;
	
	public PolymakePoint(double[] coords, String label) {
		this.coords = new double[coords.length];
		System.arraycopy(coords,0,this.coords,0,coords.length);
		this.label = label;
	}
	
	public PolymakePoint(double[] coords) {
		this.coords = new double[coords.length];
		System.arraycopy(coords,0,this.coords,0,coords.length);
		label = null;
	}
	
	public double[] getCoords() {
		return coords;
	}
	
	public String getLabel() {
		return label;
	}
	
	public String toString() {
		String s = new String();
		s += "label: " + label + "\n";
		s += "coords: " ;
		for(int i = 0; i < coords.length; ++i)
			s += " " + coords[i] ;
		s += "\n";
		return s;
	}
}
