From c4ff9e433930c470534f163ec14a6afd61fb66ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 17 Sep 2015 10:59:56 +0200 Subject: [PATCH] Registry - Methods to get ALL component states --- TODO | 1 - .../info/ebenoit/ebul/cmp/ComponentRegistry.java | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 405742c..2e1a1cf 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,6 @@ To Do: * General usage documentation * Uncouple component-provided names from the library * Automatically-updated singletons - * Registry: get all component states * Document exceptions Other ideas (maybe later if needed): diff --git a/src/main/java/info/ebenoit/ebul/cmp/ComponentRegistry.java b/src/main/java/info/ebenoit/ebul/cmp/ComponentRegistry.java index 8a09414..ce252a0 100644 --- a/src/main/java/info/ebenoit/ebul/cmp/ComponentRegistry.java +++ b/src/main/java/info/ebenoit/ebul/cmp/ComponentRegistry.java @@ -112,6 +112,18 @@ public class ComponentRegistry } + public List< ComponentState > getAllStates( ) + { + return Collections.unmodifiableList( components ); + } + + + public void getAllStates( Collection< ComponentState > result ) + { + result.addAll( result ); + } + + public Object get( String name ) { ComponentState cs = this.byName.get( name );