writer2latex.util

Class Misc


public class Misc
extends java.lang.Object

Misc.java This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1, as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Copyright: 2002-2007 by Henrik Just All Rights Reserved. Version 0.4.2 (2007-04-02)

Method Summary

static String
add(String sLength1, String sLength2)
static int[]
doubleIntArray(int[] array)
static String
getAttribute(Element node, String attribute)
static String
getAttribute(Node node, String attribute)
static Element
getChildByTagName(Node node, String sTagName)
static Element
getFirstChildElement(Node node)
static float
getFloat(String sFloat, float fDefault)
static int
getIntegerFromHex(String sHex, int nDefault)
static String
getPCDATA(Node node)
static int
getPosInteger(String sInteger, int nDefault)
static byte[]
inputStreamToByteArray(InputStream is)
Read an InputStream into a bytearray
static String
int2Alph(int number, boolean bLetterSync)
static String
int2Roman(int number)
static String
int2alph(int number, boolean bLetterSync)
static String
int2arabic(int number)
static String
int2roman(int number)
static boolean
isElement(Node node)
static boolean
isElement(Node node, String sTagName)
static boolean
isLessThan(String sThis, String sThat)
static boolean
isText(Node node)
static String
length2px(String sLength)
static String
makeHref(String s)
static String
multiply(String sPercent, String sLength)
static String
removeExtension(String sName)
static String
sub(String sLength1, String sLength2)
static String
trimDocumentName(String name, String extension)
static String
truncateLength(String sValue)
static String
urlDecode(String s)
static String
urlEncode(String s)

Method Details

add

public static final String add(String sLength1,
                               String sLength2)

doubleIntArray

public static final int[] doubleIntArray(int[] array)

getAttribute

public static final String getAttribute(Element node,
                                        String attribute)

getAttribute

public static final String getAttribute(Node node,
                                        String attribute)

getChildByTagName

public static final Element getChildByTagName(Node node,
                                              String sTagName)

getFirstChildElement

public static final Element getFirstChildElement(Node node)

getFloat

public static final float getFloat(String sFloat,
                                   float fDefault)

getIntegerFromHex

public static final int getIntegerFromHex(String sHex,
                                          int nDefault)

getPCDATA

public static String getPCDATA(Node node)

getPosInteger

public static final int getPosInteger(String sInteger,
                                      int nDefault)

inputStreamToByteArray

public static byte[] inputStreamToByteArray(InputStream is)
            throws IOException
Read an InputStream into a bytearray
Parameters:
is - the InputStream to read
Returns:
a byte array with the contents read from the stream

int2Alph

public static final String int2Alph(int number,
                                    boolean bLetterSync)

int2Roman

public static final String int2Roman(int number)

int2alph

public static final String int2alph(int number,
                                    boolean bLetterSync)

int2arabic

public static final String int2arabic(int number)

int2roman

public static final String int2roman(int number)

isElement

public static final boolean isElement(Node node)

isElement

public static final boolean isElement(Node node,
                                      String sTagName)

isLessThan

public static boolean isLessThan(String sThis,
                                 String sThat)

isText

public static final boolean isText(Node node)

length2px

public static final String length2px(String sLength)

makeHref

public static String makeHref(String s)

multiply

public static final String multiply(String sPercent,
                                    String sLength)

removeExtension

public static final String removeExtension(String sName)

sub

public static final String sub(String sLength1,
                               String sLength2)

trimDocumentName

public static final String trimDocumentName(String name,
                                            String extension)

truncateLength

public static String truncateLength(String sValue)

urlDecode

public static String urlDecode(String s)

urlEncode

public static String urlEncode(String s)