KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tanesha > replacer > formatters > StringFormatter


1 /*
2  * libreplacer, Java library to support C-sprintf alike text formatting
3  * Copyright (C) 2002 Tanesha FTPD Project, www.tanesha.net
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19 /*
20  * $Id: StringFormatter.java,v 1.2 2002/12/12 12:15:36 flower Exp $
21  */

22 package org.tanesha.replacer.formatters;
23
24 /**
25  * Interface for implementing stringformatters which will be recognized
26  * by the replacerformat as items that has their own formatting code.
27  *
28  *
29  * @author Soren, www.tanesha.net
30  */

31 public interface StringFormatter {
32
33     /**
34      * Method to return the string formated.
35      *
36      * @param align {@link org.tanesha.replacer.ReplacerFormat#LEFT} or
37      * {@link org.tanesha.replacer.ReplacerFormat#RIGHT}
38      * @param p The width parameter. {@link org.tanesha.replacer.ReplacerFormat#UNDEF}
39      * if not set.
40      * @param q The max parameter. {@link org.tanesha.replacer.ReplacerFormat#UNDEF}
41      * if not set.
42      */

43     public String JavaDoc format(boolean align, int p, int q);
44
45 }
46
Popular Tags