protected int asInt(String string, int defaultValue) { if (string != null) { return StringConverter.asInt(string, defaultValue); } return defaultValue; }
protected int asInt(String string, int defaultValue) { if (string != null) { return StringConverter.asInt(string, defaultValue); } return defaultValue; }
private static int asInt(String string, int defaultValue) { if (string != null) { return StringConverter.asInt(string, defaultValue); } return defaultValue; }
private static int asInt(String string, int defaultValue) { if (string != null) { return StringConverter.asInt(string, defaultValue); } return defaultValue; }
protected int asInt(String string, int defaultValue) { if (string != null) { return StringConverter.asInt(string, defaultValue); } return defaultValue; }
/** * Converts the given value into an int. * Returns the given default value if the * value does not represent an int. * * @param value the value to be converted * @param dflt the default value * @return the value as an int, or the default value */ public static int asInt(String value, int dflt) { try { return asInt(value); } catch (DataFormatException e) { return dflt; } }
/** * Converts the given value into an int. * Returns the given default value if the * value does not represent an int. * * @param value the value to be converted * @param dflt the default value * @return the value as an int, or the default value */ public static int asInt(String value, int dflt) { try { return asInt(value); } catch (DataFormatException e) { return dflt; } }
/** * Converts the given value into an int. * Returns the given default value if the * value does not represent an int. * * @param value the value to be converted * @param dflt the default value * @return the value as an int, or the default value */ public static int asInt(String value, int dflt) { try { return asInt(value); } catch (DataFormatException e) { return dflt; } }
/** * Creates an annotation type mapping from the given configuration element. * * @param element the configuration element * @param typeAttributeName the name of the attribute specifying the * annotation type * @return the annotation type mapping or <code>null</code> */ private AnnotationTypeMapping createMapping(IConfigurationElement element, String typeAttributeName) { AnnotationTypeMapping mapping= new AnnotationTypeMapping(); String s= element.getAttribute(typeAttributeName); if (s == null || s.trim().length() == 0) return null; mapping.fAnnotationType= s; s= element.getAttribute("markerType"); //$NON-NLS-1$ if (s == null || s.trim().length() == 0) return null; mapping.fMarkerType= s; s= element.getAttribute("markerSeverity"); //$NON-NLS-1$ if (s != null && s.trim().length() > 0) mapping.fMarkerSeverity= StringConverter.asInt(s, AnnotationTypeMapping.UNDEFINED); return mapping; } }
private void readExtensionScorePairs() { fExtensionScorePairs= new ArrayList<>(3); String content= fElement.getAttribute(EXTENSIONS_ATTRIBUTE); if (content == null) return; StringTokenizer tokenizer= new StringTokenizer(content, ","); //$NON-NLS-1$ while (tokenizer.hasMoreElements()) { String token= tokenizer.nextToken().trim(); int pos= token.indexOf(':'); if (pos != -1) { String extension= token.substring(0, pos); int score= StringConverter.asInt(token.substring(pos+1).trim(), ISearchPageScoreComputer.UNKNOWN); if (extension.equals("*")) { //$NON-NLS-1$ fWildcardScore= score; } else { fExtensionScorePairs.add(new ExtensionScorePair(extension, score)); } } } }
private void readExtensionScorePairs() { fExtensionScorePairs= new ArrayList(3); String content= fElement.getAttribute(EXTENSIONS_ATTRIBUTE); if (content == null) return; StringTokenizer tokenizer= new StringTokenizer(content, ","); //$NON-NLS-1$ while (tokenizer.hasMoreElements()) { String token= tokenizer.nextToken().trim(); int pos= token.indexOf(':'); if (pos != -1) { String extension= token.substring(0, pos); int score= StringConverter.asInt(token.substring(pos+1), ISearchPageScoreComputer.UNKNOWN); if (extension.equals("*")) { //$NON-NLS-1$ fWildcardScore= score; } else { fExtensionScorePairs.add(new ExtensionScorePair(extension, score)); } } } }
/** * Creates an annotation type mapping from the given configuration element. * * @param element the configuration element * @param typeAttributeName the name of the attribute specifying the * annotation type * @return the annotation type mapping or <code>null</code> */ private AnnotationTypeMapping createMapping(IConfigurationElement element, String typeAttributeName) { AnnotationTypeMapping mapping= new AnnotationTypeMapping(); String s= element.getAttribute(typeAttributeName); if (s == null || s.trim().length() == 0) return null; mapping.fAnnotationType= s; s= element.getAttribute("markerType"); //$NON-NLS-1$ if (s == null || s.trim().length() == 0) return null; mapping.fMarkerType= s; s= element.getAttribute("markerSeverity"); //$NON-NLS-1$ if (s != null && s.trim().length() > 0) mapping.fMarkerSeverity= StringConverter.asInt(s, AnnotationTypeMapping.UNDEFINED); return mapping; } }
"No correct font data format \"" + value + "\""); //$NON-NLS-2$//$NON-NLS-1$ height = StringConverter.asInt(value.substring(heightIndex + 1, length)); int faceIndex = value.lastIndexOf(SEPARATOR, heightIndex - 1);
"No correct font data format \"" + value + "\""); //$NON-NLS-2$//$NON-NLS-1$ height = StringConverter.asInt(value.substring(heightIndex + 1, length)); int faceIndex = value.lastIndexOf(SEPARATOR, heightIndex - 1);
"No correct font data format \"" + value + "\""); //$NON-NLS-2$//$NON-NLS-1$ height = StringConverter.asInt(value.substring(heightIndex + 1, length)); int faceIndex = value.lastIndexOf(SEPARATOR, heightIndex - 1);