com.javanut.pronghorn.util.TopicUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pronghorn-pipes Show documentation
Show all versions of pronghorn-pipes Show documentation
Ring buffer based queuing utility for applications that require high performance and/or a small
footprint. Well suited for embedded and stream based processing.
package com.javanut.pronghorn.util;
import java.io.IOException;
public class TopicUtil {
//TODO: (easy short task) add unit tests for this.
public static long extractLong(CharSequence topic, int levelIndex) {
long result = 0;
int limit = topic.length();
int idx = scanForLevelPosition(topic, levelIndex, 0, limit);
while (idx='0' && c<='9') {
result = ((result*10) + (c-'0'));
} else {
//not numeric found, probably /
break;
}
}
return result;
}
public static CharSequence extractCharSequence(CharSequence topic, int levelIndex) {
long result = 0;
int limit = topic.length();
int idx = scanForLevelPosition(topic, levelIndex, 0, limit);
int start = idx;
int length = 0;
while (idx0 && idx
© 2015 - 2025 Weber Informatics LLC | Privacy Policy