com.sun.labs.minion
Class IndexableMap

java.lang.Object
  extended by com.sun.labs.minion.IndexableMap
All Implemented Interfaces:
Indexable

public class IndexableMap
extends java.lang.Object
implements Indexable

Provides a combination of a document key and a map of field value pairs.


Field Summary
protected  java.lang.String key
          The key for the document represented by this map.
protected  java.util.Map<java.lang.String,java.lang.Object> map
          The map from field names to field values.
 
Constructor Summary
IndexableMap(java.lang.String key)
          Creates an indexable map, suitable for passing to an indexing queue in a search engine.
IndexableMap(java.lang.String key, java.util.Map<java.lang.String,java.lang.Object> map)
          Creates an indexable map, suitable for passing to an indexing queue in a search engine.
 
Method Summary
 java.lang.String getKey()
          Gets the key for this document.
 java.util.Map<java.lang.String,java.lang.Object> getMap()
          Gets the map from field names to field values
 void put(java.lang.String name, java.lang.Object value)
          Puts a field name and value pair into our map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

protected java.lang.String key
The key for the document represented by this map.


map

protected java.util.Map<java.lang.String,java.lang.Object> map
The map from field names to field values.

Constructor Detail

IndexableMap

public IndexableMap(java.lang.String key)
Creates an indexable map, suitable for passing to an indexing queue in a search engine. This object will create a map to which field name and and value pairs can be added.

Parameters:
key - a unique key for the document represented by this map.
See Also:
put(String, Object)

IndexableMap

public IndexableMap(java.lang.String key,
                    java.util.Map<java.lang.String,java.lang.Object> map)
Creates an indexable map, suitable for passing to an indexing queue in a search engine.

Parameters:
key - a unique key for the document represented by this map.
map - a map from field names to field values. An implementation of map that retains the order in which elements are added is the best thing to use.
Method Detail

put

public void put(java.lang.String name,
                java.lang.Object value)
Puts a field name and value pair into our map.

Parameters:
name - the name of the field
value - a value for the field.

getKey

public java.lang.String getKey()
Gets the key for this document.

Specified by:
getKey in interface Indexable
Returns:
The key for this document

getMap

public java.util.Map<java.lang.String,java.lang.Object> getMap()
Gets the map from field names to field values

Specified by:
getMap in interface Indexable
Returns:
the map from field names to field values.