mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 22:12:05 +01:00
Adds #getValue(String) to the inner class Row which allows to hide the inner class Field
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2266 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
cf75ce471f
commit
003d73fd7d
1 changed files with 18 additions and 2 deletions
|
@ -227,17 +227,33 @@ public class ReportedData {
|
||||||
this.fields = fields;
|
this.fields = fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the field whose variable matches the requested variable.
|
||||||
|
*
|
||||||
|
* @param variable the variable to match.
|
||||||
|
* @return the value of the field whose variable matches the requested variable.
|
||||||
|
*/
|
||||||
|
public String getValue(String variable) {
|
||||||
|
for(Iterator it=getFields();it.hasNext();) {
|
||||||
|
Field field = (Field) it.next();
|
||||||
|
if (variable.equals(field.getVariable())) {
|
||||||
|
return field.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the fields that define the data that goes with the item.
|
* Returns the fields that define the data that goes with the item.
|
||||||
*
|
*
|
||||||
* @return the fields that define the data that goes with the item.
|
* @return the fields that define the data that goes with the item.
|
||||||
*/
|
*/
|
||||||
public Iterator getFields() {
|
private Iterator getFields() {
|
||||||
return Collections.unmodifiableList(new ArrayList(fields)).iterator();
|
return Collections.unmodifiableList(new ArrayList(fields)).iterator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Field {
|
private static class Field {
|
||||||
private String variable;
|
private String variable;
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue