org.terracotta.management.registry
Class DefaultResultSet<T>

java.lang.Object
  extended by org.terracotta.management.registry.DefaultResultSet<T>
All Implemented Interfaces:
Iterable<T>, ResultSet<T>

public class DefaultResultSet<T>
extends Object
implements ResultSet<T>

Author:
Mathieu Carbou

Constructor Summary
DefaultResultSet(Map<Context,T> results)
           
 
Method Summary
 T getResult(Context context)
           
 T getSingleResult()
           
 boolean isEmpty()
           
 Iterator<T> iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResultSet

public DefaultResultSet(Map<Context,T> results)
Method Detail

getResult

public T getResult(Context context)
Specified by:
getResult in interface ResultSet<T>
Returns:
The result of the query for a specific context

getSingleResult

public T getSingleResult()
                  throws NoSuchElementException
Specified by:
getSingleResult in interface ResultSet<T>
Returns:
The result of the query for the only one existing context
Throws:
NoSuchElementException - If the result set is empty or has more than 1 values

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface ResultSet<T>

size

public int size()
Specified by:
size in interface ResultSet<T>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>


Copyright © 2016. All Rights Reserved.