| Modifier and Type | Class and Description |
|---|---|
static class |
Set.Builder<K> |
| Constructor and Description |
|---|
Set(swaydb.Set<K> database)
Constructs the Set object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(K key)
Adds the key to this set.
|
boolean |
add(K key,
LocalDateTime expireAt)
Adds the key with expire at to this set.
|
boolean |
add(K key,
long expireAfter,
TimeUnit timeUnit)
Adds the key with expire after to this set.
|
boolean |
add(List<? extends K> list)
Adds the keys to this set.
|
Set<K> |
asJava()
Returns the java set of this set.
|
static <K> Set.Builder<K> |
builder()
Creates the builder.
|
void |
clear()
Clears this set.
|
void |
close()
Closes the database.
|
swaydb.data.accelerate.Level0Meter |
commit(swaydb.Prepare<K,scala.runtime.Nothing$>... prepares)
Starts the commit function for this set.
|
boolean |
contains(K key)
Checks if a set contains key.
|
boolean |
containsAll(Collection<K> collection)
Checks if a set contains key collection.
|
static <K> Set<K> |
create(Object keySerializer)
Creates the set.
|
LocalDateTime |
expiration(K key)
Returns the expiration date for key in this set.
|
boolean |
expire(K key,
LocalDateTime expireAt)
Setups the expiration at for key to this set.
|
boolean |
expire(K key,
long after,
TimeUnit timeUnit)
Setups the expiration after for key to this set.
|
boolean |
isEmpty()
Checks if a set is empty.
|
Iterator<K> |
iterator()
Returns the iterator of elements in this set.
|
swaydb.data.accelerate.Level0Meter |
level0Meter()
Returns the level of meter for zerro level.
|
Optional<swaydb.data.compaction.LevelMeter> |
level1Meter()
Returns the level of meter for first level.
|
Optional<swaydb.data.compaction.LevelMeter> |
levelMeter(int levelNumber)
Returns the level of meter for level.
|
boolean |
mightContain(K key)
Checks if a set might contain key.
|
boolean |
nonEmpty()
Checks if a set is not empty.
|
boolean |
remove(K key)
Removes the key of this set.
|
void |
remove(K from,
K to)
Removes the keys of this set.
|
void |
remove(Set<K> keys)
Removes the keys of this set.
|
boolean |
retainAll(Collection<K> collection)
Retains the keys to this set.
|
int |
size()
Returns the size of elements in this set.
|
long |
sizeOfSegments()
Returns the size for segments for this set.
|
Duration |
timeLeft(K key)
Returns the time left for key in this set.
|
Object[] |
toArray()
Returns the array of elements in this set.
|
<T> T[] |
toArray(T[] a)
Returns the typed array of elements in this set.
|
public Set(swaydb.Set<K> database)
database - the databasepublic boolean contains(K key)
public boolean mightContain(K key)
mightContain in interface Set<K>key - the keytrue if a set might contain key, false otherwisepublic Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean add(K key)
public boolean add(K key, long expireAfter, TimeUnit timeUnit)
public boolean add(K key, LocalDateTime expireAt)
public boolean expire(K key, long after, TimeUnit timeUnit)
public boolean expire(K key, LocalDateTime expireAt)
public boolean containsAll(Collection<K> collection)
containsAll in interface Set<K>collection - the collectiontrue if a set contains key, false otherwisepublic boolean retainAll(Collection<K> collection)
public int size()
public boolean isEmpty()
public boolean nonEmpty()
public LocalDateTime expiration(K key)
expiration in interface Set<K>key - the keypublic long sizeOfSegments()
sizeOfSegments in interface Set<K>public swaydb.data.accelerate.Level0Meter level0Meter()
level0Meter in interface Set<K>public Optional<swaydb.data.compaction.LevelMeter> level1Meter()
public Optional<swaydb.data.compaction.LevelMeter> levelMeter(int levelNumber)
levelMeter in interface Set<K>levelNumber - the level numberpublic boolean remove(K key)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic swaydb.data.accelerate.Level0Meter commit(swaydb.Prepare<K,scala.runtime.Nothing$>... prepares)
public static <K> Set<K> create(Object keySerializer)
K - the type of the key elementkeySerializer - the keySerializerpublic static <K> Set.Builder<K> builder()
K - the type of the key elementCopyright © 2019. All rights reserved.