|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--voji.utils.U
This class contains many methods which are useful for java.lang.String, java.util.Vector, java.sql.ResultSet and java.sql.PreparedStatement. These methods should be a part of the API of those classes, but they aren't. So this is a work-around, but no solution.
Message to Sun: Please complete your API! The functions here are simple, but are often indispensible and would be great additions.
Method Summary | |
static java.util.Vector |
add(java.util.Vector vector,
java.util.Enumeration enum)
Adds all elements of an Enumeration to a Vector. |
static java.util.Vector |
add(java.util.Vector vector,
java.util.Iterator iterator)
Adds all elements of an Iterator to a Vector. |
static java.util.Vector |
add(java.util.Vector vector,
java.lang.Object[] objects)
Adds the content of an Object Array to a Vector. |
static java.lang.String |
format(java.text.Format format,
java.lang.Object object)
Formats an Object using a Format without throwing an exception |
static java.lang.String |
format(java.text.Format format,
java.lang.Object object,
java.lang.String def)
Formats an Object using a Format without throwing an exception |
static java.util.Vector |
getColumnNames(java.sql.ResultSet resultSet)
Puts a ResultSet's column names into a Vector |
static java.util.Vector |
getColumnNames(java.sql.ResultSetMetaData metaData)
Puts a ResultSetMetaData's column names into a Vector |
static java.lang.Object |
parseObject(java.text.Format format,
java.lang.String string)
Parses a String using a Format without throwing an exception |
static java.util.Vector |
removeAll(java.util.Vector vector,
java.lang.Object object)
Removes all occurences of an Object from a Vector. |
static java.lang.StringBuffer |
replace(java.lang.StringBuffer text,
java.lang.String from,
java.lang.String to)
Replaces all occurences of a sub String in a StringBuffer. |
static java.lang.String |
replace(java.lang.String text,
java.lang.String from,
java.lang.String to)
Replaces all occurences of a sub String in a String |
static java.util.Vector |
splitString(java.lang.String text,
java.lang.String start,
java.lang.String between,
java.lang.String end)
Splits a String |
static java.util.Vector |
splitStringNE(java.lang.String text,
java.lang.String start,
java.lang.String between,
java.lang.String end)
Splits a String into non-empty parts |
static void |
synchronizeDirectory(javax.swing.JFileChooser fileChooser)
Synchronizes the current directory between file choosers. |
static java.lang.Object[] |
toArray(java.util.Vector vector)
Converts a Vector into an Array. |
static java.lang.Object[][] |
toArrayOfArrays(java.util.Vector vector)
Converts a Vector of Vectors to an Array of Object Arrays |
static java.lang.String |
toString(java.util.Vector parts,
java.lang.String start,
java.lang.String between,
java.lang.String end)
Concatenates some Strings |
static java.lang.String[] |
toStringArray(java.util.Vector vector)
Converts a Vector into a String Array. |
static java.util.Vector |
toVector(java.util.Enumeration enum)
Converts an Enumeration to a Vector. |
static java.util.Vector |
toVector(java.util.Iterator iterator)
Converts an Iterator to a Vector. |
static java.util.Vector |
toVector(java.lang.Object[] objects)
Converts an Object Array to a Vector. |
static java.util.Vector |
toVector(java.sql.ResultSet resultSet)
Puts the current row's data of a ResultSet into a Vector |
static java.util.Vector |
toVectorOfVectors(java.lang.Object[][] objects)
Converts an Array of Object Arrays to a Vector of Vectors |
static java.util.Vector |
toVectorOfVectors(java.sql.ResultSet resultSet)
Converts a ResultSet into a Vector of Vectors. |
static java.util.Vector |
toVectorOfVectors(java.sql.ResultSet resultSet,
int maxRows)
Converts a ResultSet into a Vector of Vectors. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.util.Vector removeAll(java.util.Vector vector, java.lang.Object object)
vector
- the Vector where to remove fromobject
- the Object whose equal occourences have to be removed
public static java.util.Vector add(java.util.Vector vector, java.util.Enumeration enum)
vector
- the Vector where to insert the elementsenum
- the Enumeration where to take the elements from
public static java.util.Vector toVector(java.util.Enumeration enum)
enum
- the Enumeration where to take the elements from
public static java.util.Vector add(java.util.Vector vector, java.util.Iterator iterator)
vector
- the Vector where to insert the elementsiterator
- the Iterator where to take the elements from
public static java.util.Vector toVector(java.util.Iterator iterator)
iterator
- the Iterator where to take the elements from
public static java.util.Vector add(java.util.Vector vector, java.lang.Object[] objects)
vector
- the Vector where to insert the elementsobjects
- the Array where to take the elements from
public static java.util.Vector toVector(java.lang.Object[] objects)
objects
- the Object Array where to take the elements from
public static java.util.Vector toVectorOfVectors(java.lang.Object[][] objects)
objects
- the Array of Object Arrays
where to take the elements from
public static java.lang.Object[][] toArrayOfArrays(java.util.Vector vector)
vector
- the Vector of Vectors where to take the elements from
public static java.util.Vector getColumnNames(java.sql.ResultSetMetaData metaData) throws java.sql.SQLException
metaData
- the ResultSetMetaData
where to take the column names from
java.sql.SQLException
- if there is an SQLException
while working with the ResultSetMetaDatapublic static java.util.Vector getColumnNames(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- the ResultSet where to take the column names from
java.sql.SQLException
- if there is an SQLException
while working with the ResultSetpublic static java.util.Vector toVector(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- the ResultSet where to get the data from
java.sql.SQLException
- if there is an SQLException
while working with the ResultSetpublic static java.util.Vector toVectorOfVectors(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- the ResultSet where to take the data from
java.sql.SQLException
- if there is an SQLException
while working with the ResultSetpublic static java.util.Vector toVectorOfVectors(java.sql.ResultSet resultSet, int maxRows) throws java.sql.SQLException
resultSet
- the ResultSet where to take the data frommaxRows
- the maximum number of rows
or -1
for no maximum
java.sql.SQLException
- if there is an SQLException
while working with the ResultSetpublic static java.lang.Object[] toArray(java.util.Vector vector)
vector
- the Vector where to take the Objects from
public static java.lang.String[] toStringArray(java.util.Vector vector)
vector
- the Vector where to take the Strings from
public static java.util.Vector splitString(java.lang.String text, java.lang.String start, java.lang.String between, java.lang.String end)
text
- the String to splitstart
- the begin of the String which has to be ignoredbetween
- the separator between all the parts of text
end
- the end of the String which has to be ignored
text
public static java.util.Vector splitStringNE(java.lang.String text, java.lang.String start, java.lang.String between, java.lang.String end)
text
- the String to splitstart
- the begin of the String which has to be ignoredbetween
- the separator between all the parts of text
end
- the end of the String which has to be ignored
text
without the empty ones.public static java.lang.String toString(java.util.Vector parts, java.lang.String start, java.lang.String between, java.lang.String end)
parts
- a Vector containing the partsstart
- the begin of the full Stringbetween
- the String which is situated between the partsend
- the end of the full String
public static java.lang.StringBuffer replace(java.lang.StringBuffer text, java.lang.String from, java.lang.String to)
text
- the input StringBuffer where to replacefrom
- the sub String which has to replaced by to
to
- the sub String
which has to be used instead of from
public static java.lang.String replace(java.lang.String text, java.lang.String from, java.lang.String to)
text
- the input String where to replacefrom
- the sub String which has to replaced by to
to
- the sub String
which has to be used instead of from
public static java.lang.Object parseObject(java.text.Format format, java.lang.String string)
format
- the Format object that has to parsestring
- the String that has to be parsed
string
when
format is null
or null
when
there was an exception during the parsingpublic static java.lang.String format(java.text.Format format, java.lang.Object object, java.lang.String def)
format
- the Format object that has to formatobject
- the Object that has to be formatteddef
- the default String to return on problems
object.toString()
when format is null or def
when
there was an exception during the formatting- See Also:
format(Format,Object)
public static java.lang.String format(java.text.Format format, java.lang.Object object)
format
- the Format object that has to formatobject
- the Object that has to be formatted
object.toString()
when format is null or ""
when
there was an exception during the formatting- See Also:
format(Format,Object,String)
public static void synchronizeDirectory(javax.swing.JFileChooser fileChooser)
fileChooser
- the FileChooser
whose current directory
needs to be set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |