1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 13:07:59 +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:
Gaston Dombiak 2004-03-30 02:33:28 +00:00 committed by gdombiak
parent cf75ce471f
commit 003d73fd7d

View file

@ -227,17 +227,33 @@ public class ReportedData {
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.
*
* @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();
}
}
public static class Field {
private static class Field {
private String variable;
private String value;