| 
 | Jadex 0.941 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.util.SUtil
This class provides several useful static util methods.
| Nested Class Summary | |
| static class | SUtil.ResourceInfoInfo for a resource to load. | 
| Field Summary | |
| static int | CONVERT_ALLConstant that indicates a conversion of all known characters. | 
| static int | CONVERT_ALL_EXCEPT_AMPConstant that indicates a conversion of all known characters except &. | 
| static int | CONVERT_NONEConstant that indicates a conversion of no characters. | 
| static String | NULLA Null value. | 
| static int | SORT_DOWNConstant for sorting down. | 
| static int | SORT_UPConstant for sorting up. | 
| Constructor Summary | |
| SUtil() | |
| Method Summary | |
| static boolean | arrayContains(Object array,
              Object value)Check if an element is contained in an array. | 
| static boolean | arrayEquals(Object array1,
            Object array2) | 
| static List | arrayToList(Object a)Transform an array to a vector. | 
| static String | arrayToString(Object array)Get a string representation for an array. | 
| static String | colorToHTML(Color color)Convert a color to an html representation. | 
| static int | compareTo(String a,
          String b)Compares two strings, ignoring case. | 
| static String | convertPathToPackage(String path)Find a package name from a path. | 
| static Object | cutArrays(Object a1,
          Object a2)Cut two arrays. | 
| static Object | decodeXML(String xml_ob)Decode an object from XML. | 
| static String | encodeXML(Object ob)Encode an object into XML. | 
| static boolean | equals(Object val1,
       Object val2) | 
| static String | fontToHTML(Font font)Convert a font to an html representation. | 
| static Object | fromSLString(String message)Extract the value(s) out of an sl message. | 
| static String | getPlural(String s)Get the plural of a word in singular. | 
| static InputStream | getResource(String name)Get an input stream for whatever provided. 1. | 
| static InputStream | getResource0(String name)Get an input stream for whatever provided. 1. | 
| static SUtil.ResourceInfo | getResourceInfo0(String name)Get an input stream for whatever provided. 1. | 
| static String | getSingular(String s)Get the singular of a word in plural. | 
| static String[] | getStringArray(String key,
               Properties props)Get a string array of properties that are separated by commas. | 
| static boolean | isInRange(Date date,
          Date start,
          Date end)Test if the date is in the range. | 
| static Object[] | iteratorToArray(Iterator it,
                Class clazz)Transform an iterator to an array. | 
| static List | iteratorToList(Iterator it)Transform an iterator to a list. | 
| static List | iteratorToList(Iterator it,
               List ret)Transform an iterator to a list. | 
| static Object[] | joinArbitraryArrays(Object[] as)Joins any arrays of (possibly) different type. | 
| static Object | joinArrays(Object a1,
           Object a2)Joins two arrays of the same type. | 
| static void | main(String[] args)Main method for testing. | 
| static String | makeConform(String input,
            int flag)Convert an output to html/wml conform presentation. | 
| static String | makeEnglishConform(String input)Convert an output readable in english. | 
| static String | removeExtension(String fn)Remove file extension. | 
| static void | replace(String source,
        StringBuffer dest,
        String old,
        String newstring)Parse a source string replacing occurrences and storing the result in the given string buffer. | 
| static String | replace(String source,
        String old,
        String newstring)Parse a source string replacing occurrences and returning the result. | 
| static String | stripTags(String source)Strip tags (e.g. html) from a string, leaving only the text content. | 
| static Object | substractArrays(Object a1,
                Object a2)First array minus second array. | 
| static String | toSLString(Object o)Convert an object to an SL string. | 
| static void | toSLString(Object o,
           StringBuffer sbuf)Convert an object to an SL string. | 
| static String | wrapText(String text)Wrap a text at a given line length. | 
| static String | wrapText(String text,
         int wrap)Wrap a text at a given line length. | 
| Methods inherited from class java.lang.Object | 
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final int CONVERT_ALL
public static final int CONVERT_ALL_EXCEPT_AMP
public static final int CONVERT_NONE
public static final String NULL
public static final int SORT_UP
public static final int SORT_DOWN
| Constructor Detail | 
public SUtil()
| Method Detail | 
public static String[] getStringArray(String key,
                                      Properties props)
key - The key.props - The properties.
public static Object joinArrays(Object a1,
                                Object a2)
a1 - The first array.a2 - The second array.
public static Object[] joinArbitraryArrays(Object[] as)
as - The array of arrays to join..
public static Object cutArrays(Object a1,
                               Object a2)
a1 - The first array.a2 - The second array.
public static Object substractArrays(Object a1,
                                     Object a2)
a1 - The first array.a2 - The second array.
public static List arrayToList(Object a)
a - The array.
public static List iteratorToList(Iterator it)
public static List iteratorToList(Iterator it,
                                  List ret)
public static Object[] iteratorToArray(Iterator it,
                                       Class clazz)
public static boolean arrayContains(Object array,
                                    Object value)
array - The array.value - The value.
public static boolean equals(Object val1,
                             Object val2)
public static boolean arrayEquals(Object array1,
                                  Object array2)
public static String arrayToString(Object array)
array - The array.
public static String getSingular(String s)
s - The plural word.
public static String getPlural(String s)
s - The word.
public static int compareTo(String a,
                            String b)
a - The first string.b - The second string.
public static boolean isInRange(Date date,
                                Date start,
                                Date end)
date - The date.start - The start.end - The end.
public static String removeExtension(String fn)
fn - The filename..
public static String wrapText(String text)
text - The text to wrap.
public static String wrapText(String text,
                              int wrap)
text - The text to wrap.wrap - The column width.
public static String makeConform(String input,
                                 int flag)
input - The input string.flag - CONVERT_ALL, CONVERT_NONE, CONVERT_ALL_EXCEPT_AMP;
public static String stripTags(String source)
public static String makeEnglishConform(String input)
input - The input string.
public static String colorToHTML(Color color)
color - The color.
public static String fontToHTML(Font font)
font - The font.
public static Object fromSLString(String message)
message - The sl message.
toSLString(Object)public static String toSLString(Object o)
public static void toSLString(Object o,
                              StringBuffer sbuf)
o - The object to convert to SL.sbuf - The buffer to convert into.
public static void replace(String source,
                           StringBuffer dest,
                           String old,
                           String newstring)
source - The source string.dest - The destination string buffer.old - The string to replace.newstring - The string to use as replacement.
public static String replace(String source,
                             String old,
                             String newstring)
source - The source string.old - The string to replace.newstring - The string to use as replacement.
public static InputStream getResource(String name)
                               throws IOException
name - The resource description.
IOException - when the resource was not found.public static InputStream getResource0(String name)
name - The resource description.
public static SUtil.ResourceInfo getResourceInfo0(String name)
name - The resource description.
public static String encodeXML(Object ob)
ob - The object.
public static Object decodeXML(String xml_ob)
xml_ob - The xml representation.
public static String convertPathToPackage(String path)
path - The directory.
public static void main(String[] args)
| 
 | Jadex 0.941 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.