blob: 0735d33d9c8f0f2085c093c2f560d35f67ca251c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.query;
import java.nio.ByteBuffer;
/**
* @author baldersheim
*/
// TODO: Fix javadoc
public abstract class PureWeightedItem extends Item {
public PureWeightedItem(int weight) {
setWeight(weight);
}
@Override
public void setIndexName(String index) {
// No index
}
@Override
public String getName() {
return getItemType().name(); //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public int encode(ByteBuffer buffer) {
encodeThis(buffer);
return 1;
}
@Override
protected void appendBodyString(StringBuilder buffer) {
buffer.append(':').append(getWeight());
}
}
|