org.eclipse.jgit.storage.dht
Class ObjectInfo

java.lang.Object
  extended by org.eclipse.jgit.storage.dht.ObjectInfo

public class ObjectInfo
extends java.lang.Object

Connects an object to the chunk it is stored in.


Field Summary
static java.util.Comparator<ObjectInfo> BY_TIME
          Orders ObjectInfo by their time member, oldest first.
 
Constructor Summary
ObjectInfo(ChunkKey chunkKey, GitStore.ObjectInfo data)
          Wrap an ObjectInfo from the storage system.
ObjectInfo(ChunkKey chunkKey, long time, GitStore.ObjectInfo data)
          Wrap an ObjectInfo from the storage system.
 
Method Summary
 ChunkKey getChunkKey()
           
 GitStore.ObjectInfo getData()
           
 long getSize()
           
 long getTime()
           
 int getType()
           
 boolean isDelta()
           
 boolean isFragmented()
           
static void sort(java.util.List<ObjectInfo> toSort)
          Sort the info list according to time, oldest member first.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BY_TIME

public static final java.util.Comparator<ObjectInfo> BY_TIME
Orders ObjectInfo by their time member, oldest first.

Constructor Detail

ObjectInfo

public ObjectInfo(ChunkKey chunkKey,
                  GitStore.ObjectInfo data)
Wrap an ObjectInfo from the storage system.

Parameters:
chunkKey - the chunk the object points to.
data - the data of the ObjectInfo.

ObjectInfo

public ObjectInfo(ChunkKey chunkKey,
                  long time,
                  GitStore.ObjectInfo data)
Wrap an ObjectInfo from the storage system.

Parameters:
chunkKey - the chunk the object points to.
time - timestamp of the ObjectInfo.
data - the data of the ObjectInfo.
Method Detail

sort

public static void sort(java.util.List<ObjectInfo> toSort)
Sort the info list according to time, oldest member first.

Parameters:
toSort - list to sort.

getChunkKey

public ChunkKey getChunkKey()
Returns:
the chunk this link points to.

getTime

public long getTime()
Returns:
approximate time the object was created, in milliseconds.

getData

public GitStore.ObjectInfo getData()
Returns:
GitStore.ObjectInfo to embed in the database.

getType

public int getType()
Returns:
type of the object, in OBJ_* constants.

getSize

public long getSize()
Returns:
size of the object when fully inflated.

isDelta

public boolean isDelta()
Returns:
true if the object storage uses delta compression.

isFragmented

public boolean isFragmented()
Returns:
true if the object has been fragmented across chunks.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.