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