Search in sources :

Example 61 with StringTokenizer

use of java.util.StringTokenizer in project android_frameworks_base by ParanoidAndroid.

the class ColladaParser method parseFloat4.

private Float4 parseFloat4(String valueString) {
    StringTokenizer st = new StringTokenizer(valueString);
    float x = Float.parseFloat(st.nextToken());
    float y = Float.parseFloat(st.nextToken());
    float z = Float.parseFloat(st.nextToken());
    float w = Float.parseFloat(st.nextToken());
    return new Float4(x, y, z, w);
}
Also used : StringTokenizer(java.util.StringTokenizer)

Example 62 with StringTokenizer

use of java.util.StringTokenizer in project android_frameworks_base by ParanoidAndroid.

the class ColladaParser method parseFloat3.

private Float3 parseFloat3(String valueString) {
    StringTokenizer st = new StringTokenizer(valueString);
    float x = Float.parseFloat(st.nextToken());
    float y = Float.parseFloat(st.nextToken());
    float z = Float.parseFloat(st.nextToken());
    return new Float3(x, y, z);
}
Also used : StringTokenizer(java.util.StringTokenizer)

Example 63 with StringTokenizer

use of java.util.StringTokenizer in project che by eclipse.

the class PreferenceConstants method getExcludedCompletionProposalCategories.

//	/**
//	 * Encodes a JRE library to be used in the named preference <code>NEWPROJECT_JRELIBRARY_LIST</code>.
//	 *
//	 * @param description a string value describing the JRE library. The description is used
//	 * to identify the JDR library in the UI
//	 * @param entries an array of classpath entries to be encoded
//	 *
//	 * @return the encoded string.
//	 */
//	public static String encodeJRELibrary(String description, IClasspathEntry[] entries) {
//		return NewJavaProjectPreferencePage.encodeJRELibrary(description, entries);
//	}
//
//	/**
//	 * Decodes an encoded JRE library and returns its description string.
//	 * @param encodedLibrary the encoded library
//	 * @return the description of an encoded JRE library
//	 *
//	 * @see #encodeJRELibrary(String, IClasspathEntry[])
//	 */
//	public static String decodeJRELibraryDescription(String encodedLibrary) {
//		return NewJavaProjectPreferencePage.decodeJRELibraryDescription(encodedLibrary);
//	}
//
//	/**
//	 * Decodes an encoded JRE library and returns its class path entries.
//	 * @param encodedLibrary the encoded library
//	 * @return the array of classpath entries of an encoded JRE library.
//	 *
//	 * @see #encodeJRELibrary(String, IClasspathEntry[])
//	 */
//	public static IClasspathEntry[] decodeJRELibraryClasspathEntries(String encodedLibrary) {
//		return NewJavaProjectPreferencePage.decodeJRELibraryClasspathEntries(encodedLibrary);
//	}
//	/**
//	 * Returns the current configuration for the JRE to be used as default in new Java projects.
//	 * This is a convenience method to access the named preference <code>NEWPROJECT_JRELIBRARY_LIST
//	 * </code> with the index defined by <code> NEWPROJECT_JRELIBRARY_INDEX</code>.
//	 *
//	 * @return the current default set of class path entries
//	 *
//	 * @see #NEWPROJECT_JRELIBRARY_LIST
//	 * @see #NEWPROJECT_JRELIBRARY_INDEX
//	 */
//	public static IClasspathEntry[] getDefaultJRELibrary() {
//		return NewJavaProjectPreferencePage.getDefaultJRELibrary();
//	}
/**
	 * Returns the completion proposal categories which
	 * are excluded from the default proposal list.
	 *
	 * @return an array with the IDs of the excluded categories
	 * @see #CODEASSIST_EXCLUDED_CATEGORIES
	 * @since 3.4
	 */
public static String[] getExcludedCompletionProposalCategories() {
    String encodedPreference = getPreference(CODEASSIST_EXCLUDED_CATEGORIES, null);
    //$NON-NLS-1$
    StringTokenizer tokenizer = new StringTokenizer(encodedPreference, "\0");
    String[] result = new String[tokenizer.countTokens()];
    for (int i = 0; i < result.length; i++) result[i] = tokenizer.nextToken();
    return result;
}
Also used : StringTokenizer(java.util.StringTokenizer)

Example 64 with StringTokenizer

use of java.util.StringTokenizer in project che by eclipse.

the class ExtensionsRegistry method read.

/**
	 * Reads the comma-separated value from the given configuration element for the given attribute name and remembers
	 * the configuration element in the given map under the individual tokens of the attribute value.
	 *
	 * @param attributeName the name of the attribute
	 * @param element the configuration element
	 * @param map the map which remembers the configuration element
	 */
private void read(String attributeName, IConfigurationElement element, Map map) {
    String value = element.getAttribute(attributeName);
    if (value != null) {
        //$NON-NLS-1$
        StringTokenizer tokenizer = new StringTokenizer(value, ",");
        while (tokenizer.hasMoreTokens()) {
            String token = tokenizer.nextToken().trim();
            Set s = (Set) map.get(token);
            if (s == null) {
                s = new HashSet();
                map.put(token, s);
            }
            s.add(element);
        }
    }
}
Also used : StringTokenizer(java.util.StringTokenizer) Set(java.util.Set) HashSet(java.util.HashSet) HashSet(java.util.HashSet)

Example 65 with StringTokenizer

use of java.util.StringTokenizer in project che by eclipse.

the class QualifiedNameFinder method getFilePattern.

private static Pattern getFilePattern(String filePatterns) {
    //$NON-NLS-1$
    StringTokenizer tokenizer = new StringTokenizer(filePatterns, ",");
    String[] filePatternArray = new String[tokenizer.countTokens()];
    int i = 0;
    while (tokenizer.hasMoreTokens()) {
        filePatternArray[i++] = tokenizer.nextToken().trim();
    }
    return PatternConstructor.createPattern(filePatternArray, true, false);
}
Also used : StringTokenizer(java.util.StringTokenizer)

Aggregations

StringTokenizer (java.util.StringTokenizer)4881 ArrayList (java.util.ArrayList)1083 IOException (java.io.IOException)506 File (java.io.File)392 BufferedReader (java.io.BufferedReader)380 HashMap (java.util.HashMap)375 HashSet (java.util.HashSet)263 FileReader (java.io.FileReader)224 List (java.util.List)200 InputStreamReader (java.io.InputStreamReader)191 Map (java.util.Map)152 FileInputStream (java.io.FileInputStream)135 Iterator (java.util.Iterator)114 Set (java.util.Set)114 URL (java.net.URL)108 NoSuchElementException (java.util.NoSuchElementException)90 Properties (java.util.Properties)84 InputStream (java.io.InputStream)83 BufferedWriter (java.io.BufferedWriter)80 FileNotFoundException (java.io.FileNotFoundException)78