public class FacetResponse extends Object implements Serializable, Cloneable, Iterable<FacetBucket>
FacetRequest
.Modifier and Type | Field and Description |
---|---|
static String |
TOKENIZED_ATTRIBUTE
Name of attribute that will identify if the buckets for this facet represet tokens.
|
Constructor and Description |
---|
FacetResponse(String name) |
FacetResponse(String name,
String displayName) |
Modifier and Type | Method and Description |
---|---|
void |
add(FacetBucket bucket)
Add a
bucket to this response. |
void |
addAll(Iterable<FacetBucket> value)
Add all buckets in
value to this response. |
void |
clear()
Remove all buckets from this response.
|
FacetResponse |
clone() |
boolean |
containsBucket(String label)
Returns
true if this FacetResponse contains a Bucket with the given label . |
boolean |
equals(Object other) |
FacetBucket |
get(int index)
Get a facet bucket at
index . |
Object |
getAttribute(String name)
Get an attribute by
name . |
boolean |
getAttribute(String name,
boolean defaultValue)
Get a
boolean attribute by name , returning defaultValue if unset. |
Date |
getAttribute(String name,
Date defaultValue)
|
double |
getAttribute(String name,
double defaultValue)
Get a
double attribute by name , returning defaultValue if unset. |
int |
getAttribute(String name,
int defaultValue)
Get an
int attribute by name , returning defaultValue if unset. |
long |
getAttribute(String name,
long defaultValue)
Get a
long attribute by name , returning defaultValue if unset. |
String |
getAttribute(String name,
String defaultValue)
|
BaseTypesMap<String,Object> |
getAttributes()
Get extended attributes.
|
FacetBucket |
getBucket(String label)
Gets a Bucket with the given
label . |
ArrayList<FacetBucket> |
getBuckets()
Get the buckets.
|
String |
getDisplayName()
Get the extended display name for this FacetResponse.
|
static String |
getDisplayName(FacetResponse response)
Get the raw display name for
response . |
FacetFilter |
getFacetFilter(FacetBucket bucket)
|
long |
getFacetTime()
Get the facet generation time (in milliseconds).
|
String |
getField()
Get the field used to generate this facet.
|
String |
getName()
Get the name for this FacetResponse.
|
FacetStatistics |
getStatistics()
Get the statistics for this response (if available).
|
long |
getTotalCount()
Get the sum of the counts for all buckets (even those not returned).
|
int |
hashCode() |
Iterator<FacetBucket> |
iterator() |
void |
setAttribute(String name,
Boolean value)
Set a boolean attribute.
|
void |
setAttribute(String name,
Date value)
Set a date attribute.
|
void |
setAttribute(String name,
Number value)
Set a numeric attribute.
|
void |
setAttribute(String name,
String value)
Set a string attribute.
|
void |
setAttributes(BaseTypesMap<String,Object> value)
Set extended attributes.
|
void |
setBuckets(Collection<FacetBucket> value)
Set the buckets.
|
void |
setDisplayName(String value)
Set the extended display name for this FacetResponse.
|
void |
setFacetTime(long time)
Set the facet generation time (in milliseconds).
|
void |
setField(String value)
Set the field used to generate this facet.
|
void |
setName(String value)
Set the name for this FacetResponse.
|
void |
setStatistics(FacetStatistics value)
Set the statistics for this response.
|
void |
setTotalCount(long value)
Set the sum of the counts for all buckets (even those not returned).
|
int |
size()
Get the number of buckets in this response.
|
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final String TOKENIZED_ATTRIBUTE
public FacetResponse(String name)
public String getName()
public void setName(String value)
public String getField()
NOTE: may be null if this is not a field based facet.
public void setField(String value)
public String getDisplayName()
public void setDisplayName(String value)
public ArrayList<FacetBucket> getBuckets()
public void setBuckets(Collection<FacetBucket> value)
public BaseTypesMap<String,Object> getAttributes()
public boolean getAttribute(String name, boolean defaultValue)
boolean
attribute by name
, returning defaultValue
if unset.public int getAttribute(String name, int defaultValue)
int
attribute by name
, returning defaultValue
if unset.public long getAttribute(String name, long defaultValue)
long
attribute by name
, returning defaultValue
if unset.public double getAttribute(String name, double defaultValue)
double
attribute by name
, returning defaultValue
if unset.public void setAttributes(BaseTypesMap<String,Object> value)
public FacetStatistics getStatistics()
public void setStatistics(FacetStatistics value)
public long getTotalCount()
public void setTotalCount(long value)
public long getFacetTime()
public void setFacetTime(long time)
public FacetFilter getFacetFilter(FacetBucket bucket)
public boolean containsBucket(String label)
true
if this FacetResponse contains a Bucket with the given label
.
Warning: this method performs a linear scan of all buckets and may require generating display values for all buckets during scan.
public FacetBucket getBucket(String label)
label
.
Warning: this method performs a linear scan of all buckets and may require generating display values for all buckets during scan.
public FacetBucket get(int index)
index
.public Iterator<FacetBucket> iterator()
iterator
in interface Iterable<FacetBucket>
public int size()
public void add(FacetBucket bucket)
bucket
to this response.public void addAll(Iterable<FacetBucket> value)
value
to this response.public void clear()
public FacetResponse clone()
public static String getDisplayName(FacetResponse response)
response
.Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.