1/* 2 ******************************************************************************* 3 * Copyright (C) 2014, International Business Machines Corporation and * 4 * others. All Rights Reserved. * 5 ******************************************************************************* 6 */ 7package com.ibm.icu.text; 8 9import java.text.CharacterIterator; 10 11/** 12 * The LanguageBreakEngine interface is to be used to implement any 13 * language-specific logic for break iteration. 14 */ 15interface LanguageBreakEngine { 16 /** 17 * @param c A Unicode codepoint value 18 * @param breakType The kind of break iterator that is wanting to make use 19 * of this engine - character, word, line, sentence 20 * @return true if the engine can handle this character, false otherwise 21 */ 22 boolean handles(int c, int breakType); 23 24 /** 25 * Implements the actual breaking logic. 26 * @param text The text to break over 27 * @param startPos The index of the beginning of our range 28 * @param endPos The index of the possible end of our range. It is possible, 29 * however, that our range ends earlier 30 * @param reverse true iff we are iterating backwards (in a call to 31 * previous(), for example) 32 * @param breakType The kind of break iterator that is wanting to make use 33 * of this engine - character, word, line, sentence 34 * @param foundBreaks A Stack that the breaks found will be added to 35 * @return the number of words found 36 */ 37 int findBreaks(CharacterIterator text, int startPos, int endPos, 38 boolean reverse, int breakType, DictionaryBreakEngine.DequeI foundBreaks); 39} 40 41 42 43