1 18 package org.apache.batik.css.parser; 19 20 import org.w3c.css.sac.SACMediaList; 21 22 28 public class CSSSACMediaList implements SACMediaList { 29 30 33 protected String [] list = new String [3]; 34 35 38 protected int length; 39 40 43 public int getLength() { 44 return length; 45 } 46 47 51 public String item(int index) { 52 if (index < 0 || index >= length) { 53 return null; 54 } 55 return list[index]; 56 } 57 58 61 public void append(String item) { 62 if (length == list.length) { 63 String [] tmp = list; 64 list = new String [list.length * 3 / 2]; 65 for (int i = 0; i < tmp.length; i++) { 66 list[i] = tmp[i]; 67 } 68 } 69 list[length++] = item; 70 } 71 } 72 | Popular Tags |