Class LinkedHashModel

  • All Implemented Interfaces:
    Serializable, Iterable<Statement>, Collection<Statement>, Set<Statement>, Model, NamespaceAware

    public class LinkedHashModel
    extends AbstractModel
    Hash table based implementation of the Model interface.

    This implementation provides constant-time performance for filters using a single term, assuming the hash function disperses the elements properly among the buckets. Each term is indexed using a HashMap. When multiple terms are provided in a filter the index, of the term that reduces the possible Statements the most, is used and a sequential scan is used to filter additional terms.

    Note that this implementation is not synchronized. If multiple threads access a model concurrently, and at least one of the threads modifies the model, it must be synchronized externally. This is typically accomplished by synchronizing on some object that naturally encapsulates the model. If no such object exists, the set should be "wrapped" using the * Models.synchronizedModel method.

    Author:
    James Leigh
    See Also:
    Serialized Form