1 22 23 package org.xquark.mapper.util; 24 25 26 import java.util.ArrayList ; 27 import java.util.StringTokenizer ; 28 29 30 33 public class StringList extends BaseTypedList 34 { 35 private static final String RCSRevision = "$Revision: 1.1 $"; 36 private static final String RCSName = "$Name: $"; 37 public StringList() {} 38 39 public StringList(int capacity) 40 { 41 super(capacity); 42 } 43 44 public StringList(String s) 45 { 46 StringTokenizer tokens = new StringTokenizer (s, "."); 47 while(tokens.hasMoreTokens()) 48 { 49 list.add(tokens.nextToken()); 50 } 51 } 52 53 public StringList(ArrayList list) 54 { 55 super(list); 56 } 57 58 public String get(int i) 59 { 60 return (String ) list.get(i); 61 } 62 63 public void add(String s) 64 { 65 list.add(s); 66 } 67 68 public void add(int i, String s) 69 { 70 list.add(i, s); 71 } 72 73 public int indexOf(String s) 74 { 75 for(int i=0; i<size(); i++) 76 { 77 if(get(i).equalsIgnoreCase(s)) 78 return i; 79 } 80 return -1; 81 } 82 83 public StringBuffer dummy() 84 { 85 StringBuffer dummy = new StringBuffer (); 86 87 for(int i=0; i<size(); i++) 88 { 89 dummy.append(get(i)+"."); 90 } 91 return dummy; 92 } 93 } 94 | Popular Tags |