Renamed user-defined tags "user-defined type identifiers".

This commit is contained in:
akwizgran
2011-09-12 16:32:25 +01:00
parent fd2046d984
commit 70b1487140
33 changed files with 155 additions and 159 deletions

View File

@@ -16,7 +16,7 @@ public class AuthorId extends UniqueId {
}
public void writeTo(Writer w) throws IOException {
w.writeUserDefinedTag(Tags.AUTHOR_ID);
w.writeUserDefinedTag(Types.AUTHOR_ID);
w.writeBytes(id);
}

View File

@@ -16,7 +16,7 @@ public class BatchId extends UniqueId {
}
public void writeTo(Writer w) throws IOException {
w.writeUserDefinedTag(Tags.BATCH_ID);
w.writeUserDefinedTag(Types.BATCH_ID);
w.writeBytes(id);
}

View File

@@ -16,7 +16,7 @@ public class GroupId extends UniqueId {
}
public void writeTo(Writer w) throws IOException {
w.writeUserDefinedTag(Tags.GROUP_ID);
w.writeUserDefinedTag(Types.GROUP_ID);
w.writeBytes(id);
}

View File

@@ -17,7 +17,7 @@ public class MessageId extends UniqueId {
}
public void writeTo(Writer w) throws IOException {
w.writeUserDefinedTag(Tags.MESSAGE_ID);
w.writeUserDefinedTag(Types.MESSAGE_ID);
w.writeBytes(id);
}

View File

@@ -1,11 +1,7 @@
package net.sf.briar.api.protocol;
/**
* User-defined tags for encoding and decoding protocol objects. An object
* should have a user-defined tag if it appears in a list or a map, or if
* objects of different types may be encountered in a given protocol state.
*/
public interface Tags {
/** User-defined type identifiers for encoding and decoding protocol objects. */
public interface Types {
static final int ACK = 0;
static final int AUTHOR = 1;

View File

@@ -18,8 +18,8 @@ public interface Reader {
void addConsumer(Consumer c);
void removeConsumer(Consumer c);
void addObjectReader(int tag, ObjectReader<?> o);
void removeObjectReader(int tag);
void addObjectReader(int id, ObjectReader<?> o);
void removeObjectReader(int id);
boolean hasBoolean() throws IOException;
boolean readBoolean() throws IOException;
@@ -69,7 +69,7 @@ public interface Reader {
boolean hasNull() throws IOException;
void readNull() throws IOException;
boolean hasUserDefined(int tag) throws IOException;
<T> T readUserDefined(int tag, Class<T> t) throws IOException;
void readUserDefinedTag(int tag) throws IOException;
boolean hasUserDefined(int id) throws IOException;
<T> T readUserDefined(int id, Class<T> t) throws IOException;
void readUserDefinedId(int id) throws IOException;
}