| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.faunos.skwish.Segment
com.faunos.skwish.sys.filters.FilterSegment
com.faunos.skwish.sys.filters.AppendProtectedFilterSegment
com.faunos.skwish.sys.filters.SubSegment
public class SubSegment
A fixed-count view of an underlying segment. The entry count of this view remains frozen, even as entries are inserted in the 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 | |
|---|---|
SubSegment(Segment inner)
Creates an instance whose entry count is frozen at the current value of the underlying instance.  | 
|
SubSegment(Segment inner,
           long size)
 | 
|
| Method Summary | |
|---|---|
 void | 
getEntry(long id,
         ByteBuffer out,
         ByteBuffer workBuffer)
Returns the contents of the entry with the specified id.  | 
 FileChannel | 
getEntryChannel(long id)
Returns the contents of the entry with the given id
 as a FileChannel, or null, if deleted. | 
 long | 
getEntryCount()
Returns the number of entries in this instance.  | 
 long | 
getEntrySize(long id,
             ByteBuffer workBuffer)
Returns the size of the entry with the specified id.  | 
 long | 
getNextId()
Returns the ID the entry will get on the next insertion.  | 
| Methods inherited from class com.faunos.skwish.sys.filters.AppendProtectedFilterSegment | 
|---|
insertEntry, insertEntry, killNext | 
| Methods inherited from class com.faunos.skwish.sys.filters.FilterSegment | 
|---|
delete, getBaseId, getEntryPart, isReadOnly | 
| Methods inherited from class com.faunos.skwish.Segment | 
|---|
contains, delete, delete, getEntry, getEntrySize, getEntryStream, hi, isDeleted, isDeleted, killNext, lo, toString | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public SubSegment(Segment inner)
inner - the underlying segment
public SubSegment(Segment inner,
                  long size)
| Method Detail | 
|---|
public final void getEntry(long id,
                           ByteBuffer out,
                           ByteBuffer workBuffer)
                    throws IOException
Segmentout
 buffer.
getEntry in class FilterSegmentout - the buffer into which the contents are written.  Its
              remaining bytes must be large enough; o.w., an exception is raised.workBuffer - a work buffer used internally to read offsets.  The minimum
              capacity of this work buffer must be 16
IOException
public final FileChannel getEntryChannel(long id)
                                  throws IOException
Segmentid
 as a FileChannel, or null, if deleted.
 The returned channel is positioned at zero and is read-only.
getEntryChannel in class FilterSegmentIOExceptionpublic final long getEntryCount()
Segment
getEntryCount in class FilterSegment
public final long getEntrySize(long id,
                               ByteBuffer workBuffer)
                        throws IOException
Segment
getEntrySize in class FilterSegmentIOExceptionpublic final long getNextId()
Segment
getNextId in class FilterSegment
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||