public class ListUtils
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
ListUtils()
Don't allow instantiation, do allow overrides.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.String> |
loadList(java.io.File listFile,
java.lang.String encoding)
Load string list from a file.
|
static java.util.List<java.lang.String> |
loadList(java.util.List<java.lang.String> list,
java.io.File listFile,
java.lang.String encoding)
Load string list from a file.
|
static java.util.List<java.lang.String> |
loadList(java.util.List<java.lang.String> list,
java.lang.String listFileName,
java.lang.String encoding)
Load string list from a file name.
|
static java.util.List<java.lang.String> |
loadList(java.util.List<java.lang.String> list,
java.net.URL setURL,
java.lang.String encoding)
Load string list from a URL.
|
static java.util.List<java.lang.String> |
loadList(java.lang.String listFileName,
java.lang.String encoding)
Load string list from a file name.
|
static java.util.List<java.lang.String> |
loadList(java.net.URL setURL,
java.lang.String encoding)
Load string list from a URL.
|
static void |
saveList(java.util.List<?> list,
java.io.File listFile,
java.lang.String encoding)
Save list as string to a file.
|
static void |
saveList(java.util.List<?> list,
java.lang.String listFileName,
java.lang.String encoding)
Save list as string to a file name.
|
static <E> java.util.List<E> |
shallowClone(java.util.List<E> list)
Get shallow clone of list contents.
|
public static java.util.List<java.lang.String> loadList(java.util.List<java.lang.String> list, java.net.URL setURL, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
list
- List into which to load strings.
Created if null.setURL
- URL for list file.encoding
- Character encoding for the file.java.io.FileNotFoundException
- If input file does not exist.java.io.IOException
- If input file cannot be opened.public static java.util.List<java.lang.String> loadList(java.net.URL setURL, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
setURL
- URL for list file.encoding
- Character encoding for the file.java.io.FileNotFoundException
- If input file does not exist.java.io.IOException
- If input file cannot be opened.public static java.util.List<java.lang.String> loadList(java.util.List<java.lang.String> list, java.io.File listFile, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
list
- List into which to load strings.
Created if null.listFile
- File from which to load list.encoding
- Character encoding for the file.java.io.FileNotFoundException
- If input file does not exist.java.io.IOException
- If input file cannot be opened.public static java.util.List<java.lang.String> loadList(java.io.File listFile, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
listFile
- File from which to load list.encoding
- Character encoding for the file.java.io.FileNotFoundException
- If input file does not exist.java.io.IOException
- If input file cannot be opened.public static java.util.List<java.lang.String> loadList(java.util.List<java.lang.String> list, java.lang.String listFileName, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
list
- List into which to load strings.
Created if null.listFileName
- File name from which to load list.encoding
- Character encoding for the file.java.io.FileNotFoundException
- If input file does not exist.java.io.IOException
- If input file cannot be opened.public static java.util.List<java.lang.String> loadList(java.lang.String listFileName, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
listFileName
- File name from which to load list.encoding
- Character encoding for the file.java.io.FileNotFoundException
- If input file does not exist.java.io.IOException
- If input file cannot be opened.public static void saveList(java.util.List<?> list, java.io.File listFile, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
list
- List to save.listFile
- Output file name.encoding
- Character encoding for the file.java.io.IOException
- If output file has error.java.io.FileNotFoundException
public static void saveList(java.util.List<?> list, java.lang.String listFileName, java.lang.String encoding) throws java.io.IOException, java.io.FileNotFoundException
list
- List to save.listFileName
- Output file name.encoding
- Character encoding for the file.java.io.IOException
- If output file has error.java.io.FileNotFoundException
public static <E> java.util.List<E> shallowClone(java.util.List<E> list)
list
- List to clone.