001/**
002 * CharacterProperties.java
003 * 
004 * Copyright (c) 2004-2012, Nicole C. Tedesco. All rights reserved.
005 * 
006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
007 * use this file except in compliance with the License. You may obtain a copy of
008 * the License at:
009 * 
010 * http://www.apache.org/licenses/LICENSE-2.0
011 * 
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
014 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
015 * License for the specific language governing permissions and limitations under
016 * the License.
017 */
018
019package net.sf.jaccumulator.scalars;
020
021/**
022 * Character properties of this scalar, independent of its implemented structure
023 * as a two-byte <code>char</code> or as a multi-byte Unicode character
024 * 
025 * @since JAccumulator 4.0
026 * @author Nicole Tedesco (<a
027 *         href="mailto:nicole@tedesco.name">nicole@tedesco.name</a>)
028 */
029public interface CharacterProperties
030{
031    /**
032     * @return {@code true} if the <code>int</code> value of this object is a
033     *         proper {@link Character#isAlphabetic(int) alphabetical} value in
034     *         Unicode
035     * @see Character#isAlphabetic(int)
036     */
037    public boolean isAlphabetic();
038
039    /**
040     * @return {@code true} if the <code>int</code> value of this object is a
041     *         {@link Character#isBmpCodePoint(int) BMP} (Basic Multi-lingual
042     *         Plane) code point in Unicode
043     * @see Character#isBmpCodePoint(int)
044     */
045    public boolean isBmpCodePoint();
046
047    /**
048     * Determine if this <code>char</code>-width or <code>int</code>-width
049     * character is a digit within Unicode
050     * 
051     * @return {@code true} if the scalar value of this object, as appropriate
052     *         for this objects's precision, is a digit in Unicode
053     * @see Character#isDigit(char)
054     * @see Character#isDigit(int)
055     */
056    public boolean isDigit();
057
058    /**
059     * @return {@code true} if the <code>char</code> value of this object is a
060     *         {@link Character#isHighSurrogate(char) high} surrogate in UTF-16
061     *         Unicode encoding
062     * @see Character#isHighSurrogate(char)
063     */
064    public boolean isHighSurrogate();
065
066    /**
067     * Determine if this <code>char</code>-width or <code>int</code>-width
068     * character ignorable character in a Java identifier or a Unicode
069     * identifier
070     * 
071     * @return {@code true} if the scalar value of this object, as appropriate
072     *         for this objects's precision, ignorable character in a Java
073     *         identifier or a Unicode identifier as other than the first
074     *         character
075     * @see Character#isIdentifierIgnorable(char)
076     * @see Character#isIdentifierIgnorable(int)
077     */
078    public boolean isIdentifierIgnorable();
079
080    /**
081     * @return {@code true} if the <code>int</code> value of this object is a
082     *         Unicode {@link Character#isIdeographic(int) ideographic} symbol
083     * @see Character#isIdeographic(int)
084     */
085    public boolean isIdeographic();
086
087    /**
088     * Determine if this <code>char</code>-width or <code>int</code>-width
089     * character is an ISO control character within Unicode
090     * 
091     * @return {@code true} if the scalar value of this object, as appropriate
092     *         for this objects's precision, is an ISO control character in
093     *         Unicode
094     * @see Character#isISOControl(char)
095     * @see Character#isISOControl(int)
096     */
097    public boolean isISOControl();
098
099    /**
100     * Determine if this <code>char</code>-width or <code>int</code>-width
101     * character is a part of a Java identifier as other than the first
102     * character
103     * 
104     * @return {@code true} if the scalar value of this object, as appropriate
105     *         for this objects's precision, is a part of a Java identifier as
106     *         other than the first character
107     * @see Character#isJavaIdentifierPart(char)
108     * @see Character#isJavaIdentifierPart(int)
109     */
110    public boolean isJavaIdentifierPart();
111
112    /**
113     * Determine if this <code>char</code>-width or <code>int</code>-width
114     * character is permissible as the first character in a Java identifier
115     * 
116     * @return {@code true} if the scalar value of this object, as appropriate
117     *         for this objects's precision, is permissible as the first
118     *         character in a Java identifier
119     * @see Character#isJavaIdentifierStart(char)
120     * @see Character#isJavaIdentifierStart(int)
121     */
122    public boolean isJavaIdentifierStart();
123
124    /**
125     * Determine if this <code>char</code>-width or <code>int</code>-width
126     * character is a letter within Unicode
127     * 
128     * @return {@code true} if the scalar value of this object, as appropriate
129     *         for this objects's precision, is a letter in Unicode
130     * @see Character#isLetter(char)
131     * @see Character#isLetter(int)
132     */
133    public boolean isLetter();
134
135    /**
136     * Determine if this <code>char</code>-width or <code>int</code>-width
137     * character is a letter or digit within Unicode
138     * 
139     * @return {@code true} if the scalar value of this object, as appropriate
140     *         for this objects's precision, is a letter or digit in Unicode
141     * @see Character#isLetterOrDigit(char)
142     * @see Character#isLetterOrDigit(int)
143     */
144    public boolean isLetterOrDigit();
145
146    /**
147     * Determine if this <code>char</code>-width or <code>int</code>-width
148     * character is a lower case character within Unicode
149     * 
150     * @return {@code true} if the scalar value of this object, as appropriate
151     *         for this objects's precision, is a lower case character in
152     *         Unicode
153     * @see Character#isLowerCase(char)
154     * @see Character#isLowerCase(int)
155     */
156    public boolean isLowerCase();
157
158    /**
159     * @return {@code true} if the <code>char</code> value of this object is a
160     *         {@link Character#isLowighSurrogate(char) low} surrogate in UTF-16
161     *         Unicode encoding
162     * @see Character#isLowSurrogate(char)
163     */
164    public boolean isLowSurrogate();
165
166    /**
167     * Determine if this <code>char</code>-width or <code>int</code>-width
168     * character is "mirrored" within Unicode
169     * 
170     * @return {@code true} if the scalar value of this object, as appropriate
171     *         for this objects's precision, is "mirrored" in Unicode
172     * @see Character#isMirrored(char)
173     * @see Character#isMirrored(int)
174     */
175    public boolean isMirrored();
176
177    /**
178     * @return {@code true} if the <code>int</code> value of this object is a
179     *         {@link Character#isSupplementaryCodePoint(int) supplementary}
180     *         code point in Unicode
181     * @see Character#isSupplementaryCodePoint(int)
182     */
183    public boolean isSupplementaryCodePoint();
184
185    /**
186     * @return {@code true} if the <code>char</code> value of this object is a
187     *         {@link Character#isSurrogate(char) surrogate} value (high or low)
188     *         in Unicode
189     * @see Character#isSurrogate(char)
190     */
191    public boolean isSurrogate();
192
193    /**
194     * Determine if this <code>char</code>-width or <code>int</code>-width
195     * character is a title case character within Unicode
196     * 
197     * @return {@code true} if the scalar value of this object, as appropriate
198     *         for this objects's precision, is a title case character in
199     *         Unicode
200     * @see Character#isTitleCase(char)
201     * @see Character#isTitleCase(int)
202     */
203    public boolean isTitleCase();
204
205    /**
206     * Determine if this <code>char</code>-width or <code>int</code>-width
207     * character is defined within Unicode
208     * 
209     * @return {@code true} if the scalar value of this object, as appropriate
210     *         for this objects's precision, is defined in Unicode
211     * @see Character#isDefined(char)
212     * @see Character#isDefined(int)
213     */
214    public boolean isUnicode();
215
216    /**
217     * Determine if this <code>char</code>-width or <code>int</code>-width
218     * character is a part of a Unicode identifier as other than the first
219     * character
220     * 
221     * @return {@code true} if the scalar value of this object, as appropriate
222     *         for this objects's precision, is a part of a Unicode identifier
223     *         as other than the first character
224     * @see Character#isUnicodeIdentifierPart(char)
225     * @see Character#isUnicodeIdentifierPart(int)
226     */
227    public boolean isUnicodeIdentifierPart();
228
229    /**
230     * Determine if this <code>char</code>-width or <code>int</code>-width
231     * character is permissible as the first character in a Unicode identifier
232     * 
233     * @return {@code true} if the scalar value of this object, as appropriate
234     *         for this objects's precision, is permissible as the first
235     *         character in a Unicode identifier
236     * @see Character#isUnicodeIdentifierStart(char)
237     * @see Character#isUnicodeIdentifierStart(int)
238     */
239    public boolean isUnicodeIdentifierStart();
240
241    /**
242     * Determine if this <code>char</code>-width or <code>int</code>-width
243     * character is an upper case character within Unicode
244     * 
245     * @return {@code true} if the scalar value of this object, as appropriate
246     *         for this objects's precision, is an upper case character in
247     *         Unicode
248     * @see Character#isUpperCase(char)
249     * @see Character#isUpperCase(int)
250     */
251    public boolean isUpperCase();
252
253    /**
254     * @return {@code true} if the <code>int</code> value of this object is a
255     *         {@link Character#isValidCodePoint(int) valid} code point in
256     *         Unicode
257     * @see Character#isValidCodePoint(int)
258     */
259    public boolean isValidCodePoint();
260
261    /**
262     * Determine if this <code>char</code>-width or <code>int</code>-width
263     * character is whitespace within Unicode
264     * 
265     * @return {@code true} if the scalar value of this object, as appropriate
266     *         for this objects's precision, is whitespace in Unicode
267     * @see Character#isWhitespace(char)
268     * @see Character#isWhitespace(int)
269     */
270    public boolean isWhitespace();
271}