2 *******************************************************************************
3 * Copyright (C) 1998-2004, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 * Created on Apr 14, 2003
9 *******************************************************************************
11 package com.ibm.icu.dev.tool.layout;
13 import com.ibm.icu.impl.Utility;
16 * This class contains utility methods for dealing with
22 public class TagUtilities
24 public static String makeTag(String tag)
26 if (tag == null || tag.length() == 0) {
32 for (int i = 0; i < 4; i += 1) {
34 tagValue += (int) ((i < tag.length()? tag.charAt(i) : ' ') & 0xFF);
37 return "0x" + Utility.hex(tagValue, 8);
40 // public static String makeTagOld(String tag)
42 // if (tag == null || tag.length() == 0) {
43 // return "0x00000000";
46 // StringBuffer result = new StringBuffer("LE_MAKE_TAG(");
48 // for (int i = 0; i < 4; i += 1) {
50 // result.append(", ");
53 // result.append('\'');
54 // result.append(i < tag.length()? tag.charAt(i) : ' ');
55 // result.append('\'');
58 // result.append(")");
60 // return result.toString();
63 public static String tagLabel(String tag)
65 if (tag == null || tag.length() == 0) {
68 return tag.toLowerCase();