You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/08/15 22:44:15 UTC
[lucene-solr] branch reference_impl_dev updated: @551 Oh baby,
been a while since I've seen this matter.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl_dev by this push:
new ee8f770 @551 Oh baby, been a while since I've seen this matter.
ee8f770 is described below
commit ee8f7709677ebc33ac6e2e6cb71574b4f4df9734
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sat Aug 15 17:43:54 2020 -0500
@551 Oh baby, been a while since I've seen this matter.
---
.../lucene/benchmark/byTask/utils/Format.java | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.java
index a4636de..6b887af 100644
--- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.java
+++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Format.java
@@ -98,6 +98,17 @@ public class Format {
}
/**
+ * Pad a string from right.
+ * @param s string to be formatted.
+ * @param len length.
+ * @return formatted string.
+ */
+ public static String format(String s, int len) {
+ String s1 = (s + padd);
+ return s1.substring(0, Math.min(len, s1.length()));
+ }
+
+ /**
* Pad a string from left.
* @param s string to be formatted.
* @param col column name (used for deciding on length).
@@ -108,4 +119,15 @@ public class Format {
return res.substring(res.length() - col.length());
}
+ /**
+ * Pad a string from left.
+ * @param s string to be formatted.
+ * @param len length of to padd to.
+ * @return formatted string.
+ */
+ public static String formatPaddLeft(String s, int len) {
+ String res = padd + s;
+ return res.substring(res.length() - len);
+ }
+
}