|
JavaTM Platform Standard Ed. 6 |
|||||||||
전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Objectjava.awt.font.NumericShaper
public final class NumericShaper
NumericShaper
클래스는, Latin-1 (유럽 언어)의 숫자를 다른 Unicode 10 진수로 변환하기 위해서(때문에) 사용합니다. 이 클래스는 주로, 데이터의 제시에 각국의 숫자의 형상을 사용하면서 내부적으로는 Latin-1 (유럽 언어)의 숫자를 사용하는 편이 편리한 경우에 사용합니다. 추천되어 있지 않은 숫자 형상 셀렉터 문자 (U+206E)는 해석하지 않습니다.
NumericShaper
의 인스턴스는 일반적으로,TextAttribute
클래스의 NUMERIC_SHAPING
속성을 가지는 텍스트의 속성으로서 적용됩니다. 예를 들어 다음의 코드 부분에서는, 아라비아어의 문맥내에서는 TextLayout
의 유럽 언어의 숫자를 아라비아어의 숫자로 변환합니다.
Map map = new HashMap(); map.put(TextAttribute.NUMERIC_SHAPING, NumericShaper.getContextualShaper(NumericShaper.ARABIC)); FontRenderContext frc = ...; TextLayout layout = new TextLayout(text, map, frc); layout.draw(g2d, x, y);
NumericShaper
의 인스턴스를 사용해 숫자의 형상 결정을 명시적으로 실시할 수도 있습니다. char[] text = ...; // shape all EUROPEAN digits (except zero) to ARABIC digits NumericShaper shaper = NumericShaper.getShaper(NumericShaper.ARABIC); shaper.shape(text, start, count); // shape European digits to ARABIC digits if preceding text is Arabic, or // shape European digits to TAMIL digits if preceding text is Tamil, or // leave European digits alone if there is no preceding text, or // preceding text is neither Arabic nor Tamil NumericShaper shaper = NumericShaper.getContextualShaper(NumericShaper.ARABIC | NumericShaper.TAMIL, NumericShaper.EUROPEAN); shaper.shape(text. start, count);
필드의 개요 | |
---|---|
static int |
ALL_RANGES
모든 범위를 식별합니다. |
static int |
ARABIC
ARABIC 의 범위와 10 진수를 식별합니다. |
static int |
BENGALI
BENGALI 의 범위와 10 진수를 식별합니다. |
static int |
DEVANAGARI
DEVANAGARI 의 범위와 10 진수를 식별합니다. |
static int |
EASTERN_ARABIC
ARABIC 의 범위와 ARABIC_EXTENDED 의 10 진수를 식별합니다. |
static int |
ETHIOPIC
ETHIOPIC 의 범위와 10 진수를 식별합니다. |
static int |
EUROPEAN
Latin-1 (유럽 언어)와 확장 범위, 및 Latin-1 (유럽 언어)의 10 진수를 식별합니다. |
static int |
GUJARATI
GUJARATI 의 범위와 10 진수를 식별합니다. |
static int |
GURMUKHI
GURMUKHI 의 범위와 10 진수를 식별합니다. |
static int |
KANNADA
KANNADA 의 범위와 10 진수를 식별합니다. |
static int |
KHMER
KHMER 의 범위와 10 진수를 식별합니다. |
static int |
LAO
LAO 의 범위와 10 진수를 식별합니다. |
static int |
MALAYALAM
MALAYALAM 의 범위와 10 진수를 식별합니다. |
static int |
MONGOLIAN
MONGOLIAN 의 범위와 10 진수를 식별합니다. |
static int |
MYANMAR
MYANMAR 의 범위와 10 진수를 식별합니다. |
static int |
ORIYA
ORIYA 의 범위와 10 진수를 식별합니다. |
static int |
TAMIL
TAMIL 의 범위와 10 진수를 식별합니다. |
static int |
TELUGU
TELUGU 의 범위와 10 진수를 식별합니다. |
static int |
THAI
THAI 의 범위와 10 진수를 식별합니다. |
static int |
TIBETAN
TIBETAN 의 범위와 10 진수를 식별합니다. |
메소드의 개요 | |
---|---|
boolean |
equals (Object o)
지정된 객체가 NumericShaper 의 인스턴스이며, 이것과 같은 방법으로 형상 결정을 실시하는 경우는 true , 그렇지 않은 경우는 false 를 돌려줍니다. |
static NumericShaper |
getContextualShaper (int ranges)
지정된 Unicode 의 1 개 또는 복수의 범위에 대한, 문맥 의존의 형상 결정 요인을 돌려줍니다. |
static NumericShaper |
getContextualShaper (int ranges,
int defaultContext)
지정된 Unicode 의 1 개 또는 복수의 범위에 대한, 문맥 의존의 형상 결정 요인을 돌려줍니다. |
int |
getRanges ()
형상 결정을 실시하는 모든 범위에 대한 값의 논리합을 요구하는 int 를 돌려줍니다. |
static NumericShaper |
getShaper (int singleRange)
지정된 Unicode 의 범위에 대한 형상 결정 요인을 돌려줍니다. |
int |
hashCode ()
이 형상 결정 요인의 해시 코드를 돌려줍니다. |
boolean |
isContextual ()
이 형상 결정 요인이 문맥 의존인가 어떤가를 나타내는 boolean 를 돌려줍니다. |
void |
shape (char[] text,
int start,
int count)
start 와 start + count 의 사이에 출현하는, 텍스트내의 숫자를 변환합니다. |
void |
shape (char[] text,
int start,
int count,
int context)
지정된 문맥을 사용해, start 와 start + count 의 사이에 출현하는 텍스트내의 숫자를 변환합니다. |
String |
toString ()
이 형상 결정 요인을 기술하는 String 를 돌려줍니다. |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , finalize , getClass , notify , notifyAll , wait , wait , wait |
필드의 상세 |
---|
public static final int EUROPEAN
public static final int ARABIC
public static final int EASTERN_ARABIC
public static final int DEVANAGARI
public static final int BENGALI
public static final int GURMUKHI
public static final int GUJARATI
public static final int ORIYA
public static final int TAMIL
public static final int TELUGU
public static final int KANNADA
public static final int MALAYALAM
public static final int THAI
public static final int LAO
public static final int TIBETAN
public static final int MYANMAR
public static final int ETHIOPIC
public static final int KHMER
public static final int MONGOLIAN
public static final int ALL_RANGES
메소드의 상세 |
---|
public static NumericShaper getShaper(int singleRange)
singleRange
- 지정된 Unicode 의 범위
IllegalArgumentException
- 범위가 1 개가 아닌 경우public static NumericShaper getContextualShaper(int ranges)
NumericShaper.ARABIC | NumericShaper.THAI
와 같이, 값의 논리합에 의해 나타내집니다. 형상 결정 요인은, EUROPEAN 를 초기 문맥으로서 상정합니다. 즉, 캐릭터 라인내에서 방향성의 강한 텍스트의 전에 EUROPEAN 의 숫자가 검출되었을 경우, 문맥은 EUROPEAN 이다고 보여져 숫자는 형상 결정되지 않습니다.
ranges
- 지정된 Unicode 의 범위
public static NumericShaper getContextualShaper(int ranges, int defaultContext)
NumericShaper.ARABIC | NumericShaper.THAI
와 같이, 값의 논리합에 의해 나타내집니다. 형상 결정 요인은, defaultContext 를 초기 문맥으로서 사용합니다.
ranges
- 지정된 Unicode 의 범위defaultContext
- 초기 문맥.
NumericShaper.EUROPEAN
등
IllegalArgumentException
- 지정되었다
defaultContext
가 단일의 유효한 범위가 아닌 경우public void shape(char[] text, int start, int count)
text
- 변환하는 문자의 배열start
- 변환을 개시하는 text
내의
인덱스count
- text
내의 변환한다
문자수
IndexOutOfBoundsException
- start 또는 start + count 가
범위외의 경우
NullPointerException
- text 가 null 의 경우public void shape(char[] text, int start, int count, int context)
text
- 문자 배열start
- 변환을 개시하는 text
내의
인덱스count
- text
내의 변환한다
문자수context
- 문자의 변환처의 문맥.
NumericShaper.EUROPEAN
등
IndexOutOfBoundsException
- start 또는 start + count 가
범위외의 경우
NullPointerException
- text 가 null 의 경우
IllegalArgumentException
- 이것이 문맥 의존의 형상 결정 요인이며,
지정된 context
가 단일의 유효한 범위가 아니다
경우public boolean isContextual()
boolean
를 돌려줍니다.
true
,
그렇지 않은 경우는 false
public int getRanges()
int
를 돌려줍니다. 예를 들어, 아라비아어에의 형상 결정을 할지 어떨지를 조사하려면 , 다음과 같이 합니다.
if ((shaper.getRanges() & shaper.ARABIC) ! = 0) { ...
public int hashCode()
Object
내의 hashCode
Object.hashCode()
public boolean equals(Object o)
NumericShaper
의 인스턴스이며, 이것과 같은 방법으로 형상 결정을 실시하는 경우는 true
, 그렇지 않은 경우는 false
를 돌려줍니다.
Object
내의 equals
o
- 이 NumericShaper
와 비교하는,
지정된 객체
o
가 o
의 인스턴스이며,
같은 방법으로 형상 결정을 실시하는 경우는 true
,
그렇지 않은 경우는 false
Object.equals(java.lang.Object)
public String toString()
String
를 돌려줍니다. 이 메소드는 디버그의 경우에만 사용합니다.
Object
내의 toString
String
|
JavaTM Platform Standard Ed. 6 |
|||||||||
전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.