Javadocs and unit tests.

This commit is contained in:
akwizgran
2011-07-01 12:07:00 +01:00
parent b29a024c2a
commit 0ed2a7c9e7
23 changed files with 235 additions and 59 deletions

View File

@@ -1,6 +1,6 @@
package net.sf.briar.api.db;
/** Uniquely identifies a contact. */
/** Type-safe wrapper for an integer that uniquely identifies a contact. */
public class ContactId {
private final int id;

View File

@@ -35,7 +35,10 @@ public interface DatabaseComponent {
/** Adds a locally generated message to the database. */
void addLocallyGeneratedMessage(Message m) throws DbException;
/** Generates a bundle of messages for the given contact. */
/**
* Generates a bundle of acknowledgements, subscriptions, and batches of
* messages for the given contact.
*/
void generateBundle(ContactId c, Bundle b) throws DbException;
/** Returns the user's rating for the given author. */
@@ -45,8 +48,9 @@ public interface DatabaseComponent {
Set<GroupId> getSubscriptions() throws DbException;
/**
* Processes a bundle of messages received from the given contact. Some
* or all of the messages in the bundle may be stored.
* Processes a bundle of acknowledgements, subscriptions, and batches of
* messages received from the given contact. Some or all of the messages
* in the bundle may be stored.
*/
void receiveBundle(ContactId c, Bundle b) throws DbException;

View File

@@ -1,13 +1,12 @@
package net.sf.briar.api.i18n;
import java.awt.Font;
import java.io.IOException;
import java.util.Locale;
public interface FontManager {
/** Initializes the FontManager for the given locale. */
void initialize(Locale locale) throws IOException;
void initialize(Locale locale);
/** Returns the appropriate font for the given language. */
Font getFontForLanguage(String language);

View File

@@ -2,7 +2,7 @@ package net.sf.briar.api.protocol;
import java.util.Arrays;
/** Uniquely identifies a pseudonymous author. */
/** Type-safe wrapper for a byte array that uniquely identifies an author. */
public class AuthorId {
public static final int LENGTH = 32;

View File

@@ -2,7 +2,10 @@ package net.sf.briar.api.protocol;
import java.util.Arrays;
/** Uniquely identifies a batch of messages. */
/**
* Type-safe wrapper for a byte array that uniquely identifies a batch of
* messages.
*/
public class BatchId {
public static final int LENGTH = 32;

View File

@@ -2,6 +2,10 @@ package net.sf.briar.api.protocol;
import java.util.Arrays;
/**
* Type-safe wrapper for a byte array that uniquely identifies a bundle of
* acknowledgements, subscriptions, and batches of messages.
*/
public class BundleId {
public static final BundleId NONE = new BundleId(new byte[] {

View File

@@ -2,7 +2,10 @@ package net.sf.briar.api.protocol;
import java.util.Arrays;
/** Uniquely identifies a group to which a user may subscribe. */
/**
* Type-safe wrapper for a byte array that uniquely identifies a group to which
* users may subscribe.
*/
public class GroupId {
public static final int LENGTH = 32;

View File

@@ -2,7 +2,7 @@ package net.sf.briar.api.protocol;
import java.util.Arrays;
/** Uniquely identifies a message. */
/** Type-safe wrapper for a byte array that uniquely identifies a message. */
public class MessageId {
/** Used to indicate that the first message in a thread has no parent. */