001/*
002 * Copyright 1999-2004 The Apache Software Foundation.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.itextpdf.text.pdf.hyphenation;
018
019import java.util.ArrayList;
020
021/**
022 * This interface is used to connect the XML pattern file parser to
023 * the hyphenation tree.
024 *
025 * @author Carlos Villegas <cav@uniscope.co.jp>
026 */
027public interface PatternConsumer {
028
029    /**
030     * Add a character class.
031     * A character class defines characters that are considered
032     * equivalent for the purpose of hyphenation (e.g. "aA"). It
033     * usually means to ignore case.
034     * @param chargroup character group
035     */
036    void addClass(String chargroup);
037
038    /**
039     * Add a hyphenation exception. An exception replaces the
040     * result obtained by the algorithm for cases for which this
041     * fails or the user wants to provide his own hyphenation.
042     * A hyphenatedword is a vector of alternating String's and
043     * {@link Hyphen Hyphen} instances
044     */
045    void addException(String word, ArrayList<Object> hyphenatedword);
046
047    /**
048     * Add hyphenation patterns.
049     * @param pattern the pattern
050     * @param values interletter values expressed as a string of
051     * digit characters.
052     */
053    void addPattern(String pattern, String values);
054
055}