Methods Summary |
---|
public boolean | checkAndSet(java.lang.String value, FolderConfiguration config)
Matcher m = sNetworkCodePattern.matcher(value);
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 false;
}
NetworkCodeQualifier qualifier = new NetworkCodeQualifier();
qualifier.mCode = code;
config.setNetworkCodeQualifier(qualifier);
return true;
}
return false;
|
public boolean | equals(java.lang.Object qualifier)
if (qualifier instanceof NetworkCodeQualifier) {
return mCode == ((NetworkCodeQualifier)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 NetworkCodeQualifier} object.
if (code != DEFAULT_CODE && code >= 1 && code <= 999) { // code is 1-3 digit.
return String.format("mnc%1$d", code); //$NON-NLS-1$
}
return ""; //$NON-NLS-1$
|
public org.eclipse.swt.graphics.Image | getIcon()
return IconFactory.getInstance().getIcon("mnc"); //$NON-NLS-1$
|
public java.lang.String | getName()
return NAME;
|
public static com.android.ide.eclipse.editors.resources.configurations.NetworkCodeQualifier | 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 = sNetworkCodePattern.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;
}
NetworkCodeQualifier qualifier = new NetworkCodeQualifier();
qualifier.mCode = code;
return qualifier;
}
return null;
|
public java.lang.String | getShortName()
return "Network Code";
|
public java.lang.String | getStringValue()
if (mCode != DEFAULT_CODE) {
return String.format("MNC %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);
|