|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlegacy.Helpers
public class Helpers
Helpers.class defines methods and classes for reuse.
Constructor Summary | |
---|---|
Helpers()
|
Method Summary | |
---|---|
static boolean |
classExtends(java.lang.Class sibling,
java.lang.Class parent)
c(Class,Class) determins it the first class is a sebling of the second. |
static boolean |
classExtends(java.lang.String siblingCanonicalName,
java.lang.String parentCanonicalName)
c(Class,Class) determins it the first class is a sebling of the second. |
static java.lang.String |
getCallerClass(int depth)
getCallerClass() used by methods which restrice access or require knowlage of the caller of itsef. |
static java.lang.String |
getCallerMethod(int depth)
getCallerMethod() used by methods which restrice access or require knowlage of the caller of itsef. |
static java.lang.String |
getExtension(java.lang.String ext)
getExtension(String ext) returns in general the extension of a file or a sub string of the last index of "." in a string to the end of that string |
static java.io.InputStream |
getInputStreamProtocol(java.lang.String location)
getInputStreamProtocol(String) return a readable stream from a string location. Allowed Protocols jar:// ie jar://c:/path/my.jar/mypackage/myfile.txt Warning will not allow recusive jar files and oly allows acces to local storage devices zip:// indenticle to above file:// ie file://c:/myfile.txt where myfile.txt is located on a logical(local) device http:// as per URL socket://address/port ie socket://127.0.0.1/256 where a socket will stream the data from a port 256 from this machine failing this getInputStreamProtocol will attemt to load the location as from a url or file. |
static Arrays<java.lang.Integer> |
getIntegerArray()
getIntegerArray() gets a casted Array<?>type for use/reuse to prevent extensive object construction |
static Arrays<RGB> |
getRGBArray()
getRGBArray() gets a casted Array<?>type for use/reuse to prevent extensive object construction |
static void |
main(java.lang.String[] args)
|
static int |
pack(int x,
int y,
int z,
int u)
pack packs 4 byte values ranging from 0 to 255 into a single integer |
static int[] |
unpack(int value)
unpack extracts four bytes from an integer and return the values hi to low bytes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Helpers()
Method Detail |
---|
public static Arrays<RGB> getRGBArray()
public static Arrays<java.lang.Integer> getIntegerArray()
public static java.lang.String getCallerMethod(int depth)
depth
- how far back to look into stack
public static java.lang.String getCallerClass(int depth)
depth
- how far back to look into stack
public static boolean classExtends(java.lang.Class sibling, java.lang.Class parent)
sibling
- as .class ie classExtends(for.class,bar.class) Not class.getClass()parent
- as .class ie classExtends(for.class,bar.class) Not class.getClass()
public static boolean classExtends(java.lang.String siblingCanonicalName, java.lang.String parentCanonicalName)
siblingCanonicalName
- as canonical name forparentCanonicalName
- as canonical name for
public static java.lang.String getExtension(java.lang.String ext)
ext
- string expected to contain an extension
public static java.io.InputStream getInputStreamProtocol(java.lang.String location)
location
- we are looking at
public static final int pack(int x, int y, int z, int u)
x
- byte mask 0xFF000000y
- byte mask 0x00FF0000z
- byte mask 0x0000FF00u
- byte mask 0x000000FF
public static final int[] unpack(int value)
value
- to unpack
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |