2 *******************************************************************************
\r
3 * Copyright (C) 2002-2004, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
8 package com.ibm.icu.dev.tool.layout;
\r
11 class Feature extends TaggedRecord
\r
13 private int[] lookupIndices;
\r
14 private int lookupCount;
\r
15 private int featureIndex;
\r
17 public Feature(String theFeatureTag)
\r
19 super(theFeatureTag);
\r
21 lookupIndices = new int[10];
\r
26 public void addLookup(int theLookupIndex)
\r
28 if (lookupCount >= lookupIndices.length) {
\r
29 int[] newLookupIndices = new int[lookupIndices.length + 5];
\r
31 System.arraycopy(lookupIndices, 0, newLookupIndices, 0, lookupIndices.length);
\r
32 lookupIndices = newLookupIndices;
\r
35 lookupIndices[lookupCount] = theLookupIndex;
\r
39 public void writeFeature(OpenTypeTableWriter writer)
\r
41 writer.writeData(0); // featureParams (must be NULL)
\r
43 writer.writeData(lookupCount);
\r
45 for (int i = 0; i < lookupCount; i += 1) {
\r
46 writer.writeData(lookupIndices[i]);
\r
50 public int getFeatureIndex()
\r
52 return featureIndex;
\r
55 public void setFeatureIndex(int index)
\r
57 featureIndex = index;
\r