1 /* 2 ********************************************************************** 3 * Copyright (c) 2002-2004, International Business Machines 4 * Corporation and others. All Rights Reserved. 5 ********************************************************************** 6 * Author: John Emmons 7 ********************************************************************** 8 */ 9 package org.unicode.cldr.posix; 10 11 public class POSIXVariant { 12 public String collation_type; 13 public String currency; 14 public String platform; 15 public String yesno; 16 17 // valid values for the "platform" type 18 public static final String SOLARIS = "solaris"; 19 public static final String AIX = "aix"; 20 21 public POSIXVariant(String variant_string) { 22 23 this.collation_type = "default"; 24 this.currency = "default"; 25 this.platform = "common"; 26 this.yesno = "long"; 27 boolean more_values = true; 28 String buf = new String(variant_string); 29 String rest; 30 31 while (more_values) { 32 int comma_pos = buf.indexOf(','); 33 if (comma_pos >= 0) { 34 rest = buf.substring(comma_pos + 1); 35 buf = buf.substring(0, comma_pos); 36 } else { 37 more_values = false; 38 rest = ""; 39 } 40 41 int equal_pos = buf.indexOf('='); 42 if (equal_pos > 0) { 43 String field = buf.substring(0, equal_pos); 44 String field_value = buf.substring(equal_pos + 1); 45 46 if (field.equals("collation")) 47 this.collation_type = field_value; 48 if (field.equals("currency")) 49 this.currency = field_value; 50 if (field.equals("platform")) 51 this.platform = field_value; 52 if (field.equals("yesno")) 53 this.yesno = field_value; 54 } 55 buf = rest; 56 } 57 58 } 59 60 public POSIXVariant() { 61 this.collation_type = "default"; 62 this.currency = "default"; 63 this.platform = "common"; 64 this.yesno = "long"; 65 } 66 } 67