Package weka.classifiers.lazy.kstar
Class KStarCache.CacheTable
- java.lang.Object
-
- weka.classifiers.lazy.kstar.KStarCache.CacheTable
-
- All Implemented Interfaces:
java.io.Serializable,RevisionHandler
- Enclosing class:
- KStarCache
public class KStarCache.CacheTable extends java.lang.Object implements java.io.Serializable, RevisionHandler
A custom hashtable class to support the caching system.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CacheTable()Constructs a new hashtable with a default capacity and load factor.CacheTable(int size, float loadFactor)Constructs a new hashtable with a default capacity and load factor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears this hashtable so that it contains no keys.booleancontainsKey(double key)Tests if the specified double is a key in this hashtable.KStarCache.TableEntrygetEntry(double key)Returns the table entry to which the specified key is mapped in this hashtable.java.lang.StringgetRevision()Returns the revision string.voidinsert(double key, double value, double pmiss)Inserts a new entry in the hashtable using the specified key.booleanisEmpty()Tests if this hashtable maps no keys to values.intsize()Returns the number of keys in this hashtable.
-
-
-
Method Detail
-
containsKey
public boolean containsKey(double key)
Tests if the specified double is a key in this hashtable.
-
insert
public void insert(double key, double value, double pmiss)Inserts a new entry in the hashtable using the specified key. If the key already exist in the hashtable, do nothing.
-
getEntry
public KStarCache.TableEntry getEntry(double key)
Returns the table entry to which the specified key is mapped in this hashtable.- Returns:
- a table entry.
-
size
public int size()
Returns the number of keys in this hashtable.- Returns:
- the number of keys in this hashtable.
-
isEmpty
public boolean isEmpty()
Tests if this hashtable maps no keys to values.- Returns:
- true if this hastable maps no keys to values.
-
clear
public void clear()
Clears this hashtable so that it contains no keys.
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-