Methods Summary |
---|
public boolean | checkAndSet(java.lang.String value, FolderConfiguration config)
CountryCodeQualifier qualifier = getQualifier(value);
if (qualifier != null) {
config.setCountryCodeQualifier(qualifier);
return true;
}
return false;
|
public boolean | equals(java.lang.Object qualifier)
if (qualifier instanceof CountryCodeQualifier) {
return mCode == ((CountryCodeQualifier)qualifier).mCode;
}
return false;
|
public int | getCode()
return mCode;
|
public static java.lang.String | getFolderSegment(int code)Returns the folder name segment for the given value. This is equivalent to calling
{@link #toString()} on a {@link CountryCodeQualifier} object.
if (code != DEFAULT_CODE && code >= 100 && code <=999) { // code is 3 digit.) {
return String.format("mcc%1$d", code); //$NON-NLS-1$
}
return ""; //$NON-NLS-1$
|
public org.eclipse.swt.graphics.Image | getIcon()
return IconFactory.getInstance().getIcon("mcc"); //$NON-NLS-1$
|
public java.lang.String | getName()
return NAME;
|
public static com.android.ide.eclipse.editors.resources.configurations.CountryCodeQualifier | getQualifier(java.lang.String segment)Creates and returns a qualifier from the given folder segment. If the segment is incorrect,
null is returned.
Matcher m = sCountryCodePattern.matcher(segment);
if (m.matches()) {
String v = m.group(1);
int code = -1;
try {
code = Integer.parseInt(v);
} catch (NumberFormatException e) {
// looks like the string we extracted wasn't a valid number.
return null;
}
CountryCodeQualifier qualifier = new CountryCodeQualifier();
qualifier.mCode = code;
return qualifier;
}
return null;
|
public java.lang.String | getShortName()
return "Country Code";
|
public java.lang.String | getStringValue()
if (mCode != DEFAULT_CODE) {
return String.format("MCC %1$d", mCode);
}
return ""; //$NON-NLS-1$
|
public int | hashCode()
return mCode;
|
public boolean | isValid()
return mCode != DEFAULT_CODE;
|
public java.lang.String | toString()Returns the string used to represent this qualifier in the folder name.
return getFolderSegment(mCode);
|