|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.faunos.skwish.sys.filters.DeleteSet
public class DeleteSet
A set of deleted IDs that are used to mask entries in external segments as deleted. The base implementation maintains the set in memory with no backing storage.
IOException
s and method signatures
Field Summary | |
---|---|
protected Set<Long> |
deletedIds
|
protected static Validator<DeleteSetException> |
validator
|
Constructor Summary | |
---|---|
DeleteSet(DeleteSet copy)
Copy constructor. |
|
DeleteSet(long minId,
long maxId)
Creates an instance with the specified ID range. |
Method Summary | |
---|---|
static DeleteSet |
combine(DeleteSet a,
DeleteSet b)
Creates and returns a new combined version of the two given instances. |
boolean |
delete(long id)
Adds the given id to the delete-set. |
int |
getCount()
Returns the number of (unique) entry IDs that are marked as deleted by this instance. |
Set<Long> |
getDeletedIds()
Returns a read-only view of the set of deleted IDs this instance manages. |
long |
getMaxId()
Returns the maximum ID (exclusive) that can be marked as deleted by this instance. |
long |
getMinId()
Returns the minimum ID that can be marked as deleted by this instance. |
boolean |
include(DeleteSet other)
Adds the set of deleted IDs of the other instance
to this instance's set. |
protected Set<Long> |
initSet(Set<Long> initValues)
|
boolean |
inRange(long id)
Determines whether the specified id is within the range
of this instance. |
boolean |
isDeleted(long id)
Determines whether the given id is in this delete-set. |
boolean |
isIncludeSupported()
Determines whether the instance supports the include method. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Validator<DeleteSetException> validator
protected final Set<Long> deletedIds
Constructor Detail |
---|
public DeleteSet(long minId, long maxId)
getMinId()
,
getMaxId()
public DeleteSet(DeleteSet copy)
copy
- the instance to be copiedMethod Detail |
---|
protected Set<Long> initSet(Set<Long> initValues)
public boolean delete(long id) throws IOException
id
to the delete-set.
id
- the ID to be deleted, which lie in this delete-set's range
true
, if the specified id
wasn't already deleted; false
, o.w.
IOException
public boolean isDeleted(long id) throws IOException
id
is in this delete-set.
There is no invalid argument for this method.
true
, if deleted; false
, o.w.
IOException
public int getCount()
public Set<Long> getDeletedIds() throws IOException
IOException
public final long getMinId()
public final long getMaxId()
public final boolean inRange(long id)
id
is within the range
of this instance. (An ID is in range if it's ≥ minId
and < maxId.)
public boolean include(DeleteSet other) throws IOException, UnsupportedOperationException
other
instance
to this instance's set. The range of the other
instance must be contained within the range of this instance.
UnsupportedOperationException
- if this subclass does not support it
IOException
public boolean isIncludeSupported()
include
method.
true
public static DeleteSet combine(DeleteSet a, DeleteSet b) throws IOException
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |