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.

Author:
Sami Badawi
Generic will mainly not be used. The can be expanded with wild cards, but ignore for now.

Constructor Summary
QueryCalc()
           
 
Method Summary
 V get(K key, InContexts<K> inContexts)
          It is a get that will do the lazy calculation.
 V get(K key, java.util.Map<K,?>... maps)
          It is a get that will do the lazy calculation.
static QueryCalc getInstance()
           
 
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

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,
             InContexts<K> inContexts)
Description copied from interface: IQueryCalc
It is a get that will do the lazy calculation.

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

getInstance

public static QueryCalc getInstance()


Copyright © 2008. All Rights Reserved.