1 55 package org.jboss.axis.types; 56 57 import java.util.StringTokenizer ; 58 59 64 public class NMTokens extends NCName 65 { 66 private NMToken[] tokens; 67 68 public NMTokens() 69 { 70 super(); 71 } 72 73 78 public NMTokens(String stValue) throws IllegalArgumentException 79 { 80 setValue(stValue); 81 } 82 83 public void setValue(String stValue) 84 { 85 StringTokenizer tokenizer = new StringTokenizer (stValue); 86 int count = tokenizer.countTokens(); 87 tokens = new NMToken[count]; 88 for (int i = 0; i < count; i++) 89 { 90 tokens[i] = new NMToken(tokenizer.nextToken()); 91 } 92 } 93 94 public String toString() 95 { 96 String val = ""; 97 for (int i = 0; i < tokens.length; i++) 98 { 99 NMToken token = tokens[i]; 100 if (i > 0) val += " "; 101 val += token.toString(); 102 } 103 return val; 104 } 105 106 public boolean equals(Object object) 107 { 108 return (toString().equals(object.toString())); 109 } 110 } 111 | Popular Tags |