aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgCache.java
diff options
context:
space:
mode:
authorblafoo <github@blafoo.de>2011-12-07 22:51:40 +0100
committerblafoo <github@blafoo.de>2011-12-10 22:43:11 +0100
commit53becbf2521e4157a1efb8ce6e7818c0591a5a83 (patch)
tree3d706968d757c1415e537e82141303804f93b228 /main/src/cgeo/geocaching/cgCache.java
parent63757148c69cdc6ab961fadbe4d3a25f1c69784d (diff)
downloadcgeo-53becbf2521e4157a1efb8ce6e7818c0591a5a83.zip
cgeo-53becbf2521e4157a1efb8ce6e7818c0591a5a83.tar.gz
cgeo-53becbf2521e4157a1efb8ce6e7818c0591a5a83.tar.bz2
Friend logs
Diffstat (limited to 'main/src/cgeo/geocaching/cgCache.java')
-rw-r--r--main/src/cgeo/geocaching/cgCache.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index ce96d58..5d2493c 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -779,9 +779,31 @@ public class cgCache implements ICache {
}
public List<cgLog> getLogs() {
- return logs;
+ return getLogs(true);
}
+ /**
+ * @param allLogs
+ * true for all logs, false for friend logs only
+ * @return the logs with all entries or just the entries of the friends
+ */
+ public List<cgLog> getLogs(boolean allLogs) {
+ if (allLogs) {
+ return logs;
+ }
+ ArrayList<cgLog> friendLogs = new ArrayList<cgLog>();
+ for (cgLog log : logs) {
+ if (log.friend) {
+ friendLogs.add(log);
+ }
+ }
+ return friendLogs;
+ }
+
+ /**
+ * @param logs
+ * the log entries
+ */
public void setLogs(List<cgLog> logs) {
this.logs = logs;
}