From: Erik V. <ev...@us...> - 2010-01-08 21:26:29
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23815/rails/util Modified Files: Util.java Log Message: Added joinWithDelimiter Index: Util.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Util.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Util.java 28 Dec 2009 14:53:00 -0000 1.17 --- Util.java 8 Jan 2010 21:26:14 -0000 1.18 *************** *** 10,14 **** import rails.game.ConfigurationException; import rails.game.move.Moveable; ! import rails.game.move.MoveableHolderI; public final class Util { --- 10,14 ---- import rails.game.ConfigurationException; import rails.game.move.Moveable; ! import rails.game.move.MoveableHolder; public final class Util { *************** *** 34,37 **** --- 34,46 ---- } + public static String joinWithDelimiter (String[] sa, String delimiter) { + StringBuffer b = new StringBuffer(); + for (String s : sa) { + if (b.length() > 0) b.append(delimiter); + b.append(s); + } + return b.toString(); + } + public static int parseInt(String value) throws ConfigurationException { *************** *** 71,75 **** */ public static <T extends Moveable> void moveObjects(List<T> objects, ! MoveableHolderI to) { if (objects == null || objects.isEmpty()) return; --- 80,84 ---- */ public static <T extends Moveable> void moveObjects(List<T> objects, ! MoveableHolder to) { if (objects == null || objects.isEmpty()) return; |