abstract class BooleanAttributeParser
extends com.yahoo.text.SimpleMapParser
{attribute:value, ...}
where value
' is either a single value or a list of values
[value1,value2,...]
, and each of the values can have an optional
bitmap specified value:bitmap
. bitmap
can be either
a 64-bit hex number 0x1234
or a list of bits [0, 2, 43,
22, ...]
.Modifier and Type | Field and Description |
---|---|
private boolean |
isMap |
Constructor and Description |
---|
BooleanAttributeParser() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addAttribute(String attribute,
String value)
Add an attribute without a subquery mask
|
protected abstract void |
addAttribute(String attribute,
String value,
BigInteger subqueryMask)
Add an attribute with a subquery mask
|
protected int |
findEndOfValue() |
private static int |
findNextButSkipLists(char[] chars,
String s,
int position)
Finds next index of a set of chars, but skips past any lists ("[...]").
|
private void |
handleAttribute(String attribute,
String value)
Handles one attribute, possibly with a subquery bitmap.
|
protected void |
handleKeyValue(String attribute,
String value) |
void |
parse(String s) |
private void |
parseBitmap(String attribute,
String value,
String bitmap) |
private void |
parseBitmapHex(String attribute,
String value,
String bitmap)
Adds attributes with the specified bitmap to normalizer.
|
private void |
parseBitmapList(String attribute,
String value,
String bitmap)
Adds attributes with the specified bitmap to normalizer.
|
private void |
parseMultiValue(String attribute)
Parses a list of values for a given attribute.
|
public void parse(String s)
parse
in class com.yahoo.text.SimpleMapParser
protected int findEndOfValue()
findEndOfValue
in class com.yahoo.text.SimpleMapParser
protected void handleKeyValue(String attribute, String value)
handleKeyValue
in class com.yahoo.text.SimpleMapParser
private void parseMultiValue(String attribute)
private void handleAttribute(String attribute, String value)
attribute
- Attribute namevalue
- Either value, or value:bitmap, where bitmap is either a 64-bit hex number or a list of bits.private void parseBitmapHex(String attribute, String value, String bitmap)
attribute
- Attribute to addvalue
- Value of attributebitmap
- Bitmap as a hex number, with a '0x' prefix.private void parseBitmapList(String attribute, String value, String bitmap)
attribute
- Attribute to addvalue
- Value of attributebitmap
- Bitmap as a list of bits, e.g. '[0, 3, 45]'protected abstract void addAttribute(String attribute, String value)
attribute
- name of attributevalue
- value of attributeprotected abstract void addAttribute(String attribute, String value, BigInteger subqueryMask)
attribute
- name of attributevalue
- value of attributesubqueryMask
- subquery mask for attribute (64-bit)private static int findNextButSkipLists(char[] chars, String s, int position)
chars
- Characters to find. Note that '[' should not be in this list.s
- String to searchposition
- position in s to start at.Copyright © 2018. All rights reserved.