org.shapelogic.calculation
Class QueryCalc<K,V>

java.lang.Object
  extended by org.shapelogic.calculation.QueryCalc<K,V>
Type Parameters:
K - key
V - value
All Implemented Interfaces:
IQueryCalc<K,V>

public class QueryCalc<K,V>
extends java.lang.Object
implements IQueryCalc<K,V>

A very general interface for doing any kind of queries to lazy calculations and streams.
Generic will mainly not be used. The can be expanded with wild cards, but ignore for now.

Author:
Sami Badawi

Constructor Summary
QueryCalc()
           
 
Method Summary
 V get(K key, java.util.Map<K,?>... maps)
          It is a get that will do the lazy calculation.
 V get(K key, RecursiveContext<K> recursiveContexts)
          It is a get that will do the lazy calculation.
static QueryCalc getInstance()
           
 void put(K key, V value, RecursiveContext<K> recursiveContext)
          Put in the first non null context in a RecursiveContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryCalc

public QueryCalc()
Method Detail

getInstance

public static QueryCalc getInstance()

get

public V get(K key,
             java.util.Map<K,?>... maps)
It is a get that will do the lazy calculation.
This should not be used to get a Stream since this is treated as a CalcValue and the value is returned instead of the stream.

Specified by:
get in interface IQueryCalc<K,V>
Parameters:
key -
map - sequence of maps to do lookup in starting from the last
Returns:
the value of the first lookup found from the back

get

public V get(K key,
             RecursiveContext<K> recursiveContexts)
Description copied from interface: IQueryCalc
It is a get that will do the lazy calculation.

Specified by:
get in interface IQueryCalc<K,V>
recursiveContexts - class that contains the contexts that this is to be done in.
Returns:

put

public void put(K key,
                V value,
                RecursiveContext<K> recursiveContext)
Put in the first non null context in a RecursiveContext.

Specified by:
put in interface IQueryCalc<K,V>


Copyright © 2008. All Rights Reserved.