
org.neo4j.kernel.impl.cache.Cache Maven / Gradle / Ivy
/**
* Copyright (c) 2002-2013 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 .
*/
package org.neo4j.kernel.impl.cache;
import java.util.Collection;
public interface Cache
{
/**
* Returns the name of the cache.
*
* @return name of the cache
*/
public String getName();
/**
* Adds element
to cache.
*
* @param element
* the element to cache
*/
public void put( E value );
/**
* Removes the element for key
from cache and returns it. If
* the no element for key
exists null
is
* returned.
*
* @param key
* the key for the element
* @return the removed element or null
if element didn't
* exist
*/
public E remove( long key );
/**
* Returns the cached element for key
. If the element isn't
* in cache null
is returned.
*
* @param key
* the key for the element
* @return the cached element or null
if element didn't exist
*/
public E get( long key );
/**
* Removing all cached elements.
*/
public void clear();
/**
* Returns the cache size. This number means different depending on cache type.
*
* @return cache size
*/
public long size();
// void elementCleaned( V value );
// public int maxSize();
// public void resize( int newSize );
// public boolean isAdaptive();
// public void setAdaptiveStatus( boolean status );
public void putAll( Collection values );
public long hitCount();
public long missCount();
public void updateSize( E entity, int newSize );
public void printStatistics();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy