|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.norvelle.textcite.model.Utils
public class Utils
Utils
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static java.lang.String |
getExtension(java.io.File f)
Get the extension of a file. |
static java.lang.Object |
getObjectAtIteratorPos(java.util.Iterator i,
int pos)
Given a numeric position, cycle through the given Iterator until the position is reached, and return the Object found there. |
static int |
getPosInEnumeration(java.util.Enumeration e,
java.lang.Object o)
Find the location of a given object in an Enumeration. |
static int |
getPosInIterator(java.util.Iterator i,
java.lang.Object o)
Find the location of a given object in an Iterator. |
static java.lang.String |
loadTextFile(java.lang.String filename)
Load a text file into a string, from within the Jar itself |
static java.lang.String |
noNullString(java.lang.String s)
Useful for situations where one needs to use a string, while being sure that it isn't null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static int getPosInIterator(java.util.Iterator i, java.lang.Object o)
i
- The Iterator that contains the objects to be compared againsto
- The Object that is to be located
public static int getPosInEnumeration(java.util.Enumeration e, java.lang.Object o)
i
- The Enumeration that contains the objects to be compared againsto
- The Object that is to be located
public static java.lang.Object getObjectAtIteratorPos(java.util.Iterator i, int pos) throws java.lang.ArrayIndexOutOfBoundsException
i
- The Iterator to be cycled through.pos
- The numeric position of the Object to be returned
java.lang.ArrayIndexOutOfBoundsException
public static java.lang.String getExtension(java.io.File f)
f
- The File object to extract the extension from
public static java.lang.String loadTextFile(java.lang.String filename) throws java.io.IOException
filename
- The path + name of the file to load, relative to the Application class
java.io.IOException
public static java.lang.String noNullString(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |