|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.faunos.skwish.Segment com.faunos.skwish.sys.filters.FilterSegment com.faunos.skwish.sys.filters.ReadOnlyFilterSegment
public class ReadOnlyFilterSegment
A read-only view of an underlying segment.
Field Summary |
---|
Fields inherited from class com.faunos.skwish.sys.filters.FilterSegment |
---|
inner |
Fields inherited from class com.faunos.skwish.Segment |
---|
validator |
Constructor Summary | |
---|---|
ReadOnlyFilterSegment(Segment inner)
Creates and returns a read-only view of the given inner instance. |
Method Summary | |
---|---|
void |
delete(long id)
Deletes the entry with the specified id. |
void |
delete(long id,
int count)
Deletes count entries starting at the entry with the specified id. |
void |
delete(long id,
int count,
boolean purge)
Deletes count entries starting at the entry with the specified id. |
long |
insertEntry(ByteBuffer buffer)
Inserts the given entry and returns the entry's ID. |
long |
insertEntry(ReadableByteChannel entry)
Inserts the entry represented by the given channel. |
boolean |
isReadOnly()
Determines whether this instance is read-only (unmodifiable). |
long |
killNext()
Kills the next entry ID. |
long |
killNext(int count)
Kills the next count entry IDs. |
Methods inherited from class com.faunos.skwish.sys.filters.FilterSegment |
---|
getBaseId, getEntry, getEntryChannel, getEntryCount, getEntryPart, getEntrySize, getNextId |
Methods inherited from class com.faunos.skwish.Segment |
---|
contains, getEntry, getEntrySize, getEntryStream, hi, isDeleted, isDeleted, lo, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReadOnlyFilterSegment(Segment inner)
inner
instance.
Method Detail |
---|
public final boolean isReadOnly()
Segment
isReadOnly
in class FilterSegment
true
public final void delete(long id) throws UnsupportedOperationException, IOException
Segment
delete
in class Segment
id
- the ID of the entry to be deleted. Must be
a valid ID in this segment [baseId, baseId + entryCount)
UnsupportedOperationException
IOException
public final void delete(long id, int count) throws UnsupportedOperationException, IOException
Segment
delete
in class Segment
id
- the ID of the first entry to be deleted. Must be
a valid ID in this segment [baseId, baseId + entryCount)count
- the number of entries to be deleted. Specifies a
range of IDs to be deleted: [id, id + count). The range
of IDs must be valid entries within this segment; o.w.
an exception is raised.
UnsupportedOperationException
IOException
public final void delete(long id, int count, boolean purge) throws UnsupportedOperationException, IOException
Segment
delete
in class FilterSegment
id
- the ID of the first entry to be deleted. Must be
a valid ID in this segment [baseId, baseId + entryCount)count
- the number of entries to be deleted. Specifies a
range of IDs to be deleted: [id, id + count). The range
of IDs must be valid entries within this segment; o.w.
an exception is raised.purge
- if true
, the contents of the deleted entries
are signaled to be purged (overwritten) immediately;
o.w. the contents will be deleted on the next time the segment is
compacted.
UnsupportedOperationException
IOException
public final long insertEntry(ByteBuffer buffer) throws UnsupportedOperationException, IOException
Segment
insertEntry
in class FilterSegment
buffer
- they contents of the entry
UnsupportedOperationException
IOException
public final long insertEntry(ReadableByteChannel entry) throws UnsupportedOperationException, IOException
Segment
entry
represented by the given channel.
The contents are of the entry is understood to be the entire
remaining contents in the specified channel.
This is the most efficient method for inserting a large-size entry
(even one that doesn't fit in memory).
insertEntry
in class FilterSegment
UnsupportedOperationException
IOException
public final long killNext() throws UnsupportedOperationException, IOException
Segment
killNext
in class Segment
UnsupportedOperationException
IOException
public final long killNext(int count) throws UnsupportedOperationException, IOException
Segment
count
entry IDs. A killed entry is an
entry that begins (and ends) life in the deleted state.
killNext
in class FilterSegment
count
- the number of entries to kill (must be greater than 1)
UnsupportedOperationException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |