Here you can find the source of vector2String(Vector v, String delimiter)
Parameter | Description |
---|---|
v | The vector to serialize |
delimiter | The delimiter to tell tokens apart |
@SuppressWarnings("rawtypes") public static String vector2String(Vector v, String delimiter)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { /**/* w w w. j av a 2 s .com*/ * Serializing a Vector containing strings to a string using a given delimiter. * * @param v The vector to serialize * @param delimiter The delimiter to tell tokens apart * @return A string containing the serialized contents of the Vector */ @SuppressWarnings("rawtypes") public static String vector2String(Vector v, String delimiter) { if (v == null || delimiter == null) { return null; } return enumeration2String(v.elements(), delimiter); } @SuppressWarnings("rawtypes") public static String enumeration2String(Enumeration enume, String delimiter) { if (enume == null || delimiter == null) { return null; } StringBuffer buf = new StringBuffer(); while (enume.hasMoreElements()) { buf.append(enume.nextElement()); buf.append(delimiter); } return buf.toString(); } }