org.fudgemsg.taxon
Class ImmutableMapTaxonomyResolver

java.lang.Object
  extended by org.fudgemsg.taxon.ImmutableMapTaxonomyResolver
All Implemented Interfaces:
TaxonomyResolver

public class ImmutableMapTaxonomyResolver
extends Object
implements TaxonomyResolver

An immutable taxonomy resolver implemented on top of a map.

The map of taxonomy by ID is loaded and fixed at construction. This is most useful when the taxonomies are known at startup.


Constructor Summary
ImmutableMapTaxonomyResolver()
          Creates a resolver that contains no taxonomies.
ImmutableMapTaxonomyResolver(Map<Short,FudgeTaxonomy> taxonomiesById)
          Creates a resolver that contains the given taxonomies.
 
Method Summary
 FudgeTaxonomy resolveTaxonomy(short taxonomyId)
          Looks up the taxonomy by ID.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImmutableMapTaxonomyResolver

public ImmutableMapTaxonomyResolver()
Creates a resolver that contains no taxonomies.


ImmutableMapTaxonomyResolver

public ImmutableMapTaxonomyResolver(Map<Short,FudgeTaxonomy> taxonomiesById)
Creates a resolver that contains the given taxonomies.

Parameters:
taxonomiesById - a map of taxonomy IDs to taxonomy instances, null treated as an empty map
Method Detail

resolveTaxonomy

public FudgeTaxonomy resolveTaxonomy(short taxonomyId)
Description copied from interface: TaxonomyResolver
Looks up the taxonomy by ID.

Specified by:
resolveTaxonomy in interface TaxonomyResolver
Parameters:
taxonomyId - the ID of the taxonomy to look up
Returns:
the taxonomy, null if not found

toString

public String toString()
Overrides:
toString in class Object


Copyright 2009-Present by OpenGamma Inc. and individual contributors
Released under the Apache License, Version 2.0