/** Produce an appropriate character iterator. * @return an iterator */ public AttributedCharacterIterator iterator() { int size = current + 1; char[] cs = new char[size]; Font[] fs = new Font[size]; Color[] colos = new Color[size]; int[] rstmp = new int[size]; int[] rltmp = new int[size]; System.arraycopy(runStart, 0, rstmp, 0, size); System.arraycopy(runLimit, 0, rltmp, 0, size); System.arraycopy(chars, 0, cs, 0, size); System.arraycopy(fonts, 0, fs, 0, size); System.arraycopy(colors, 0, colos, 0, size); AttributedCharacterIterator ret = new AttributedCharacterIteratorImpl(cs, fs, colos, rstmp, rltmp); return ret; }
public char setIndex(int i) { if (i < 0) throw new IllegalArgumentException(); if (i == getEndIndex()) { current = getEndIndex(); return DONE; } return chars[current = i]; }
/** Produce an appropriate character iterator. * @return an iterator */ public AttributedCharacterIterator iterator() { int size = current + 1; char[] cs = new char[size]; Font[] fs = new Font[size]; Color[] colos = new Color[size]; int[] rstmp = new int[size]; int[] rltmp = new int[size]; System.arraycopy(runStart, 0, rstmp, 0, size); System.arraycopy(runLimit, 0, rltmp, 0, size); System.arraycopy(chars, 0, cs, 0, size); System.arraycopy(fonts, 0, fs, 0, size); System.arraycopy(colors, 0, colos, 0, size); AttributedCharacterIterator ret = new AttributedCharacterIteratorImpl(cs, fs, colos, rstmp, rltmp); return ret; }
/** Produce an appropriate character iterator. * @return an iterator */ public AttributedCharacterIterator iterator() { int size = current + 1; char[] cs = new char[size]; Font[] fs = new Font[size]; Color[] colos = new Color[size]; int[] rstmp = new int[size]; int[] rltmp = new int[size]; System.arraycopy(runStart, 0, rstmp, 0, size); System.arraycopy(runLimit, 0, rltmp, 0, size); System.arraycopy(chars, 0, cs, 0, size); System.arraycopy(fonts, 0, fs, 0, size); System.arraycopy(colors, 0, colos, 0, size); AttributedCharacterIterator ret = new AttributedCharacterIteratorImpl(cs, fs, colos, rstmp, rltmp); return ret; }
public int getRunStart() { return runStart[getIndex()]; } /*
public int getRunLimit() { return runLimit[runStart[getIndex()]] + 1; } /*
public int getRunStart() { return runStart[getIndex()]; } /*
public int getRunLimit() { return runLimit[runStart[getIndex()]] + 1; }
public int getRunLimit() { return runLimit[runStart[getIndex()]] + 1; } /*
public int getRunStart(Set attributes) { if ((attributes.contains(TextAttribute.FONT)) || attributes.contains(TextAttribute.FOREGROUND) ) { return getRunStart(); } else { return 0; } } }
public char last() { int end = getEndIndex(); if (end == 0) { return DONE; } return chars[current = end - 1]; } /*
public int getRunStart(AttributedCharacterIterator.Attribute att) { if ((att != TextAttribute.FONT) && att != TextAttribute.FOREGROUND) { return 0; // undefined attribute } return getRunStart(); } /*
public int getRunLimit(AttributedCharacterIterator.Attribute att) { if ((att != TextAttribute.FONT) && (att != TextAttribute.FOREGROUND)) { return getEndIndex(); // undefined attribute } return getRunLimit(); } /*
public int getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attributes) { if ((attributes.contains(TextAttribute.FONT)) || attributes.contains(TextAttribute.FOREGROUND)) { return getRunStart(); } else { return 0; } } }
public int getRunStart() { return runStart[getIndex()]; }
public int getRunLimit(AttributedCharacterIterator.Attribute att) { if ((att != TextAttribute.FONT) && (att != TextAttribute.FOREGROUND)) { return getEndIndex(); // undefined attribute } return getRunLimit(); }
public Map<AttributedCharacterIterator.Attribute,Object> getAttributes() { Map<AttributedCharacterIterator.Attribute,Object> m = new HashMap<AttributedCharacterIterator.Attribute,Object>(1); m.put(TextAttribute.FONT, fonts[getIndex()]); m.put(TextAttribute.FOREGROUND, colors[getIndex()]); return m; }