Package writer2latex.util
Class Misc
java.lang.Object
writer2latex.util.Misc
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final Stringstatic final int[]doubleIntArray(int[] array) static final StringformatDate(String sDate, String sLanguage, String sCountry) static final StringgetAttribute(Element node, String attribute) static final StringgetAttribute(Node node, String attribute) static final ElementgetChildByTagName(Node node, String sTagName) static final StringgetFileExtension(String sURL) Get the file extension from an URLstatic final StringgetFileName(String sURL) Get the file name part of an URLstatic final ElementgetFirstChildElement(Node node) static final intgetIntegerFromHex(String sHex, int nDefault) static final StringGet the path part of an URLstatic Stringstatic final intgetPosInteger(String sInteger, int nDefault) static byte[]Read anInputStreaminto abytearraystatic final Stringint2alph(int number, boolean bLetterSync) static final Stringint2Alph(int number, boolean bLetterSync) static final Stringint2arabic(int number) static final Stringint2roman(int number) static final Stringint2Roman(int number) static final booleanstatic final booleanstatic final booleanstatic StringmakeFileName(String sURL) static Stringstatic StringmakeTeXFriendly(String sFileName, String sDefault) Make a file name TeX friendly, replacing offending charactersstatic final StringremoveExtension(String sURL) static String[]sortStringSet(Set<String> theSet) static final StringtrimDocumentName(String name, String extension) static Stringstatic Stringstatic File
-
Constructor Details
-
Misc
public Misc()
-
-
Method Details
-
doubleIntArray
public static final int[] doubleIntArray(int[] array) -
dateOnly
-
formatDate
-
int2roman
-
int2Roman
-
int2arabic
-
int2alph
-
int2Alph
-
getIntegerFromHex
-
makeTeXFriendly
Make a file name TeX friendly, replacing offending characters- Parameters:
sFileName- the file namesDefault- a default name to use if no characters remains after filtering- Returns:
- the modified file name
-
trimDocumentName
-
getPath
Get the path part of an URL- Parameters:
sURL- the URL from which the filename should be extracted- Returns:
- the file name
-
getFileName
Get the file name part of an URL- Parameters:
sURL- the URL from which the filename should be extracted- Returns:
- the file name
-
getFileExtension
Get the file extension from an URL- Parameters:
sURL-- Returns:
- the file extension (including dot) or the empty string if there is no file extension
-
removeExtension
-
getAttribute
-
isElement
-
isElement
-
isText
-
getAttribute
-
getChildByTagName
-
getFirstChildElement
-
getPCDATA
-
sortStringSet
-
urlEncode
-
urlDecode
-
makeHref
-
makeFileName
-
urlToFile
-
inputStreamToByteArray
Read an
InputStreaminto abytearray- Parameters:
is- theInputStreamto read- Returns:
- a byte array with the contents read from the stream
- Throws:
IOException- in case of any I/O errors.
-
getPosInteger
-