org.elasticsearch.search.facet
Class InternalFacets

java.lang.Object
  extended by org.elasticsearch.search.facet.InternalFacets
All Implemented Interfaces:
Iterable<Facet>, Streamable, ToXContent, Facets

public class InternalFacets
extends Object
implements Facets, Streamable, ToXContent, Iterable<Facet>


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
InternalFacets(List<Facet> facets)
          Constructs a new facets.
 
Method Summary
<T extends Facet>
T
facet(Class<T> facetType, String name)
          Returns the facet by name already casted to the specified type.
<T extends Facet>
T
facet(String name)
          A facet of the specified name.
 List<Facet> facets()
          The list of Facets.
 Map<String,Facet> facetsAsMap()
          Returns the Facets keyed by map.
 Map<String,Facet> getFacets()
          Returns the Facets keyed by map.
 Iterator<Facet> iterator()
          Iterates over the Facets.
static InternalFacets readFacets(StreamInput in)
           
 void readFrom(StreamInput in)
           
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalFacets

public InternalFacets(List<Facet> facets)
Constructs a new facets.

Method Detail

iterator

public Iterator<Facet> iterator()
Iterates over the Facets.

Specified by:
iterator in interface Iterable<Facet>

facets

public List<Facet> facets()
The list of Facets.

Specified by:
facets in interface Facets

getFacets

public Map<String,Facet> getFacets()
Returns the Facets keyed by map.

Specified by:
getFacets in interface Facets

facetsAsMap

public Map<String,Facet> facetsAsMap()
Returns the Facets keyed by map.

Specified by:
facetsAsMap in interface Facets

facet

public <T extends Facet> T facet(Class<T> facetType,
                                 String name)
Returns the facet by name already casted to the specified type.

Specified by:
facet in interface Facets

facet

public <T extends Facet> T facet(String name)
A facet of the specified name.

Specified by:
facet in interface Facets

toXContent

public XContentBuilder toXContent(XContentBuilder builder,
                                  ToXContent.Params params)
                           throws IOException
Specified by:
toXContent in interface ToXContent
Throws:
IOException

readFacets

public static InternalFacets readFacets(StreamInput in)
                                 throws IOException
Throws:
IOException

readFrom

public void readFrom(StreamInput in)
              throws IOException
Specified by:
readFrom in interface Streamable
Throws:
IOException

writeTo

public void writeTo(StreamOutput out)
             throws IOException
Specified by:
writeTo in interface Streamable
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.