|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.lib.AnyObjectId
public abstract class AnyObjectId
A (possibly mutable) SHA-1 abstraction.
If this is an instance of MutableObjectId the concept of equality
with this instance can alter at any time, if this instance is modified to
represent a different object name.
| Constructor Summary | |
|---|---|
AnyObjectId()
|
|
| Method Summary | |
|---|---|
AbbreviatedObjectId |
abbreviate(Repository repo)
Return unique abbreviation (prefix) of this object SHA-1. |
AbbreviatedObjectId |
abbreviate(Repository repo,
int len)
Return unique abbreviation (prefix) of this object SHA-1. |
int |
compareTo(java.lang.Object other)
|
int |
compareTo(ObjectId other)
Compare this ObjectId to another and obtain a sort ordering. |
ObjectId |
copy()
Obtain an immutable copy of this current object name value. |
void |
copyRawTo(byte[] b,
int o)
Copy this ObjectId to a byte array. |
void |
copyRawTo(java.nio.ByteBuffer w)
Copy this ObjectId to an output writer in raw binary. |
void |
copyRawTo(int[] b,
int o)
Copy this ObjectId to an int array. |
void |
copyRawTo(java.io.OutputStream w)
Copy this ObjectId to an output writer in raw binary. |
void |
copyTo(char[] tmp,
java.lang.StringBuilder w)
Copy this ObjectId to a StringBuilder in hex format. |
void |
copyTo(char[] tmp,
java.io.Writer w)
Copy this ObjectId to an output writer in hex format. |
void |
copyTo(java.io.OutputStream w)
Copy this ObjectId to an output writer in hex format. |
void |
copyTo(java.io.Writer w)
Copy this ObjectId to an output writer in hex format. |
boolean |
equals(AnyObjectId other)
Determine if this ObjectId has exactly the same value as another. |
static boolean |
equals(AnyObjectId firstObjectId,
AnyObjectId secondObjectId)
Compare to object identifier byte sequences for equality. |
boolean |
equals(java.lang.Object o)
|
int |
getFirstByte()
For ObjectIdMap |
java.lang.String |
getName()
|
int |
hashCode()
|
java.lang.String |
name()
|
boolean |
startsWith(AbbreviatedObjectId abbr)
Tests if this ObjectId starts with the given abbreviation. |
abstract ObjectId |
toObjectId()
Obtain an immutable copy of this current object name value. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AnyObjectId()
| Method Detail |
|---|
public static boolean equals(AnyObjectId firstObjectId,
AnyObjectId secondObjectId)
firstObjectId - the first identifier to compare. Must not be null.secondObjectId - the second identifier to compare. Must not be null.
public final int getFirstByte()
public int compareTo(ObjectId other)
other - the other id to compare to. Must not be null.
public int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparablepublic boolean startsWith(AbbreviatedObjectId abbr)
abbr - the abbreviation.
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(AnyObjectId other)
other - the other id to compare to. May be null.
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic void copyRawTo(java.nio.ByteBuffer w)
w - the buffer to copy to. Must be in big endian order.
public void copyRawTo(byte[] b,
int o)
b - the buffer to copy to.o - the offset within b to write at.
public void copyRawTo(int[] b,
int o)
b - the buffer to copy to.o - the offset within b to write at.
public void copyRawTo(java.io.OutputStream w)
throws java.io.IOException
w - the stream to write to.
java.io.IOException - the stream writing failed.
public void copyTo(java.io.OutputStream w)
throws java.io.IOException
w - the stream to copy to.
java.io.IOException - the stream writing failed.
public void copyTo(java.io.Writer w)
throws java.io.IOException
w - the stream to copy to.
java.io.IOException - the stream writing failed.
public void copyTo(char[] tmp,
java.io.Writer w)
throws java.io.IOException
tmp - temporary char array to buffer construct into before writing.
Must be at least large enough to hold 2 digits for each byte
of object id (40 characters or larger).w - the stream to copy to.
java.io.IOException - the stream writing failed.
public void copyTo(char[] tmp,
java.lang.StringBuilder w)
tmp - temporary char array to buffer construct into before writing.
Must be at least large enough to hold 2 digits for each byte
of object id (40 characters or larger).w - the string to append onto.public java.lang.String toString()
toString in class java.lang.Objectpublic final java.lang.String name()
public final java.lang.String getName()
public AbbreviatedObjectId abbreviate(Repository repo)
This method is a utility for abbreviate(repo, 8).
repo - repository for checking uniqueness within.
public AbbreviatedObjectId abbreviate(Repository repo,
int len)
Current implementation is not guaranteeing uniqueness, it just returns fixed-length prefix of SHA-1 string.
repo - repository for checking uniqueness within.len - minimum length of the abbreviated string.
public final ObjectId copy()
Only returns this if this instance is an unsubclassed
instance of ObjectId; otherwise a new instance is returned
holding the same value.
This method is useful to shed any additional memory that may be tied to the subclass, yet retain the unique identity of the object id for future lookups within maps and repositories.
public abstract ObjectId toObjectId()
See copy() if this is a possibly subclassed (but
immutable) identity and the application needs a lightweight identity
only reference.
this if this is already
an immutable instance.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||