RegisterSign In

API Documentation: Class SDBIndex

Package: com.mckoi.sdb
implements java.lang.Iterable<com.mckoi.sdb.SDBRow>, com.mckoi.sdb.SDBTrustedObject

An index view of a column of an SDBTable. An index is a view of an ordered set of rows in a table. This object provides various methods for creating cursors for traversing an index, and producing alternative views of an index (such as reverse and subset views).

Methods Summary

long size()
boolean contains(String e)
SDBRow first()
SDBRow last()
RowCursor iterator()
SDBIndex reverse()
SDBIndex head(String toElement, boolean inclusive)
SDBIndex tail(String fromElement, boolean inclusive)
SDBIndex sub(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)
SDBIndex head(String toElement)
SDBIndex tail(String fromElement)
SDBIndex sub(String fromElement, String toElement)

Method Details

long size()

Returns the number of rows in this view of the index.

boolean contains(String e)

Returns true if this indexed view contains the given value.

SDBRow first()

Returns the first row in this index view, or null if the set is empty.

SDBRow last()

Returns the last row in this index view, or null if the set is empty.

RowCursor iterator()

Returns a cursor for traversing this view of the index from the start position onwards.

SDBIndex reverse()

Returns a reverse view of this index.

SDBIndex head(String toElement, boolean inclusive)

Returns the head view of this index, between position 0 and the position of the given element in the index. If 'inclusive' is true, includes rows that equal the element string.

SDBIndex tail(String fromElement, boolean inclusive)

The tail view of this index, between the position of the given element in the index and the end of the index. If 'inclusive' is true, includes rows that equal the element string.

SDBIndex sub(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive)

The subset view of rows in this index, between the positions of the given elements in the index. If 'fromInclusive' is true, includes rows that equal the fromElement string. If 'toInclusive' it true, includes rows that equal the toElement string.

SDBIndex head(String toElement)

The same as the call 'head(toElement, false)'

SDBIndex tail(String fromElement)

The same as the call 'tail(fromElement, true)'

SDBIndex sub(String fromElement, String toElement)

The same as the call 'sub(fromElement, true, toElement, false)'

The text on this page is licensed under the Creative Commons Attribution 3.0 License. Java is a registered trademark of Oracle and/or its affiliates.
Mckoi is Copyright © 2000 - 2018 Diehl and Associates, Inc. All rights reserved.