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.
Ported to SHA-256 from org.
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| private static final char[] | |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | |
| pack-priv long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AbbreviatedLongObjectId | Returns: SHA-256 abbreviation.length of the abbreviated string. len)Return an abbreviation (prefix) of this object SHA-256. |
| public final int | compareTo(AnyLongObjectId
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 LongObjectId in network byte order. bs, int position within p)bs to start the compare at. At least
32 bytes, starting at this position are required.Compare this LongObjectId to a network-byte-order LongObjectId. |
| 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 LongObjectId in network byte order. bs, int position within p)bs to start the compare at. At least 4
longs, starting at this position are required.Compare this LongObjectId to a network-byte-order LongObjectId. |
| public final LongObjectId | Returns: an immutable copy, using the smallest memory footprint possible.Obtain an immutable copy of this current object. |
| public void | copyRawTo(ByteBuffer
the buffer to copy to. Must be in big endian order. w)Copy this LongObjectId 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 LongObjectId to a byte array. |
| public void | copyRawTo(long[]
the buffer to copy to. b, int the offset within b to write at. o)Copy this LongObjectId to an long array. |
| public void | copyRawTo(OutputStream
the stream to write to. w)Copy this LongObjectId to an output writer in raw binary. |
| public void | copyTo(OutputStream
the stream to copy to. w)Copy this LongObjectId to an output writer in hex format. |
| public void | copyTo(byte[]
the buffer to copy to. b, int the offset within b to write at. o)Copy this LongObjectId 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 (64 characters or larger). tmp, StringBuilder the string to append onto. w)Copy this LongObjectId to a StringBuilder in hex format. |
| public final boolean | Returns: true only if both LongObjectIds have identical bits.the other id to compare to. May be null. other)Determine if this LongObjectId 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
LongObjectId. Must be in range [0,
index)org.).Get any byte from the LongObjectId. |
| 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 LongObjectId. |
| public final String | Returns: string form of the SHA-256, in lower case hexadecimal.Get string form of the SHA-256 |
| 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 second 8 bits of the LongObjectId. |
| 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 AnyLongObjectId 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 LongObjectId begins with the abbreviation; else false.the abbreviation. abbr)Tests if this LongObjectId starts with the given abbreviation. |
| private byte[] | |
| pack-priv char[] | |
| private void | |
| public abstract LongObjectId | Returns: an immutable copy. May bethis if this is already an
immutable instance.Obtain an immutable copy of this current object. |
| 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 long w1 | |
| w2 | back to summary |
|---|---|
| pack-priv long w2 | |
| w3 | back to summary |
|---|---|
| pack-priv long w3 | |
| w4 | back to summary |
|---|---|
| pack-priv long w4 | |
| AnyLongObjectId | back to summary |
|---|---|
| public AnyLongObjectId() | |
| abbreviate | back to summary |
|---|---|
| public AbbreviatedLongObjectId abbreviate(int len) Return an abbreviation (prefix) of this object SHA-256.
This implementation does not guarantee uniqueness. Callers should instead
use
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(AnyLongObjectId 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
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(byte[] bs, int p) Compare this LongObjectId to a network-byte-order LongObjectId.
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(long[] bs, int p) Compare this LongObjectId to a network-byte-order LongObjectId.
| |
| copy | back to summary |
|---|---|
| public final LongObjectId copy() Obtain an immutable copy of this current object.
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 LongObjectId to an output writer in raw binary.
| |
| copyRawTo | back to summary |
|---|---|
| public void copyRawTo(byte[] b, int o) Copy this LongObjectId to a byte array.
| |
| copyRawTo | back to summary |
|---|---|
| public void copyRawTo(long[] b, int o) Copy this LongObjectId to an long array.
| |
| copyRawTo | back to summary |
|---|---|
| public void copyRawTo(OutputStream w) throws IOException Copy this LongObjectId to an output writer in raw binary.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(OutputStream w) throws IOException Copy this LongObjectId to an output writer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(byte[] b, int o) Copy this LongObjectId to a byte array in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(ByteBuffer b) Copy this LongObjectId to a ByteBuffer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(Writer w) throws IOException Copy this LongObjectId to an output writer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(char[] tmp, Writer w) throws IOException Copy this LongObjectId to an output writer in hex format.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(char[] tmp, StringBuilder w) Copy this LongObjectId to a StringBuilder in hex format.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(AnyLongObjectId other) Determine if this LongObjectId 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, long w) | |
| formatHexChar | back to summary |
|---|---|
| pack-priv static void formatHexChar(char[] dst, int p, long w) | |
| getByte | back to summary |
|---|---|
| public final int getByte(int index) Get any byte from the LongObjectId.
Callers hard-coding
| |
| getFirstByte | back to summary |
|---|---|
| public final int getFirstByte() Get the first 8 bits of the LongObjectId.
This is a faster version of
| |
| getName | back to summary |
|---|---|
| public final String getName() Get string form of the SHA-256
| |
| getSecondByte | back to summary |
|---|---|
| public final int getSecondByte() Get the second 8 bits of the LongObjectId.
| |
| 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 AnyLongObjectId firstObjectId, final AnyLongObjectId secondObjectId) Compare two object identifier byte sequences for equality.
| |
| name | back to summary |
|---|---|
| public final String name() Get string form of the SHA-256
| |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(AbbreviatedLongObjectId abbr) Tests if this LongObjectId starts with the given abbreviation.
| |
| toHexByteArray | back to summary |
|---|---|
| private byte[] toHexByteArray() | |
| toHexCharArray | back to summary |
|---|---|
| pack-priv char[] toHexCharArray() | |
| toHexCharArray | back to summary |
|---|---|
| private void toHexCharArray(char[] dst) | |
| toObjectId | back to summary |
|---|---|
| public abstract LongObjectId toObjectId() Obtain an immutable copy of this current object.
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-
| |
| writeRawLong | back to summary |
|---|---|
| private static void writeRawLong(OutputStream w, long v) throws IOException | |