001/* 002 * PointGeometry -- Interface for geometry elements that contain only points. 003 * 004 * Copyright (C) 2009-2015, Joseph A. Huwaldt 005 * All rights reserved. 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * You should have received a copy of the GNU Lesser General Public License 018 * along with this program; if not, write to the Free Software 019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 020 * Or visit: http://www.gnu.org/licenses/lgpl.html 021 */ 022package geomss.geom; 023 024import javax.measure.converter.ConversionException; 025import javax.measure.quantity.Length; 026import javax.measure.unit.Unit; 027 028/** 029 * Defines the interface for {@link GeomElement} objects that contain only points. 030 * 031 * <p> Modified by: Joseph A. Huwaldt</p> 032 * 033 * @author Joseph A. Huwaldt, Date: March 31, 2000 034 * @version September 3, 2015 035 * 036 * @param <T> The sub-type of this PointGeometry object. 037 */ 038public interface PointGeometry<T extends PointGeometry> extends GeomElement<T> { 039 040 /** 041 * Return the total number of points in this geometry element. 042 * 043 * @return The total number of points in this geometry element. 044 */ 045 public int getNumberOfPoints(); 046 047 /** 048 * Returns the equivalent to this point geometry object but stated in the specified 049 * unit. 050 * 051 * @param unit the length unit of the point geometry to be returned. 052 * @return an equivalent to this point geometry object but stated in the specified 053 * unit. 054 * @throws ConversionException if the the input unit is not a length unit. 055 */ 056 @Override 057 public T to(Unit<Length> unit) throws ConversionException; 058}