public class MiscToolP extends MiscToolT
Constructor and Description |
---|
MiscToolP() |
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 accouding 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 TextToolP.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 TextToolP.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 |
sizeForScreen(char cIn)
Counts how much space the target string takes.
|
static int |
sizeForScreen(java.lang.String strIn)
Counts how much space the target string takes.
|
sizeForConsole, sizeForConsole
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)
strClassFullName
- - Class type name.class1dConstructorParamType
- - Array of constructor parameters' type.o1dConstructorParamValue
- - Array of constructor parameters' value.public static <TYPE> TYPE createObjectByClassType(java.lang.Class<TYPE> clazz, java.lang.Class<TYPE>[] class1dConstructorParamType, java.lang.Object[] o1dConstructorParamValue)
TYPE
- - Type.clazz
- - Class type of the object to create.class1dConstructorParamType
- - Array of constructor parameters' type.o1dConstructorParamValue
- - Array of constructor parameters' value.public static <TYPE> TYPE[][] filterOutColumns(TYPE[][] t2dMatrixIn, int[] i1dInstruction)
TYPE
- - Type.t2dMatrixIn
- - The source 2D array.i1dInstruction
- - The instruction array.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)
is
- - Input stream.public static java.lang.String getline(java.io.InputStream is)
is
- - Input stream.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)
TextToolP.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)
TextToolP.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)
obj
- - Target object to match type.strType
- - Class type name.@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 sizeForScreen(char cIn)
cIn
- - The incoming character.public static int sizeForScreen(java.lang.String strIn)
strIn
- - The incoming character.