| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | FileMemData.
Points to a block of bytes that needs to be compressed. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| private static final byte[] | |
| private static final int | |
| private final boolean | |
| private static final FileMemData. | |
| private static final byte[] | |
| private AtomicReference | |
| private final int | |
| private boolean | |
| private boolean | |
| private long | |
| private volatile long | |
| private static final CompressLZF | |
| private String | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| private void | |
| pack-priv void | |
| private void | |
| private byte[] | |
| pack-priv int | |
| pack-priv long | |
| pack-priv String | |
| private byte[] | |
| pack-priv long | |
| pack-priv synchronized boolean | |
| pack-priv synchronized boolean | |
| pack-priv long | Returns: the new positionthe position pos, byte[] the byte array b, int the offset within the byte array off, int the number of bytes len, boolean true for writing write)Read or write. |
| pack-priv void | |
| private void | setPage(int
the page id page, byte[] the old data oldData, byte[] the new data newData, boolean whether the data should be overwritten even if the old data
doesn't match force)Set the page data. |
| pack-priv boolean | |
| pack-priv void | |
| pack-priv void | |
| pack-priv synchronized void |
| BLOCK_SIZE | back to summary |
|---|---|
| private static final int BLOCK_SIZE | |
| BLOCK_SIZE_MASK | back to summary |
|---|---|
| private static final int BLOCK_SIZE_MASK | |
| BLOCK_SIZE_SHIFT | back to summary |
|---|---|
| private static final int BLOCK_SIZE_SHIFT | |
| BUFFER | back to summary |
|---|---|
| private static final byte[] BUFFER | |
| CACHE_SIZE | back to summary |
|---|---|
| private static final int CACHE_SIZE | |
| compress | back to summary |
|---|---|
| private final boolean compress | |
| COMPRESS_LATER | back to summary |
|---|---|
| private static final FileMemData. | |
| COMPRESSED_EMPTY_BLOCK | back to summary |
|---|---|
| private static final byte[] COMPRESSED_EMPTY_BLOCK | |
| data | back to summary |
|---|---|
| private AtomicReference<byte[]>[] data | |
| id | back to summary |
|---|---|
| private final int id | |
| isLockedExclusive | back to summary |
|---|---|
| private boolean isLockedExclusive | |
| isReadOnly | back to summary |
|---|---|
| private boolean isReadOnly | |
| lastModified | back to summary |
|---|---|
| private long lastModified | |
| length | back to summary |
|---|---|
| private volatile long length | |
| LZF | back to summary |
|---|---|
| private static final CompressLZF LZF | |
| name | back to summary |
|---|---|
| private String name | |
| sharedLockCount | back to summary |
|---|---|
| private int sharedLockCount | |
| FileMemData | back to summary |
|---|---|
pack-priv FileMemData(String name, boolean compress)
| |
| canWrite | back to summary |
|---|---|
| pack-priv boolean canWrite() Check whether writing is allowed.
| |
| changeLength | back to summary |
|---|---|
| private void changeLength(long len) | |
| compress | back to summary |
|---|---|
| pack-priv void compress(int page) Compress the data in a byte array.
| |
| compressLater | back to summary |
|---|---|
| private void compressLater(int page) | |
| expand | back to summary |
|---|---|
| private byte[] expand(int page) | |
| getId | back to summary |
|---|---|
| pack-priv int getId() | |
| getLastModified | back to summary |
|---|---|
| pack-priv long getLastModified() Get the last modified time.
| |
| getName | back to summary |
|---|---|
| pack-priv String getName() Get the file name
| |
| getPage | back to summary |
|---|---|
| private byte[] getPage(int page) Get the page if it exists.
| |
| length | back to summary |
|---|---|
| pack-priv long length() Get the file length.
| |
| lockExclusive | back to summary |
|---|---|
| pack-priv synchronized boolean lockExclusive() Lock the file in exclusive mode if possible.
| |
| lockShared | back to summary |
|---|---|
| pack-priv synchronized boolean lockShared() Lock the file in shared mode if possible.
| |
| readWrite | back to summary |
|---|---|
| pack-priv long readWrite(long pos, byte[] b, int off, int len, boolean write) Read or write.
| |
| setName | back to summary |
|---|---|
| pack-priv void setName(String name) Set the file name.
| |
| setPage | back to summary |
|---|---|
| private void setPage(int page, byte[] oldData, byte[] newData, boolean force) Set the page data.
| |
| setReadOnly | back to summary |
|---|---|
| pack-priv boolean setReadOnly() Set the read-only flag.
| |
| touch | back to summary |
|---|---|
| pack-priv void touch(boolean openReadOnly) Update the last modified time.
| |
| truncate | back to summary |
|---|---|
| pack-priv void truncate(long newLength) Truncate the file.
| |
| unlock | back to summary |
|---|---|
| pack-priv synchronized void unlock() throws IOException Unlock the file. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private final int | size
Hides java. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized V | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Overrides java. Implements java. Associates the specified value with the specified key in this map (optional operation). |
| protected boolean | removeEldestEntry(Map.
The least recently inserted entry in the map, or if
this is an access-ordered map, the least recently accessed
entry. This is the entry that will be removed if this
method returns eldesttrue. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.Overrides java. Returns |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| size | back to summary |
|---|---|
| private final int size Hides java. | |
| Cache | back to summary |
|---|---|
| pack-priv Cache(int size) | |
| put | back to summary |
|---|---|
| public synchronized V put(K key, V value) Overrides java. Implements java. Doc from java. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| removeEldestEntry | back to summary |
|---|---|
| protected boolean removeEldestEntry(Map. Overrides java. Doc from java. Returns Sample use: this override will allow the map to grow up to 100 entries and then delete the eldest entry each time a new entry is added, maintaining a steady state of 100 entries.
private static final int MAX_ENTRIES = 100;
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > MAX_ENTRIES;
}
This method typically does not modify the map in any way,
instead allowing the map to modify itself as directed by its
return value. It is permitted for this method to modify
the map directly, but if it does so, it must return
This implementation merely returns
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv FileMemData | file
The file. |
| pack-priv int | page
The page to compress. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public int |
| file | back to summary |
|---|---|
| pack-priv FileMemData file The file. | |
| page | back to summary |
|---|---|
| pack-priv int page The page to compress. | |
| CompressItem | back to summary |
|---|---|
| pack-priv CompressItem() | |
| equals | back to summary |
|---|---|
| public 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. | |
| hashCode | back to summary |
|---|---|
| public 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
| |