Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (3)
master
jdk8_del_doc
jdk8_no_comment
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
The license selected for the repository is subject to the license used by the main branch of the repository.
master
Branches (3)
master
jdk8_del_doc
jdk8_no_comment
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (3)
master
jdk8_del_doc
jdk8_no_comment
java8
/
src
/
java
/
text
/
CharacterIterator.java
java8
/
src
/
java
/
text
/
CharacterIterator.java
CharacterIterator.java 5.93 KB
Copy Edit Raw Blame History
cinderella authored 2024年09月25日 22:32 +08:00 . JDK8初始化
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
/*
* (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
* (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
*
* The original version of this source code and documentation
* is copyrighted and owned by Taligent, Inc., a wholly-owned
* subsidiary of IBM. These materials are provided under terms
* of a License Agreement between Taligent and Sun. This technology
* is protected by multiple US and International patents.
*
* This notice and attribution to Taligent may not be removed.
* Taligent is a registered trademark of Taligent, Inc.
*
*/
package java.text;
/**
* This interface defines a protocol for bidirectional iteration over text.
* The iterator iterates over a bounded sequence of characters. Characters
* are indexed with values beginning with the value returned by getBeginIndex() and
* continuing through the value returned by getEndIndex()-1.
* <p>
* Iterators maintain a current character index, whose valid range is from
* getBeginIndex() to getEndIndex(); the value getEndIndex() is included to allow
* handling of zero-length text ranges and for historical reasons.
* The current index can be retrieved by calling getIndex() and set directly
* by calling setIndex(), first(), and last().
* <p>
* The methods previous() and next() are used for iteration. They return DONE if
* they would move outside the range from getBeginIndex() to getEndIndex() -1,
* signaling that the iterator has reached the end of the sequence. DONE is
* also returned by other methods to indicate that the current index is
* outside this range.
*
* <P>Examples:<P>
*
* Traverse the text from start to finish
* <pre>{@code
* public void traverseForward(CharacterIterator iter) {
* for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
* processChar(c);
* }
* }
* }</pre>
*
* Traverse the text backwards, from end to start
* <pre>{@code
* public void traverseBackward(CharacterIterator iter) {
* for(char c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) {
* processChar(c);
* }
* }
* }</pre>
*
* Traverse both forward and backward from a given position in the text.
* Calls to notBoundary() in this example represents some
* additional stopping criteria.
* <pre>{@code
* public void traverseOut(CharacterIterator iter, int pos) {
* for (char c = iter.setIndex(pos);
* c != CharacterIterator.DONE && notBoundary(c);
* c = iter.next()) {
* }
* int end = iter.getIndex();
* for (char c = iter.setIndex(pos);
* c != CharacterIterator.DONE && notBoundary(c);
* c = iter.previous()) {
* }
* int start = iter.getIndex();
* processSection(start, end);
* }
* }</pre>
*
* @see StringCharacterIterator
* @see AttributedCharacterIterator
*/
public interface CharacterIterator extends Cloneable
{
/**
* Constant that is returned when the iterator has reached either the end
* or the beginning of the text. The value is '\\uFFFF', the "not a
* character" value which should not occur in any valid Unicode string.
*/
public static final char DONE = '\uFFFF';
/**
* Sets the position to getBeginIndex() and returns the character at that
* position.
* @return the first character in the text, or DONE if the text is empty
* @see #getBeginIndex()
*/
public char first();
/**
* Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty)
* and returns the character at that position.
* @return the last character in the text, or DONE if the text is empty
* @see #getEndIndex()
*/
public char last();
/**
* Gets the character at the current position (as returned by getIndex()).
* @return the character at the current position or DONE if the current
* position is off the end of the text.
* @see #getIndex()
*/
public char current();
/**
* Increments the iterator's index by one and returns the character
* at the new index. If the resulting index is greater or equal
* to getEndIndex(), the current index is reset to getEndIndex() and
* a value of DONE is returned.
* @return the character at the new position or DONE if the new
* position is off the end of the text range.
*/
public char next();
/**
* Decrements the iterator's index by one and returns the character
* at the new index. If the current index is getBeginIndex(), the index
* remains at getBeginIndex() and a value of DONE is returned.
* @return the character at the new position or DONE if the current
* position is equal to getBeginIndex().
*/
public char previous();
/**
* Sets the position to the specified position in the text and returns that
* character.
* @param position the position within the text. Valid values range from
* getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown
* if an invalid value is supplied.
* @return the character at the specified position or DONE if the specified position is equal to getEndIndex()
*/
public char setIndex(int position);
/**
* Returns the start index of the text.
* @return the index at which the text begins.
*/
public int getBeginIndex();
/**
* Returns the end index of the text. This index is the index of the first
* character following the end of the text.
* @return the index after the last character in the text
*/
public int getEndIndex();
/**
* Returns the current index.
* @return the current index.
*/
public int getIndex();
/**
* Create a copy of this iterator
* @return A copy of this
*/
public Object clone();
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

Releases

No release

Contributors

All

Language(Optional)

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/blackkeydestiny/java8.git
git@gitee.com:blackkeydestiny/java8.git
blackkeydestiny
java8
java8
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /