Android Open Source - android-expandablelistview Field






From Project

Back to project page android-expandablelistview.

License

The source code is released under:

GNU General Public License

If you think the Android project android-expandablelistview listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.app;
/*from   w  ww . j a va 2 s  .  c o  m*/
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class Field {
    final private String id;
    final private String value;
    List<Field> children = new LinkedList<Field>();

    public static Field create(String id, String value) {
        return new Field(id, value);
    }

    public static Field group(String id) {
        return new Field(id);
    }

    public Field(String id) {
        this(id, null);
    }

    public Field(String id, String value) {
        this.id = id;
        this.value = value;
    }

    public Field addChild(Field field) {
        if (field != null)
            children.add(field);
        return this;
    }

    public Collection<Field> childFields() {
        return Collections.unmodifiableList(children);
    }

    public int childrenCount() {
        return children.size();
    }

    Field getChild(int index) {
        return children.get(index);
    }

    public String getId() {
        return id;
    }

    public String getValue() {
        return value;
    }
}




Java Source Code List

com.example.app.FieldBaseExpandableListAdapter.java
com.example.app.Field.java
com.example.app.MainActivity.java