Methods Summary |
---|
public java.lang.String | buildKey()Build key that uniquely identifies this stack. It omits most of the raw
details included in {@link #write(DataOutputStream)}, since they change
too regularly to be used as a key.
final StringBuilder builder = new StringBuilder();
if (root != null) {
builder.append(root.authority).append('#");
builder.append(root.rootId).append('#");
} else {
builder.append("[null]").append('#");
}
for (DocumentInfo doc : this) {
builder.append(doc.documentId).append('#");
}
return builder.toString();
|
public java.lang.String | getTitle()
if (size() == 1 && root != null) {
return root.title;
} else if (size() > 1) {
return peek().displayName;
} else {
return null;
}
|
public boolean | isRecents()
return size() == 0;
|
public void | read(java.io.DataInputStream in)
final int version = in.readInt();
switch (version) {
case VERSION_INIT:
throw new ProtocolException("Ignored upgrade");
case VERSION_ADD_ROOT:
if (in.readBoolean()) {
root = new RootInfo();
root.read(in);
}
final int size = in.readInt();
for (int i = 0; i < size; i++) {
final DocumentInfo doc = new DocumentInfo();
doc.read(in);
add(doc);
}
break;
default:
throw new ProtocolException("Unknown version " + version);
}
|
public void | reset()
clear();
root = null;
|
public void | updateDocuments(android.content.ContentResolver resolver)Update a possibly stale restored stack against a live
{@link DocumentsProvider}.
for (DocumentInfo info : this) {
info.updateSelf(resolver);
}
|
public void | updateRoot(java.util.Collection matchingRoots)
for (RootInfo root : matchingRoots) {
if (root.equals(this.root)) {
this.root = root;
return;
}
}
throw new FileNotFoundException("Failed to find matching root for " + root);
|
public void | write(java.io.DataOutputStream out)
out.writeInt(VERSION_ADD_ROOT);
if (root != null) {
out.writeBoolean(true);
root.write(out);
} else {
out.writeBoolean(false);
}
final int size = size();
out.writeInt(size);
for (int i = 0; i < size; i++) {
final DocumentInfo doc = get(i);
doc.write(out);
}
|