org.archive.util.fingerprint
Interface LongFPSet

All Known Implementing Classes:
AbstractLongFPSet, ArrayLongFPCache, LongFPSetCache, MemLongFPSet

public interface LongFPSet

Set for holding primitive long fingerprints.

Author:
Gordon Mohr

Method Summary
 boolean add(long l)
          Add a fingerprint to the set.
 boolean contains(long l)
          Does this set contain a given fingerprint.
 long count()
          get the number of elements in the Set
 boolean quickContains(long fp)
          Do a contains() check that doesn't require laggy activity (eg disk IO).
 boolean remove(long l)
          Remove a fingerprint from the set, if it is there
 

Method Detail

add

boolean add(long l)
Add a fingerprint to the set. Note that subclasses can implement different policies on how to add - some might grow the available space, others might implement some type of LRU caching. In particular, you cannot on the count() method returning 1 greater than before the addition.

Parameters:
l - the fingerprint to add
Returns:
true if set has changed with this addition

contains

boolean contains(long l)
Does this set contain a given fingerprint.

Parameters:
l - the fingerprint to check for
Returns:
true if the fingerprint is in the set

remove

boolean remove(long l)
Remove a fingerprint from the set, if it is there

Parameters:
l - the fingerprint to remove
Returns:
true if we removed the fingerprint

count

long count()
get the number of elements in the Set

Returns:
the number of elements in the Set

quickContains

boolean quickContains(long fp)
Do a contains() check that doesn't require laggy activity (eg disk IO). If this returns true, fp is definitely contained; if this returns false, fp *MAY* still be contained -- must use full-cost contains() to be sure.

Parameters:
fp - the fingerprint to check for
Returns:
true if contains the fingerprint


Copyright © 2003-2011 Internet Archive. All Rights Reserved.