net.sf.sfac.string.CharIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfac-utils Show documentation
Show all versions of sfac-utils Show documentation
This project is the model side of the Swing Framework and Components (SFaC).
If your doing a clean separation between model (or business) and view (or GUI or rendering) parts of your application,
(like in the MVC pattern), then the only classes of SFaC your model can access are in this project.
On the other hand, the classes in sfac-core project are GUI-specific and should not be known by your model.
The newest version!
/*-------------------------------------------------------------------------
Copyright 2009 Olivier Berlanger
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------*/
package net.sf.sfac.string;
/**
* Char iterator: Iterate on the characted of any kind of character source.
* The iterator can normalize the returned characters. The method returning normalized and non-normalized chars can be mixed in a
* iteration.
*
* @author Olivier Berlanger
*/
public interface CharIterator {
/**
* Reset the internal pointer of this iterator to the first char.
*/
public void reset();
/**
* Get the next char of this iterator.
* The returned char are not normalized. When no more characters are available, an zero char ('\0') is returned.
*
* @return the next char of this iterator or '\0' if no more characters are availbale.
*/
public char nextChar();
/**
* Get the next char of this iterator.
* The chars returned by this method are normalized as following:
*
* - Accentued chars replaced by the corresponding non-accentued char.
*
- All lowercase.
*
- Leading white space(s) removed.
*
- All non-letter or digit chars replaced by space.
*
- Any suite of white chars replaced by a single space.
*
* When no more characters are available, an zero char ('\0') is returned.
*
* @return the next char of this iterator or '\0' if no more characters are availbale.
*/
public char nextNormalizedChar();
/**
* Get the content of this char iterator as a normalized string.
* The result will be:
*
* - All lowercase.
*
- Trimmed.
*
- All non-letter or non-digit chars replaced by space.
*
- Any suite of white chars replaced by a single space.
*
*
* @return The content of this char iterator as a normalized string.
*/
public String getNormalizedString();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy