public class ObjectToPack extends PackedObjectInfo
PackWriter
.
PackWriter
uses this class to track the things it needs to include in
the newly generated pack file, and how to efficiently obtain the raw data for
each object as they are written to the output stream.
Constructor and Description |
---|
ObjectToPack(AnyObjectId src,
int type)
Construct for the specified object id.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearExtendedFlag(int flag)
Clear an extended flag bit.
|
protected void |
clearReuseAsIs()
Forget the reuse information previously stored.
|
ObjectToPack |
getDeltaBase() |
ObjectId |
getDeltaBaseId() |
protected int |
getExtendedFlags() |
int |
getType() |
boolean |
isDeltaRepresentation() |
protected boolean |
isExtendedFlag(int flag)
Determine if a particular extended flag bit has been set.
|
boolean |
isReuseAsIs() |
boolean |
isWritten()
Check if object is already written in a pack.
|
void |
select(StoredObjectRepresentation ref)
Remember a specific representation for reuse at a later time.
|
protected void |
setExtendedFlag(int flag)
Set an extended flag bit.
|
protected void |
setExtendedFlags(int extFlags)
Set the extended flags used by the subclass.
|
String |
toString() |
getCRC, getOffset, setCRC, setOffset
equals, fromRaw, fromRaw, fromRaw, fromRaw, fromString, fromString, isId, toObjectId, toString, zeroId
public ObjectToPack(AnyObjectId src, int type)
src
- object id of object for packingtype
- real type code of the object, not its in-pack type.public final ObjectId getDeltaBaseId()
public final ObjectToPack getDeltaBase()
public final boolean isDeltaRepresentation()
public final boolean isWritten()
public final int getType()
public final boolean isReuseAsIs()
protected void clearReuseAsIs()
Implementations may subclass this method, but they must also invoke the
super version with super.clearReuseAsIs()
to ensure the flag is
properly cleared for the writer.
protected final int getExtendedFlags()
protected final boolean isExtendedFlag(int flag)
getExtendedFlags()
and testing the result.flag
- the flag mask to test, must be between 0x0 and 0xf.protected final void setExtendedFlag(int flag)
flag
- the bits to set, must be between 0x0 and 0xf.protected final void clearExtendedFlag(int flag)
flag
- the bits to clear, must be between 0x0 and 0xf.protected final void setExtendedFlags(int extFlags)
extFlags
- additional flag bits to store in the flags field. Due to space
constraints only values [0x0, 0xf] are permitted.public void select(StoredObjectRepresentation ref)
Implementers should remember the representation chosen, so it can be
reused at a later time. PackWriter
may invoke this method
multiple times for the same object, each time saving the current best
representation found.
ref
- the object representation.public String toString()
toString
in class AnyObjectId
Copyright © 2017 Eclipse JGit Project. All rights reserved.