net.ranides.assira.text.format
Interface AnsiCharSequence

All Superinterfaces:
AnsiAttr, CharSequence
All Known Implementing Classes:
AnsiCharLiveSequence, AnsiString, AnsiStringBuilder, AnsiStringWrapper

public interface AnsiCharSequence
extends AnsiAttr, CharSequence

Klasa reprezentująca ciąg znaków razem z przypisanymi do nich atrybutami (kolor tekstu, tła, czcionka, styl)

Author:
ranides

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.ranides.assira.text.format.AnsiAttr
AnsiAttr.IndirectAt
 
Field Summary
 
Fields inherited from interface net.ranides.assira.text.format.AnsiAttr
bold, BOLD, changed, CHANGED, fresh, FRESH, invert, INVERT, MASK_INTERNAL, MASK_PUBLIC, narrow, NARROW, normal, NORMAL, SPLIT_ALL, SPLIT_BACK, SPLIT_FLAGS, SPLIT_FLAGS_ALL, SPLIT_FONT, SPLIT_FORE, strike, STRIKE, symbol, SYMBOL, underline, UNDERLINE
 
Method Summary
 AnsiAttr getAttr()
          Zwraca wszystkie domyślne właściwości przypisane do ciągu tekstowego (kolor, tło, czcionka, styl).
 AnsiAttr getAttrAt(int index)
          Zwraca wszystkie właściwości przypisane do znaku o podanym indeksie (kolor, tło, czcionka, styl).
 int getBackAt(int index)
          Zwraca numer koloru tła przypisany do znaku o podanym indeksie.
 char getCharAt(int index)
          Odczytuje z sekwencji znak o podanym indeksie.
 Color getComputedBackAt(int index)
          Metoda opcjonalna: zwraca kolor tła przypisany do znaku o podanym indeksie.
 Font getComputedFontAt(int index)
          Metoda opcjonalna: zwraca numer czcionki przypisany do znaku o podanym indeksie.
 Color getComputedForeAt(int index)
          Metoda opcjonalna: zwraca kolor tekstu przypisany do znaku o podanym indeksie.
 int getFlagsAt(int index)
          Zwraca atrybuty przypisane do znaku o podanym indeksie.
 int getFontAt(int index)
          Zwraca numer czcionki przypisany do znaku o podanym indeksie.
 AnsiFontScheme getFonts()
          Zwraca schemat czcionek skojarzony z sekwencją znaków.
 int getForeAt(int index)
          Zwraca numer koloru tekstu przypisany do znaku o podanym indeksie.
 AnsiColorScheme getScheme()
          Zwraca schemat kolorów skojarzony z sekwencją znaków.
 Iterable<? extends AnsiCharSequence> split(int options)
           Rozbija tekst na fragmenty zawierające znaki zgrupowane według kryteriów podanych w opcjach.
 AnsiCharSequence subAnsiSequence(int begin, int end)
          Returns a new AnsiCharSequence that is a subsequence of this sequence.
 
Methods inherited from interface net.ranides.assira.text.format.AnsiAttr
getBack, getComputedBack, getComputedFont, getComputedFore, getFlags, getFont, getFore
 
Methods inherited from interface java.lang.CharSequence
charAt, length, subSequence, toString
 

Method Detail

getCharAt

char getCharAt(int index)
Odczytuje z sekwencji znak o podanym indeksie. Zwraca wynik identyczny jak CharSequence.charAt(int). Metoda istniejąca w celu uzyskania pełnej kompatybilności sekwencji znaków z konwencją JavaBeans.

Parameters:
index -
Returns:

getForeAt

int getForeAt(int index)
Zwraca numer koloru tekstu przypisany do znaku o podanym indeksie. Numer może być zamieniony na graficzną reprezentację za pomocą AnsiColorScheme.

Parameters:
index -
Returns:
See Also:
getComputedForeAt(int)

getBackAt

int getBackAt(int index)
Zwraca numer koloru tła przypisany do znaku o podanym indeksie. Numer może być zamieniony na graficzną reprezentację za pomocą AnsiColorScheme.

Parameters:
index -
Returns:
See Also:
getComputedBackAt(int)

getFlagsAt

int getFlagsAt(int index)
Zwraca atrybuty przypisane do znaku o podanym indeksie.

Parameters:
index -
Returns:

getFontAt

int getFontAt(int index)
Zwraca numer czcionki przypisany do znaku o podanym indeksie. Numer może być zamieniony na graficzną reprezentację za pomocą AnsiFontScheme.

Parameters:
index -
Returns:
See Also:
getComputedFontAt(int)

getAttr

AnsiAttr getAttr()
Zwraca wszystkie domyślne właściwości przypisane do ciągu tekstowego (kolor, tło, czcionka, styl).

Returns:

getAttrAt

AnsiAttr getAttrAt(int index)
Zwraca wszystkie właściwości przypisane do znaku o podanym indeksie (kolor, tło, czcionka, styl).

Parameters:
index -
Returns:

getComputedForeAt

Color getComputedForeAt(int index)
Metoda opcjonalna: zwraca kolor tekstu przypisany do znaku o podanym indeksie. Ogólnie metoda zwraca rozsądny wynik, jeśli obiekt został powiązany z odpowiednim schematem kolorów (AnsiColorScheme.

Parameters:
index -
Returns:

getComputedBackAt

Color getComputedBackAt(int index)
Metoda opcjonalna: zwraca kolor tła przypisany do znaku o podanym indeksie. Ogólnie metoda zwraca rozsądny wynik, jeśli obiekt został powiązany z odpowiednim schematem kolorów (AnsiColorScheme.

Parameters:
index -
Returns:

getComputedFontAt

Font getComputedFontAt(int index)
Metoda opcjonalna: zwraca numer czcionki przypisany do znaku o podanym indeksie. Ogólnie metoda zwraca rozsądny wynik, jeśli obiekt został powiązany z odpowiednim schematem czcionek (AnsiFontScheme.

Parameters:
index -
Returns:

getScheme

AnsiColorScheme getScheme()
Zwraca schemat kolorów skojarzony z sekwencją znaków. Schemat powiązany z sekwencją odpowiada za prawidłowe działanie metod AnsiAttr.getComputedFore(), AnsiAttr.getComputedBack() oraz pochodnych.

Returns:

getFonts

AnsiFontScheme getFonts()
Zwraca schemat czcionek skojarzony z sekwencją znaków. Schemat powiązany z sekwencją odpowiada za prawidłowe działanie metod AnsiAttr.getComputedFont() oraz getComputedFontAt(int)

Returns:

split

Iterable<? extends AnsiCharSequence> split(int options)

Rozbija tekst na fragmenty zawierające znaki zgrupowane według kryteriów podanych w opcjach. Opcje są zbiorem flag z klasy AnsiAttr.

Rozdziela tekst na fragmenty o jednym kolorze tekstu i tła:
text.split(AnsiAttr.SPLIT_FORE | AnsiAttr.SPLIT_BACK)

Rozdziela tekst na fragmenty o tym samym stylu pogrubienia:
text.split(AnsiAttr.SPLIT_FLAGS | AnsiAttr.BOLD)

Parameters:
options -
Returns:

subAnsiSequence

AnsiCharSequence subAnsiSequence(int begin,
                                 int end)
Returns a new AnsiCharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters:
begin - the start index, inclusive
end - the end index, exclusive
Returns:
the specified subsequence
Throws:
IndexOutOfBoundsException - if start or end are negative, if end is greater than length(), or if start is greater than end


Copyright © 2013. All Rights Reserved.