rename get to getString

This commit is contained in:
2021-10-16 19:57:34 +02:00
parent 491e88463a
commit 2ea11e6adb
5 changed files with 14 additions and 14 deletions

View File

@@ -289,7 +289,7 @@ public class QueryCompletionIndex implements AutoCloseable {
@Override
public String decode(final byte[] bytes) {
final long compressedString = VariableByteEncoder.decodeFirstValue(bytes);
return stringCompressor.get((int) compressedString);
return stringCompressor.getString((int) compressedString);
}
@Override

View File

@@ -47,13 +47,13 @@ class TagEncoderDecoder implements EncoderDecoder<Tag> {
result = stringCompressor.createTag("", "");
break;
case 1:
final String k = stringCompressor.get((int) compressedStrings.get(0));
final String k = stringCompressor.getString((int) compressedStrings.get(0));
result = stringCompressor.createTag(k, "");
break;
case 2:
final String key = stringCompressor.get((int) compressedStrings.get(0));
final String value = stringCompressor.get((int) compressedStrings.get(1));
final String key = stringCompressor.getString((int) compressedStrings.get(0));
final String value = stringCompressor.getString((int) compressedStrings.get(1));
result = stringCompressor.createTag(key, value);
break;
default:

View File

@@ -47,7 +47,7 @@ public class StringCompressor {
return usip.computeIfAbsent(processedValue);
}
public String get(final int integer) {
public String getString(final int integer) {
return usip.getKey(integer);
}
@@ -70,11 +70,11 @@ public class StringCompressor {
}
public String getKeyAsString(final Tag tag) {
return get(tag.getKey());
return getString(tag.getKey());
}
public String getValueAsString(final Tag tag) {
return get(tag.getValue());
return getString(tag.getValue());
}
public Tags createAndAddToDictionary(final String key, final String value) {
@@ -138,7 +138,7 @@ public class StringCompressor {
result.append(DEFAULT_GROUP);
} else {
for (final Tag tag : tags.toTags()) {
final String value = get(tag.getValue());
final String value = getString(tag.getValue());
if (result.length() > 0) {
result.append(" / ");
}
@@ -157,9 +157,9 @@ public class StringCompressor {
result.append(", ");
}
result.append(get(tag.getKey()));
result.append(getString(tag.getKey()));
result.append("=");
result.append(get(tag.getValue()));
result.append(getString(tag.getValue()));
}
return result.toString();

View File

@@ -133,7 +133,7 @@ public class Tags implements Comparable<Tags> {
final int index = Collections.binarySearch(tags, needle, TagByKeyComparator.INSTANCE);
if (index >= 0) {
final Tag tag = tags.get(index);
return STRING_COMPRESSOR.get(tag.getValue());
return STRING_COMPRESSOR.getString(tag.getValue());
}
return null;
}
@@ -152,7 +152,7 @@ public class Tags implements Comparable<Tags> {
public Set<String> getKeys() {
final TreeSet<String> result = new TreeSet<>();
for (final Tag tag : tags) {
result.add(STRING_COMPRESSOR.get(tag.getKey()));
result.add(STRING_COMPRESSOR.getString(tag.getKey()));
}
return result;
}

View File

@@ -35,7 +35,7 @@ public class StringCompressorTest {
final String value = "foo";
final Integer intFoo = keyValueCompressor.putString(value);
final String actual = keyValueCompressor.get(intFoo);
final String actual = keyValueCompressor.getString(intFoo);
Assertions.assertEquals(value, actual);
}
@@ -52,7 +52,7 @@ public class StringCompressorTest {
{
final StringCompressor keyValueCompressor = StringCompressor.create(database);
keyValueCompressor.get(0);
keyValueCompressor.getString(0);
}
}