mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
generic sorted message tree
This commit is contained in:
21
briar-api/src/org/briarproject/api/clients/MessageTree.java
Normal file
21
briar-api/src/org/briarproject/api/clients/MessageTree.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package org.briarproject.api.clients;
|
||||
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
|
||||
public interface MessageTree<T extends MessageTree.MessageNode> {
|
||||
|
||||
void add(Collection<T> nodes);
|
||||
void clear();
|
||||
Collection<T> depthFirstOrder();
|
||||
void setComparator(Comparator<T> comparator);
|
||||
|
||||
interface MessageNode {
|
||||
MessageId getId();
|
||||
MessageId getParentId();
|
||||
long getTimestamp();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package org.briarproject.api.forum;
|
||||
|
||||
import org.briarproject.api.clients.MessageTree;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public class ForumPostHeader {
|
||||
public class ForumPostHeader implements MessageTree.MessageNode {
|
||||
|
||||
private final MessageId id;
|
||||
private final MessageId parentId;
|
||||
|
||||
Reference in New Issue
Block a user