/** * Check if a file represents a floppy. * Returns false on android. */ public static boolean isFloppyDrive(File file) { return SReflect.isAndroid() ? false : SNonAndroid.isFloppyDrive(file); }
/** * Get the display name (e.g. of a system drive). * Returns null on android. */ public static String getDisplayName(File file) { return SReflect.isAndroid() ? null : SNonAndroid.getDisplayName(file); }
/** * Test if a call is running on a gui (e.g. Swing or Android UI) thread. * Currently returns false on android. */ public static boolean isGuiThread() { // Todo: ask android helper for android UI thread. return SReflect.isAndroid() ? false : SNonAndroid.isGuiThread(); }
/** * Test if the processor is applicable. * @param object The object. * @param targetcl If not null, the traverser should make sure that the result object is compatible with the class loader, * e.g. by cloning the object using the class loaded from the target class loader. * @return True, if is applicable. */ public boolean isApplicable(Object object, Type type, boolean clone, ClassLoader targetcl) { Class<?> clazz = SReflect.getClass(type); return SReflect.isSupertype(Enumeration.class, clazz); }
/** * Tests if the decoder can decode the class. * @param clazz The class. * @return True, if the decoder can decode this class. */ public boolean isApplicable(Class<?> clazz) { return SReflect.isSupertype(InetAddress.class, clazz); }
/** * Get the properties of the mechanism. */ public Properties getProperties() { Properties props = new Properties(); props.addProperty(new Property("responses", ""+responses)); return props; }
/** * Get a string property. * @param type The type. * @return Returns the string value or null if not set. */ public static String getStringProperty(Properties[] props, String type) { Property prop = getLatestProperty(props, type); return prop==null? null: prop.getValue(); }
/** * This is a wrapper to <code>decode(final byte[] code, final int from, final int len)</code> * @param code * @return a byte array holding encoded char data */ public final static byte[] decode(final byte[] code) { return decode(code, 0, code.length); }
/** * Create a new guesser. */ public SimpleMethodParameterGuesser(Collection<?> vals)//Class<?>[] ptypes, Collection<?> vals) { this(new SimpleParameterGuesser(vals)); }
/** This is a wrapper to <code>toCharArray(final byte[] text, final int from, final int len)</code> * @param text * @return an encoded char array from the text */ public final static char[] toCharArray(final byte[] text) { return toCharArray(text, 0, text.length); }
public void resultAvailable(Collection<String> result) { for(String res: result) { intermediateResultAvailable(res); } finished(); }
/** * <code>decodeCRLF(code, 0, code.length, 76)</code> * @param code * @return the encoded text; */ public final static byte[] decode76(final char[] code) { return decodeCRLF(code, 0, code.length, 76); }
/** * Create a debug exception. */ public DebugException() { fillInStackTrace(); }
/** * Create a new thread pool. */ public ThreadPool() { this(new DefaultPoolStrategy(0, 20, 30000, 0)); }
/** * Load a model. * @param name The name of the model (file name or logical name). * @param imports The imports to use when resolving logical names. * @param clkey The class loader key to allow caching by e.g. RID. */ public synchronized ICacheableModel loadModel(String name, String[] imports, Object clkey, ClassLoader classloader, Object context) throws Exception { return loadModel(name, null, imports, clkey, classloader, context); }
/** * Test if the processor is applicable. * @param object The object. * @param targetcl If not null, the traverser should make sure that the result object is compatible with the class loader, * e.g. by cloning the object using the class loaded from the target class loader. * @return True, if is applicable. */ public boolean isApplicable(Object object, Type type, boolean clone, ClassLoader targetcl) { Class<?> clazz = SReflect.getClass(type); return SReflect.isSupertype(Set.class, clazz); }
/** * Tests if the decoder can decode the class. * @param clazz The class. * @return True, if the decoder can decode this class. */ public boolean isApplicable(Class<?> clazz) { return SReflect.isSupertype(StackTraceElement.class, clazz); }
/** * Get the properties of the mechanism. */ public Properties getProperties() { Properties props = new Properties(); props.addProperty(new Property("responses", ""+responses)); return props; }
/** * Get a string property. * @param type The type. * @return Returns the string value or null if not set. */ public String getStringProperty(String type) { Property prop = getLatestProperty(type); return prop==null? null: prop.getValue(); }
/** * Tests if the decoder can decode the class. * @param clazz The class. * @return True, if the decoder can decode this class. */ public boolean isApplicable(Class<?> clazz) { return SReflect.isSupertype(Collection.class, clazz); }