X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=src%2Fde%2Fj32%2Fpimstuff%2Fdata%2FEntry.java;h=9f96731e64951ce37f93eaa2d2630a13ccd15542;hb=e4126a1787b7045a53f6074e9ef15681c9f5fde4;hp=909cd3be2f9111eb62b608363c2fa8b2fe13784e;hpb=276d9a69fa796728169c2992921a1e4bd875f549;p=jpim.git diff --git a/src/de/j32/pimstuff/data/Entry.java b/src/de/j32/pimstuff/data/Entry.java index 909cd3b..9f96731 100644 --- a/src/de/j32/pimstuff/data/Entry.java +++ b/src/de/j32/pimstuff/data/Entry.java @@ -8,68 +8,71 @@ import de.j32.util.FilteredIterator; public class Entry { - long id_ = 0; - String name_ = ""; - ArrayList attributes_ = new ArrayList(); + long id_ = 0; + String name_ = ""; + ArrayList attributes_ = new ArrayList(); - public void name(String name) - { - name_ = name; - } - - public String name() - { - return name_; - } - - public void id(long id) - { - id_ = id; - } - - public long id() - { - return id_; - } - - public void attribute(String type, String rel, String value) - { - attributes_.add(new Attribute(type, rel, value,attributes_.size())); - } + public void name(String name) + { + name_ = name; + } - public Iterable attributes() - { - return attributes_; - } - - public Iterable attributes(final String type) - { - return new Iterable() { - public Iterator iterator() { - return new FilteredIterator( - attributes_.iterator(), - new Filter() { - public boolean match(Attribute element) { - return element.type == type; - } - }); - } - }; - } - - public Iterable attributes(final String type, final String rel) - { - return new Iterable() { - public Iterator iterator() { - return new FilteredIterator( - attributes_.iterator(), - new Filter() { - public boolean match(Attribute element) { - return element.type == type && element.rel == rel; - } - }); - } - }; - } + public String name() + { + return name_; + } + + public void id(long id) + { + id_ = id; + } + + public long id() + { + return id_; + } + + public void attribute(String type, String rel, String value) + { + attributes_.add(new Attribute(type, rel, value, attributes_.size())); + } + + public Iterable attributes() + { + return attributes_; + } + + public Iterable attributes(final String type) + { + return new Iterable() { + public Iterator iterator() + { + return new FilteredIterator(attributes_.iterator(), + new Filter() { + public boolean match(Attribute element) + { + return element.type == type; + } + }); + } + }; + } + + public Iterable attributes(final String type, final String rel) + { + return new Iterable() { + public Iterator iterator() + { + return new FilteredIterator(attributes_.iterator(), + new Filter() { + public boolean match(Attribute element) + { + return element.type == type + && element.rel == rel; + } + }); + } + }; + } }