public class WeightedSetItem extends SimpleTaggableItem
Item.ItemCreator, Item.ItemType
Modifier and Type | Field and Description |
---|---|
private String |
indexName |
private com.yahoo.collections.CopyOnWriteHashMap<Object,Integer> |
set |
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
Constructor and Description |
---|
WeightedSetItem(String indexName)
Creates an empty weighted set; note you must provide an index name up front
|
Modifier and Type | Method and Description |
---|---|
private Integer |
addInternal(Object token,
int weight) |
Integer |
addToken(long value,
int weight) |
Integer |
addToken(String token)
Add token with weight 1.
|
Integer |
addToken(String token,
int weight)
Add weighted token.
|
protected void |
appendBodyString(StringBuilder buffer)
Override to append the item body in the canonical query language of this item.
|
WeightedSetItem |
clone()
Returns a deep copy of this item
|
void |
disclose(Discloser discloser) |
int |
encode(ByteBuffer buffer) |
protected void |
encodeThis(ByteBuffer buffer) |
String |
getIndexName() |
Item.ItemType |
getItemType()
Return the enumerated type of this item.
|
String |
getName()
Returns the name of this item
|
int |
getNumTokens() |
int |
getTermCount() |
Iterator<Map.Entry<Object,Integer>> |
getTokens() |
Integer |
getTokenWeight(String token) |
Integer |
removeToken(String token) |
void |
setIndexName(String index)
Sets the index name of this item
|
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
addAnnotation, appendHeadingString, equals, getAnnotation, getBytes, getCode, getCreator, getLabel, getLanguage, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, hashCode, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthize, toString, usePositionData
@NonNull private String indexName
public WeightedSetItem(String indexName)
public Integer addToken(long value, int weight)
public Integer addToken(String token, int weight)
public int getNumTokens()
public void setIndexName(String index)
Item
setIndexName
in class Item
@NonNull public String getIndexName()
public Item.ItemType getItemType()
Item
getItemType
in class Item
protected void appendBodyString(StringBuilder buffer)
Item
([itemName] [body])The body must be appended appended by this method.
appendBodyString
in class Item
public int encode(ByteBuffer buffer)
protected void encodeThis(ByteBuffer buffer)
encodeThis
in class Item
public int getTermCount()
getTermCount
in class Item
public WeightedSetItem clone()
Item
Copyright © 2017. All rights reserved.