If this is an instance of org. the
concept of equality with this instance can alter at any time, if this
instance is modified to represent a different object name.
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| private static final char[] | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AbbreviatedObjectId | Returns: SHA-1 abbreviation.length of the abbreviated string. len)Return an abbreviation (prefix) of this object SHA-1. |
| public final int | compareTo(AnyObjectId
the object to be compared. other)Implements java. Compares this object with the specified object for order. |
| public final int | Returns: a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.array containing the other ObjectId in network byte order. bs, int position within p)bs to start the compare at. At least
20 bytes, starting at this position are required.Compare this ObjectId to a network-byte-order ObjectId. |
| public final int | Returns: a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.array containing the other ObjectId in network byte order. bs, int position within p)bs to start the compare at. At least 5
integers, starting at this position are required.Compare this ObjectId to a network-byte-order ObjectId. |
| public final ObjectId | Returns: an immutable copy, using the smallest memory footprint possible.Obtain an immutable copy of this current object name value. |
| public void | copyRawTo(ByteBuffer
the buffer to copy to. Must be in big endian order. w)Copy this ObjectId to an output writer in raw binary. |
| public void | copyRawTo(byte[]
the buffer to copy to. b, int the offset within b to write at. o)Copy this ObjectId to a byte array. |
| public void | copyRawTo(int[]
the buffer to copy to. b, int the offset within b to write at. o)Copy this ObjectId to an int array. |
| public void | copyRawTo(OutputStream
the stream to write to. w)Copy this ObjectId to an output writer in raw binary. |
| public void | |
| public void | copyTo(byte[]
the buffer to copy to. b, int the offset within b to write at. o)Copy this ObjectId to a byte array in hex format. |
| public void | |
| public void | |
| public void | |
| public void | copyTo(char[]
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). tmp, StringBuilder the string to append onto. w)Copy this ObjectId to a StringBuilder in hex format. |
| public final boolean | Returns: true only if both ObjectIds have identical bits.the other id to compare to. May be null. other)Determine if this ObjectId has exactly the same value as another. |
| public final boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| private static void | |
| pack-priv static void | |
| public final int | Returns: the value of the requested byte atindex. Returned values
are unsigned and thus are in the range [0,255] rather than the
signed byte range of [-128, 127].index of the byte to obtain from the raw form of the ObjectId.
Must be in range [0,
index)org.).Get any byte from the ObjectId. |
| public final int | Returns: a discriminator usable for a fan-out style map. Returned values are unsigned and thus are in the range [0,255] rather than the signed byte range of [-128, 127].Get the first 8 bits of the ObjectId. |
| public final String | Returns: string form of the SHA-1, in lower case hexadecimal.Get string form of the SHA-1, in lower case hexadecimal. |
| public final int | |
| public static boolean | Returns: true if the two identifiers are the same.the first identifier to compare. Must not be null. firstObjectId, final AnyObjectId the second identifier to compare. Must not be null. secondObjectId)Compare two object identifier byte sequences for equality. |
| public final String | |
| public boolean | Returns: true if this ObjectId begins with the abbreviation; else false.the abbreviation. abbr)Tests if this ObjectId starts with the given abbreviation. |
| private byte[] | |
| private char[] | |
| private void | |
| public abstract ObjectId | Returns: an immutable copy. May bethis if this is already
an immutable instance.Obtain an immutable copy of this current object name value. |
| public String | |
| private static void |
| hexbyte | back to summary |
|---|---|
| private static final byte[] hexbyte | |
| hexchar | back to summary |
|---|---|
| private static final char[] hexchar | |
| w1 | back to summary |
|---|---|
| pack-priv int w1 | |
| w2 | back to summary |
|---|---|
| pack-priv int w2 | |
| w3 | back to summary |
|---|---|
| pack-priv int w3 | |
| w4 | back to summary |
|---|---|
| pack-priv int w4 | |
| w5 | back to summary |
|---|---|
| pack-priv int w5 | |
| AnyObjectId | back to summary |
|---|---|
| public AnyObjectId() | |
| abbreviate | back to summary |
|---|---|
| public AbbreviatedObjectId abbreviate(int len) Return an abbreviation (prefix) of this object SHA-1.
This implementation does not guarantee uniqueness. Callers should instead
use
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(AnyObjectId other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that Compare this ObjectId to another and obtain a sort ordering.
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(byte[] bs, int p) Compare this ObjectId to a network-byte-order ObjectId.
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(int[] bs, int p) Compare this ObjectId to a network-byte-order ObjectId.
| |
| copy | back to summary |
|---|---|
| public final ObjectId copy() Obtain an immutable copy of this current object name value.
Only returns 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.
| |
| copyRawTo | back to summary |
|---|---|
| public void copyRawTo(ByteBuffer w) Copy this ObjectId to an output writer in raw binary.
| |
| copyRawTo | back to summary |
|---|---|
| public void copyRawTo(byte[] b, int o) Copy this ObjectId to a byte array.
| |
| copyRawTo | back to summary |
|---|---|
| public void copyRawTo(int[] b, int o) Copy this ObjectId to an int array.
| |
| copyRawTo | back to summary |
|---|---|
| public void copyRawTo(OutputStream w) throws IOException Copy this ObjectId to an output writer in raw binary.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(OutputStream w) throws IOException Copy this ObjectId to an output writer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(byte[] b, int o) Copy this ObjectId to a byte array in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(ByteBuffer b) Copy this ObjectId to a ByteBuffer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(Writer w) throws IOException Copy this ObjectId to an output writer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(char[] tmp, Writer w) throws IOException Copy this ObjectId to an output writer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(char[] tmp, StringBuilder w) Copy this ObjectId to a StringBuilder in hex format.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(AnyObjectId other) Determine if this ObjectId has exactly the same value as another.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| formatHexByte | back to summary |
|---|---|
| private static void formatHexByte(byte[] dst, int p, int w) | |
| formatHexChar | back to summary |
|---|---|
| pack-priv static void formatHexChar(char[] dst, int p, int w) | |
| getByte | back to summary |
|---|---|
| public final int getByte(int index) Get any byte from the ObjectId.
Callers hard-coding
| |
| getFirstByte | back to summary |
|---|---|
| public final int getFirstByte() Get the first 8 bits of the ObjectId.
This is a faster version of
| |
| getName | back to summary |
|---|---|
| public final String getName() Get string form of the SHA-1, in lower case hexadecimal.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEqual | back to summary |
|---|---|
| public static boolean isEqual(final AnyObjectId firstObjectId, final AnyObjectId secondObjectId) Compare two object identifier byte sequences for equality.
| |
| name | back to summary |
|---|---|
| public final String name() name.
| |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(AbbreviatedObjectId abbr) Tests if this ObjectId starts with the given abbreviation.
| |
| toHexByteArray | back to summary |
|---|---|
| private byte[] toHexByteArray() | |
| toHexCharArray | back to summary |
|---|---|
| private char[] toHexCharArray() | |
| toHexCharArray | back to summary |
|---|---|
| private void toHexCharArray(char[] dst) | |
| toObjectId | back to summary |
|---|---|
| public abstract ObjectId toObjectId() Obtain an immutable copy of this current object name value.
See
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| writeRawInt | back to summary |
|---|---|
| private static void writeRawInt(OutputStream w, int v) throws IOException | |