Constructor and Description |
---|
MiscToolT() |
Modifier and Type | Method and Description |
---|---|
static <TYPE> TYPE[] |
createArrayByComponentClassType(java.lang.Class<TYPE> clazz,
int intLength)
Creates an array according to given component class type and length.
|
static java.lang.Object |
createObjectByClassName(java.lang.String strClassFullName,
java.lang.Class<?>[] class1dConstructorParamType,
java.lang.Object[] o1dConstructorParamValue)
Creates an object according to class name and constructor arguments.
|
static <TYPE> TYPE |
createObjectByClassType(java.lang.Class<TYPE> clazz,
java.lang.Class<TYPE>[] class1dConstructorParamType,
java.lang.Object[] o1dConstructorParamValue)
Creates an object according to class type and constructor arguments.
|
static <TYPE> TYPE[][] |
filterOutColumns(TYPE[][] t2dMatrixIn,
int[] i1dInstruction)
This method creates and returns a target 2D array with
columns filtered out from the source 2D array accouding
to the instruction array.
|
static <TYPE> TYPE[] |
filterOutElements(TYPE[] t1dIn,
int[] i1dInstruction)
This method creates and returns a target array with
elements filtered out from the source array according to
the instruction array.
|
static char |
getchar(java.io.InputStream is)
Gets a character from input stream.
|
static java.lang.String |
getline(java.io.InputStream is)
Gets a string from input stream.
|
static boolean |
isContentSame(java.lang.Object obj1,
java.lang.Object obj2)
Judges whether the 2 objects have the same contents.
Returns true while the 2 objects have same contents, or while they are both null. |
static boolean |
isInScope(boolean blGiven,
boolean[] bl1dScope)
Judges whether the given value is in the given scope.
|
static boolean |
isInScope(byte byteGiven,
byte[] byte1dScope)
Judges whether the given value is in the given scope.
|
static boolean |
isInScope(char charGiven,
char[] char1dScope)
Judges whether the given value is in the given scope.
|
static boolean |
isInScope(double dGiven,
double[] d1dScope)
Judges whether the given value is in the given scope.
|
static boolean |
isInScope(float fGiven,
float[] f1dScope)
Judges whether the given value is in the given scope.
|
static boolean |
isInScope(int intGiven,
int[] int1dScope)
Judges whether the given value is in the given scope.
|
static boolean |
isInScope(long lngGiven,
long[] lng1dScope)
Judges whether the given value is in the given scope.
|
static boolean |
isInScope(short shGiven,
short[] sh1dScope)
Judges whether the given value is in the given scope.
|
static <TYPE> boolean |
isInScope(TYPE tGiven,
java.util.Collection<TYPE> clcScope)
Judges whether the given value is in the given scope.
See TextToolT.isInScopeIgnoreCase(String, Collection)
if the type of objects to judge is String and the
judgment case insensitive. |
static <TYPE> boolean |
isInScope(TYPE tGiven,
TYPE[] t1dScope)
Judges whether the given value is in the given scope.
See TextToolT.isInScopeIgnoreCase(String, String[])
if the type of objects to judge is String and the
judgment case insensitive. |
static boolean |
isInstanceOf(java.lang.Object obj,
java.lang.String strType)
Checks whether the given object is an instance of the name of given type.
|
static boolean |
isSubOf(java.lang.Object obj,
java.lang.String strType)
Deprecated.
Not ready and tested yet.
|
static boolean |
isSuperOf(java.lang.Object obj,
java.lang.String strType)
Deprecated.
Not ready and tested yet.
|
static void |
screenUp()
Screen up.
|
static void |
screenUp(int intIn)
Screen up rolls for certain rows.
|
static int |
sizeForConsole(char charIn)
Counts how much space the target string takes.
|
static int |
sizeForConsole(java.lang.String strIn)
Counts how much space the target string takes.
|
public static <TYPE> TYPE[] createArrayByComponentClassType(java.lang.Class<TYPE> clazz, int intLength)
TYPE
- - Type.clazz
- - Class type of the object to create.intLength
- - Array length.public static java.lang.Object createObjectByClassName(java.lang.String strClassFullName, java.lang.Class<?>[] class1dConstructorParamType, java.lang.Object[] o1dConstructorParamValue) throws java.lang.ClassNotFoundException, java.lang.SecurityException, java.lang.NoSuchMethodException, java.lang.IllegalArgumentException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
strClassFullName
- - Class type name.class1dConstructorParamType
- - Array of constructor parameters' type.o1dConstructorParamValue
- - Array of constructor parameters' value.java.lang.ClassNotFoundException
- .java.lang.NoSuchMethodException
- .java.lang.SecurityException
- .java.lang.reflect.InvocationTargetException
- .java.lang.IllegalAccessException
- .java.lang.InstantiationException
- .java.lang.IllegalArgumentException
- .public static <TYPE> TYPE createObjectByClassType(java.lang.Class<TYPE> clazz, java.lang.Class<TYPE>[] class1dConstructorParamType, java.lang.Object[] o1dConstructorParamValue) throws java.lang.SecurityException, java.lang.NoSuchMethodException, java.lang.IllegalArgumentException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
TYPE
- - Type.clazz
- - Class type of the object to create.class1dConstructorParamType
- - Array of constructor parameters' type.o1dConstructorParamValue
- - Array of constructor parameters' value.java.lang.NoSuchMethodException
- .java.lang.SecurityException
- .java.lang.reflect.InvocationTargetException
- .java.lang.IllegalAccessException
- .java.lang.InstantiationException
- .java.lang.IllegalArgumentException
- .public static <TYPE> TYPE[][] filterOutColumns(TYPE[][] t2dMatrixIn, int[] i1dInstruction) throws java.lang.Exception
TYPE
- - Type.t2dMatrixIn
- - The source 2D array.i1dInstruction
- - The instruction array.java.lang.Exception
- .public static <TYPE> TYPE[] filterOutElements(TYPE[] t1dIn, int[] i1dInstruction)
TYPE
- - Type.t1dIn
- - The source array.i1dInstruction
- - The instruction array.public static char getchar(java.io.InputStream is) throws java.io.IOException
is
- - Input stream.java.io.IOException
- .public static java.lang.String getline(java.io.InputStream is) throws java.io.IOException
is
- - Input stream.java.io.IOException
- .public static boolean isContentSame(java.lang.Object obj1, java.lang.Object obj2)
obj1
- - One object to compare.obj2
- - Another object to compare.public static boolean isInScope(boolean blGiven, boolean[] bl1dScope)
blGiven
- - The given value.bl1dScope
- - The reference scope.public static boolean isInScope(byte byteGiven, byte[] byte1dScope)
byteGiven
- - The given value.byte1dScope
- - The reference scope.public static boolean isInScope(short shGiven, short[] sh1dScope)
shGiven
- - The given value.sh1dScope
- - The reference scope.public static boolean isInScope(int intGiven, int[] int1dScope)
intGiven
- - The given value.int1dScope
- - The reference scope.public static boolean isInScope(char charGiven, char[] char1dScope)
charGiven
- - The given value.char1dScope
- - The reference scope.public static boolean isInScope(long lngGiven, long[] lng1dScope)
lngGiven
- - The given value.lng1dScope
- - The reference scope.public static boolean isInScope(float fGiven, float[] f1dScope)
fGiven
- - The given value.f1dScope
- - The reference scope.public static boolean isInScope(double dGiven, double[] d1dScope)
dGiven
- - The given value.d1dScope
- - The reference scope.public static <TYPE> boolean isInScope(TYPE tGiven, TYPE[] t1dScope)
TextToolT.isInScopeIgnoreCase(String, String[])
if the type of objects to judge is String
and the
judgment case insensitive.TYPE
- - Type.tGiven
- - The given value.t1dScope
- - The reference scope.public static <TYPE> boolean isInScope(TYPE tGiven, java.util.Collection<TYPE> clcScope)
TextToolT.isInScopeIgnoreCase(String, Collection)
if the type of objects to judge is String
and the
judgment case insensitive.TYPE
- - Type.tGiven
- - The given value.clcScope
- - The reference scope.public static boolean isInstanceOf(java.lang.Object obj, java.lang.String strType) throws java.lang.ClassNotFoundException
obj
- - Target object to match type.strType
- - Class type name.java.lang.ClassNotFoundException
- .@Deprecated public static boolean isSubOf(java.lang.Object obj, java.lang.String strType)
obj
- - Target object to match type.strType
- - Class type name.@Deprecated public static boolean isSuperOf(java.lang.Object obj, java.lang.String strType)
obj
- - Target object to match type.strType
- - Class type name.public static void screenUp()
public static void screenUp(int intIn)
intIn
- - Line count to roll up.public static int sizeForConsole(char charIn)
charIn
- - The incoming character.public static int sizeForConsole(java.lang.String strIn)
strIn
- - The incoming character.