it.unimi.di.mg4j.index.remote
Class RemoteTermMap

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<CharSequence>
      extended by it.unimi.di.mg4j.index.remote.RemoteTermMap
All Implemented Interfaces:
Function<CharSequence,Long>, Object2LongFunction<CharSequence>, StringMap<MutableString>, Serializable
Direct Known Subclasses:
RemotePrefixMap

public class RemoteTermMap
extends AbstractObject2LongFunction<CharSequence>
implements StringMap<MutableString>, Serializable

A remote term map.

Author:
Alessandro Arrabito, Sebastiano Vigna
See Also:
Serialized Form

Nested Class Summary
static class RemoteTermMap.ServerThread
           
 
Field Summary
protected  SocketAddress address
          The address of the index server.
protected static byte GET_NUMBER
           
protected static byte GET_TERM
           
protected static byte HAS_TERMS
           
protected  ObjectList<MutableString> list
          The cached return value of StringMap.list().
protected  RemoteIndexServerConnection remoteConnection
          The remote connection to the server (initialised lazily).
protected  int size
          The size of the map.
 
Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
defRetValue
 
Constructor Summary
RemoteTermMap(SocketAddress address, int size)
           
 
Method Summary
 boolean containsKey(Object o)
           
 long getLong(Object o)
           
 boolean hasTerms()
           
 ObjectList<MutableString> list()
           
 int size()
           
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
clear, defaultReturnValue, defaultReturnValue, get, put, put, remove, removeLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.Object2LongFunction
defaultReturnValue, defaultReturnValue, put, removeLong
 
Methods inherited from interface it.unimi.dsi.fastutil.Function
clear, get, put, remove
 

Field Detail

GET_NUMBER

protected static final byte GET_NUMBER
See Also:
Constant Field Values

GET_TERM

protected static final byte GET_TERM
See Also:
Constant Field Values

HAS_TERMS

protected static final byte HAS_TERMS
See Also:
Constant Field Values

address

protected SocketAddress address
The address of the index server.


size

protected final int size
The size of the map.


remoteConnection

protected transient RemoteIndexServerConnection remoteConnection
The remote connection to the server (initialised lazily).


list

protected ObjectList<MutableString> list
The cached return value of StringMap.list().

Constructor Detail

RemoteTermMap

public RemoteTermMap(SocketAddress address,
                     int size)
Method Detail

size

public int size()
Specified by:
size in interface Function<CharSequence,Long>

hasTerms

public boolean hasTerms()

list

public ObjectList<MutableString> list()
Specified by:
list in interface StringMap<MutableString>

getLong

public long getLong(Object o)
Specified by:
getLong in interface Object2LongFunction<CharSequence>

containsKey

public boolean containsKey(Object o)
Specified by:
containsKey in interface Function<CharSequence,Long>