|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.javaranch.common.Structures
A collection of static methods related to data structures.
- - - - - - - - - - - - - - - - -
Copyright (c) 1998-2004 Paul Wheaton
You are welcome to do whatever you want to with this source file provided that you maintain this comment fragment (between the dashed lines). Modify it, change the package name, change the class name ... personal or business use ... sell it, share it ... add a copyright for the portions you add ...
My goal in giving this away and maintaining the copyright is to hopefully direct developers back to JavaRanch.
The original source can be found at JavaRanch
- - - - - - - - - - - - - - - - -
Method Summary | |
static java.lang.String |
arrayToString(java.lang.String[] text)
|
static java.lang.String[] |
listToStringArray(java.util.List list)
|
static java.lang.String |
setToString(java.util.Set set)
Given a set, return a string with a newline between each object's toString() results. |
static java.lang.String[] |
stringToArray(java.lang.String text)
|
static java.util.Set |
stringToSet(java.lang.String text)
Given a space or newline delimited string, inner strings will be extracted and moved to a Set. |
static byte[] |
subArray(byte[] b,
int index,
int length)
Get a sub array from a byte array. |
static java.lang.Object[] |
subArray(java.lang.Object[] obj,
int index,
int length)
Get a shallow sub array from an object array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static byte[] subArray(byte[] b, int index, int length)
b
- The original array. It will not be modified. index
- Where the new array is to be copied from. If index is 0, the very first byte
from b will be included. If first is beyond the last byte in b, this
method will return null. length
- The number of bytes to be copied. If there are fewer than length bytes left,
how ever many are left will be returned.
public static java.lang.Object[] subArray(java.lang.Object[] obj, int index, int length)
obj
- The original array. It will not be modified. index
- Where the new array is to be copied from. If index is 0, the very first object reference
from obj will be included. If first is beyond the last object reference in obj, this
method will return null. length
- The number of object references to be copied. If there are fewer than length references left,
how ever many are left will be returned.
public static java.lang.String[] stringToArray(java.lang.String text)
public static java.lang.String arrayToString(java.lang.String[] text)
public static java.lang.String setToString(java.util.Set set)
public static java.util.Set stringToSet(java.lang.String text)
public static java.lang.String[] listToStringArray(java.util.List list)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |