K - The type of Keys in this Cache.V - The type of mapped Entities in this Cache.public interface Cache<K,V> extends Serializable
Copyright (C) 2014 John Wassilak (john@wassilak.com)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
| Modifier and Type | Method and Description |
|---|---|
void |
addEntity(K key,
Entity<V> entity)
The addEntity method adds the given Entity to the cache, mapped to the given key.
|
List<Entity<V>> |
getEntities(K key)
The getEntities method returns all entites mapped to the given key.
|
void |
removeEntity(K key,
Entity<V> entity)
The removeEntity method removes the given Entity from the list of Entities mapped to the given key.
|
List<Entity<V>> getEntities(K key)
key - The key that the Entities are expected to be mapped to.void addEntity(K key, Entity<V> entity)
key - The key that represents the given Entity. This is used to look up the Entity later. This key must have
a unique hash code relative to objects of the same type.entity - The Entity to be added to the cache, mapped to the given key.Copyright © 2014. All rights reserved.