001/** 002 Returns a new <code>PointString</code> that can store a list of <code>GeomPoint</code> 003 objects. The versions showing the array input actually take a variable length argument 004 list (vararg), so you can enter <code>newPointString(geom1, geom2, geom3, geom4)</code>, etc. 005 006 @method PointString newPointString() 007 @method PointString newPointString(String name) 008 @method PointString newPointString(Collection points) 009 @method PointString newPointString(String name, Collection points) 010 @method PointString newPointString(GeomPoint point) 011 @method PointString newPointString(String name, PointString pointString) 012 @method PointString newPointString(GeomPoint... pointVararg) 013 @method PointString newPointString(String name, GeomPoint... pointVararg) 014 */ 015package geomss.app.GeomSSCommands.creators; 016 017import bsh.*; 018import geomss.geom.GeomPoint; 019import geomss.geom.PointString; 020import java.util.Collection; 021 022public class newPointString { 023 024 public static String usage() { 025 return "usage: newPointString();, or newPointString(geometry);, or newPointString(geomVararg);"; 026 } 027 028 /** 029 * Implement newPointString() command. 030 */ 031 public static PointString invoke(Interpreter env, CallStack callstack) { 032 return PointString.newInstance(); 033 } 034 035 /** 036 * Implement newPointString(String name) command. 037 */ 038 public static PointString invoke(Interpreter env, CallStack callstack, String name) { 039 return PointString.newInstance(name); 040 } 041 042 /** 043 * Implement newPointString(Collection points) command. 044 */ 045 public static PointString invoke(Interpreter env, CallStack callstack, Collection points) { 046 return PointString.valueOf(null, points); 047 } 048 049 /** 050 * Implement newPointString(Collection points) command. 051 */ 052 public static PointString invoke(Interpreter env, CallStack callstack, 053 String name, Collection points) { 054 return PointString.valueOf(name, points); 055 } 056 057 /** 058 * Implement newPointString(PointString... pointStringVararg) command. 059 */ 060 public static PointString invoke(Interpreter env, CallStack callstack, 061 GeomPoint... pointVararg) { 062 return PointString.valueOf(pointVararg); 063 } 064 065 /** 066 * Implement newPointString(String name, PointString... pointStringVararg) command. 067 */ 068 public static PointString invoke(Interpreter env, CallStack callstack, 069 String name, GeomPoint... pointVararg) { 070 return PointString.valueOf(name, pointVararg); 071 } 072}