Java 8 InvalidPreferencesFormatException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InvalidPreferencesFormatException class.

This code example shows how to use the following methods:getCause, getMessage
 
/** 
 *  
 */ 
@TestTargetClass(InvalidPreferencesFormatException.class)
public class InvalidPreferencesFormatExceptionTest extends TestCase {
 
    /* 
     * Class under test for void InvalidPreferencesFormatException(String) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "InvalidPreferencesFormatException", 
        args = {java.lang.String.class}
    ) 
    public void testInvalidPreferencesFormatExceptionString() { 
        InvalidPreferencesFormatException e = new InvalidPreferencesFormatException(
        "msg"); 
        assertNull(e.getCause());
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    private String readTill(String s)
                    throws InvalidPreferencesFormatException 
    { 
        int index = line.indexOf(s);
        if (index == -1)
                throw new InvalidPreferencesFormatException(s + " not found");
 
        String read = line.substring(0, index);
        line = line.substring(index+s.length());
 
        return read;
    } 
 
    private String nextTag()
                    throws InvalidPreferencesFormatException, IOException 
    { 
        while(true) { 
            if (line == null)
                throw new InvalidPreferencesFormatException("unexpected EOF");
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
     * @throws InvalidPreferencesFormatException 
     */ 
    public static int getBrightness(String preference) throws InvalidPreferencesFormatException {
    	String[] values = preference.split(":");
    	if (values.length != 2) {
    		throw new InvalidPreferencesFormatException(preference);
    	} 
    	 
    	return Integer.parseInt(values[1]);
    } 
 
    /** 
     * Get brightness mode from preference string. 
     * @param preference 
     * @return 
     * @throws InvalidPreferencesFormatException 
     */ 
    public static int getBrightnessMode(String preference) throws InvalidPreferencesFormatException {
    	String[] values = preference.split(":");
    	if (values.length != 2) {
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
		if(textSizeString == null){
			throw new NullTextSizeAttributeException(); 
		} 
		 
		if(!textSizeString.matches(pattern))
			throw new InvalidPreferencesFormatException("Error: This type not allowed (at " + (isTitle ? "title_" : "summary_") + "text_size; acceptable units are dp, dip, or px)");
		 
		float num = Float.parseFloat(textSizeString.replaceAll("(dp|px|dip){1}$", ""));
		String type = textSizeString.replaceAll("^\\d+(\\.\\d+|)", "");
		 
		if(type == "px")
			return density / num;
		else 
			return num;
	} 
	 
	public int getCurrentValue(){ 
		return mCurrentValue;
	} 
	 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    private String readTill(String s)
                    throws InvalidPreferencesFormatException 
    { 
        int index = line.indexOf(s);
        if (index == -1)
                throw new InvalidPreferencesFormatException(s + " not found");
 
        String read = line.substring(0, index);
        line = line.substring(index+s.length());
 
        return read;
    } 
 
    private String nextTag()
                    throws InvalidPreferencesFormatException, IOException 
    { 
        while(true) { 
            if (line == null)
                throw new InvalidPreferencesFormatException("unexpected EOF");
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 InvalidPreferencesFormatException Methods: