proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
vsch_flexmark-java | flexmark-java/flexmark-util-dependency/src/main/java/com/vladsch/flexmark/util/dependency/DependencyResolver.java | DependencyResolver | resolveDependencies | class DependencyResolver {
public static <D extends Dependent> @NotNull List<D> resolveFlatDependencies(@NotNull List<D> dependentsList, @Nullable Function<DependentItemMap<D>, DependentItemMap<D>> itemSorter, @Nullable Function<? super D, Class<?>> classExtractor) {
List<List<D>> list = resolveDependencies... |
if (dependentsList.size() == 0) {
return Collections.emptyList();
} else if (dependentsList.size() == 1) {
return Collections.singletonList(dependentsList);
} else {
// resolve dependencies and processing lists
int dependentCount = dependentsList.... | 328 | 1,416 | 1,744 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-dependency/src/main/java/com/vladsch/flexmark/util/dependency/DependentItem.java | DependentItem | addDependency | class DependentItem<D> {
final public int index;
final public D dependent;
final public Class<?> dependentClass;
final public boolean isGlobalScope;
BitSet dependencies;
BitSet dependents;
public DependentItem(int index, D dependent, Class<?> dependentClass, boolean isGlobalScope) {
... |
if (this.dependencies == null) this.dependencies = new BitSet();
this.dependencies.or(dependencies);
| 583 | 35 | 618 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-experimental/src/main/java/com/vladsch/flexmark/experimental/util/collection/KeyedItemFactoryMap.java | KeyedItemFactoryMap | getItem | class KeyedItemFactoryMap<K, I, P> implements Map<K, Function<P, I>> {
protected final @NotNull HashMap<K, Function<P, I>> factoryMap;
protected final @NotNull HashMap<K, I> itemMap;
protected final @NotNull P param;
public KeyedItemFactoryMap(@NotNull P param) {
this(param, 0);
}
publ... |
I item = itemMap.get(key);
if (item == null) {
Function<P, I> factory = factoryMap.get(key);
if (factory == null) {
throw new IllegalStateException("Factory for key: " + key + " is not defined");
}
item = factory.apply(param);
... | 534 | 105 | 639 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-experimental/src/main/java/com/vladsch/flexmark/experimental/util/collection/iteration/PositionIterator.java | PositionIterator | next | class PositionIterator<T, P extends IPositionHolder<T, P>> implements Iterator<P> {
private @Nullable P myIndex;
private @Nullable P myNext;
public PositionIterator(@NotNull P index) {
assert index.getAnchor() != CURRENT;
myIndex = null;
myNext = index;
}
@Override
publ... |
if (myNext == null || !myNext.isValidElement()) throw new NoSuchElementException();
myIndex = myNext.withAnchor(PositionAnchor.CURRENT);
P oldNext = myNext;
if (myNext.getAnchor() == PREVIOUS) {
myNext = myNext.previousOrNull();
} else {
myNext = myNext... | 220 | 146 | 366 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-experimental/src/main/java/com/vladsch/flexmark/experimental/util/data/CollectionDataKey.java | CollectionDataKey | toString | class CollectionDataKey<T> extends DataKey<Collection<T>> {
/**
* Creates a DataKey with a computed default value dynamically.
*
* @param name See {@link #getName()}.
* @param defaultValue default value for collection key
* @param factory data value factory for creating a new default val... |
Collection<T> defaultValue = getDefaultValue();
return "CollectionDataKey<" + defaultValue.getClass().getSimpleName() + "> " + getName();
| 191 | 44 | 235 | <methods>public void <init>(@NotNull String, @NotNull Collection<T>, @NotNull DataNotNullValueFactory<Collection<T>>) ,public void <init>(@NotNull String, @NotNull NotNullValueSupplier<Collection<T>>) ,public void <init>(@NotNull String, @NotNull DataKey<Collection<T>>) ,public void <init>(@NotNull String, @NotNull Col... |
vsch_flexmark-java | flexmark-java/flexmark-util-experimental/src/main/java/com/vladsch/flexmark/experimental/util/sequence/managed/BaseSequenceEntry.java | BaseSequenceEntry | testEquals | class BaseSequenceEntry {
final private @NotNull WeakHashMap<Object, Boolean> quickEquals = new WeakHashMap<>();
private int hash;
public BaseSequenceEntry() {
}
/**
* Compare object to equality of entry's base sequence
* NOTE: if not char sequence or base of this entry's base sequence... |
equalsCall[0] = 0;
if (o == baseSeq || o == baseSeq.getBase()) return true;
if (!(o instanceof CharSequence)) return false;
CharSequence other = (CharSequence) o;
if (other.length() != baseSeq.length()) return false;
if (o instanceof IRichSequence<?>) {
IR... | 328 | 438 | 766 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-experimental/src/main/java/com/vladsch/flexmark/experimental/util/sequence/managed/BaseSequenceManager.java | BaseSequenceManager | getBaseSequence | class BaseSequenceManager {
// NOTE: baseMap will keep reference to BaseSequenceEntry as long as the underlying base object is in use
// baseSet relies on baseMap to keep references alive for used BasedSequence and its BaseSequenceEntry for quick fail/pass on equals
final private @NotNull WeakHashMap<Obje... |
WeakReference<BasedSequence> baseEntry;
BasedSequence baseSeq;
int callType = 0;
synchronized (baseMap) {
baseEntry = baseMap.get(object);
if (baseEntry != null) {
baseSeq = baseEntry.get();
if (baseSeq != null) {
... | 390 | 431 | 821 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/ColumnSort.java | ColumnSort | columnSort | class ColumnSort {
final public int column;
final public @NotNull Sort sort;
private ColumnSort(int column, @NotNull Sort sort) {
this.column = column;
this.sort = sort;
}
@NotNull
public static ColumnSort columnSort(int column, @NotNull Sort sort) {
return new ColumnSo... |
if (numeric) {
if (numericLast) {
return new ColumnSort(column, descending ? Sort.DESCENDING_NUMERIC_LAST : Sort.ASCENDING_NUMERIC_LAST);
} else {
return new ColumnSort(column, descending ? Sort.DESCENDING_NUMERIC : Sort.ASCENDING_NUMERIC);
}
... | 138 | 136 | 274 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/FormattedCounter.java | FormattedCounter | getFormatted | class FormattedCounter {
final private NumberFormat numberFormat;
final private Boolean isLowercase;
final private String delimiter;
private int count;
public FormattedCounter(NumberFormat format, Boolean lowercase, String delimiter) {
numberFormat = format;
isLowercase = lowercase;... |
String s = NumberFormat.getFormat(numberFormat, Utils.minLimit(count, 1));
String o = isLowercase == null ? s : isLowercase ? s.toLowerCase() : s.toUpperCase();
return withDelimiter && delimiter != null && !delimiter.isEmpty() ? o + delimiter : o;
| 178 | 90 | 268 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/MarkdownParagraph.java | TextTokenizer | next | class TextTokenizer {
final private CharSequence chars;
final private int maxIndex;
private int index = 0;
private int lastPos = 0;
private boolean isInWord = false;
private boolean isFirstNonBlank = true;
private int lastConsecutiveSpaces = 0;
private @Nu... |
token = null;
while (index < maxIndex) {
char c = chars.charAt(index);
if (isInWord) {
if (c == ' ' || c == '\t' || c == '\n' || c == MARKDOWN_START_LINE_CHAR) {
isInWord = false;
boolean isFirst... | 302 | 664 | 966 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/RomanNumeral.java | RomanNumeral | toString | class RomanNumeral {
final private int num; // The number represented by this Roman numeral.
/*
The following arrays are used by the toString() function to construct
the standard Roman numeral representation of the number. For each i,
the number numbers[i] is represented by the correspo... |
// Return the standard representation of this Roman numeral.
StringBuilder roman = new StringBuilder();
int N = num;
for (int i = 0; i < numbers.length; i++) {
while (N >= numbers[i]) {
roman.append(letters[i]);
N -= numbers[i];
}
... | 1,392 | 96 | 1,488 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/TableSection.java | TableSection | dumpRows | class TableSection {
final public TableSectionType sectionType;
final public ArrayList<TableRow> rows = new ArrayList<>();
protected int row;
protected int column;
public TableSection(TableSectionType sectionType) {
this.sectionType = sectionType;
row = 0;
column = 0;
}... |
StringBuilder sb = new StringBuilder();
for (TableRow row : rows) {
sb.append(" ").append(row.toString()).append("\n");
}
return sb;
| 747 | 51 | 798 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/TrackedOffset.java | TrackedOffset | toString | class TrackedOffset implements Comparable<TrackedOffset> {
private enum Flags {
AFTER_SPACE_EDIT,
AFTER_INSERT,
AFTER_DELETE,
}
final private static int F_AFTER_SPACE_EDIT = BitFieldSet.intMask(Flags.AFTER_SPACE_EDIT);
final private static int F_AFTER_INSERT = BitFieldSet.intMas... |
return "{" + offset +
(isSpliced() ? " ><" : "") +
(spacesBefore >= 0 || spacesAfter >= 0 ? " " + (spacesBefore >= 0 ? Integer.toString(spacesBefore) : "?") + "|" + (spacesAfter >= 0 ? Integer.toString(spacesAfter) : "?") : "") +
(BitFieldSet.any(flags, F_AFTER_S... | 1,391 | 198 | 1,589 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/TrackedOffsetList.java | TrackedOffsetList | getUnresolvedOffsets | class TrackedOffsetList implements List<TrackedOffset> {
public static TrackedOffsetList EMPTY_LIST = new TrackedOffsetList(BasedSequence.NULL, Collections.emptyList());
@NotNull
public static TrackedOffsetList create(@NotNull BasedSequence baseSeq, @NotNull List<TrackedOffset> trackedOffsets) {
re... |
ArrayList<TrackedOffset> unresolved = new ArrayList<>();
for (TrackedOffset trackedOffset : myTrackedOffsets) {
if (!trackedOffset.isResolved()) unresolved.add(trackedOffset);
}
return unresolved.isEmpty() ? EMPTY_LIST : new TrackedOffsetList(myBaseSeq, unresolved);
| 1,886 | 90 | 1,976 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-format/src/main/java/com/vladsch/flexmark/util/format/TrackedOffsetUtils.java | TrackedOffsetUtils | resolveTrackedOffsets | class TrackedOffsetUtils {
/**
* Resolve any unresolved tracked offsets
*
* @param sequence original sequence for tracked offsets
* @param appendable line appendable containing resulting lines
* @param offsets tracked offsets
* @param maxTrailingB... |
if (!offsets.isEmpty()) {
TrackedOffsetList trackedOffsets = TrackedOffsetList.create(sequence, offsets);
// need to resolve any unresolved offsets
int unresolved = trackedOffsets.size();
int length = 0;
ISequenceBuilder<?, ?> appendableBuilder = app... | 172 | 638 | 810 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/AttributeImpl.java | AttributeImpl | indexOfValue | class AttributeImpl implements Attribute {
final private String name;
final private char valueListDelimiter;
final private char valueNameDelimiter;
final private String value;
private AttributeImpl(CharSequence name, CharSequence value, char valueListDelimiter, char valueNameDelimiter) {
th... |
if (valueName.length() == 0 || value.length() == 0) return -1;
if (valueListDelimiter == SequenceUtils.NUL) {
return value.equals(valueName) ? 0 : -1;
} else {
int lastPos = 0;
BasedSequence subSeq = BasedSequence.of(value);
while (lastPos < valu... | 1,117 | 324 | 1,441 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/Attributes.java | Attributes | toString | class Attributes {
final public static Attributes EMPTY = new Attributes();
protected LinkedHashMap<String, Attribute> attributes;
public Attributes() {
attributes = null;
}
public Attributes(Attributes attributes) {
this.attributes = attributes == null || attributes.attributes ==... |
StringBuilder sb = new StringBuilder();
String sep = "";
for (String attrName : keySet()) {
sb.append(sep).append(attrName);
Attribute attribute = attributes.get(attrName);
if (!attribute.getValue().isEmpty()) sb.append("=").append("\"").append(attribute.getV... | 752 | 121 | 873 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/MutableAttributes.java | MutableAttributes | removeValue | class MutableAttributes extends Attributes {
public MutableAttributes() {
super();
}
public MutableAttributes(Attributes attributes) {
super(attributes);
}
@Override
public MutableAttributes toMutable() {
return this;
}
@Override
public Attributes toImmutab... |
if (attributes == null || key == null || key.length() == 0) return null;
String useKey = String.valueOf(key);
Attribute oldAttribute = attributes.get(useKey);
Attribute attribute = oldAttribute.removeValue(value);
getAttributes().put(useKey, attribute);
return attribute... | 968 | 84 | 1,052 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.html.Attributes) ,public boolean contains(java.lang.CharSequence) ,public boolean containsValue(java.lang.CharSequence, java.lang.CharSequence) ,public Set<Entry<java.lang.String,com.vladsch.flexmark.util.html.Attribute>> entrySet() ,public voi... |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/ui/BackgroundColor.java | BackgroundColor | of | class BackgroundColor extends Color {
final public static BackgroundColor NULL = new BackgroundColor(new Color(0, true));
final public static BackgroundColor WHITE = new BackgroundColor(Color.WHITE);
final public static BackgroundColor LIGHT_GRAY = new BackgroundColor(Color.LIGHT_GRAY);
final public sta... |
Color color = ColorStyler.getNamedColor(colorName);
return color == null ? NULL : new BackgroundColor(color);
| 446 | 35 | 481 | <methods>public void <init>(int) ,public void <init>(int, boolean) ,public void <init>(int, int, int) ,public void <init>(float, float, float) ,public void <init>(java.awt.color.ColorSpace, float[], float) ,public void <init>(int, int, int, int) ,public void <init>(float, float, float, float) ,public static int HSBtoRG... |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/ui/Color.java | Color | of | class Color extends java.awt.Color {
final public static Color NULL = new Color(new java.awt.Color(0, true));
final public static Color WHITE = new Color(java.awt.Color.WHITE);
final public static Color LIGHT_GRAY = new Color(java.awt.Color.LIGHT_GRAY);
final public static Color GRAY = new Color(java.aw... |
java.awt.Color color = ColorStyler.getNamedColor(colorName);
return color == null ? NULL : new Color(color);
| 497 | 37 | 534 | <methods>public void <init>(int) ,public void <init>(int, boolean) ,public void <init>(int, int, int) ,public void <init>(float, float, float) ,public void <init>(java.awt.color.ColorSpace, float[], float) ,public void <init>(int, int, int, int) ,public void <init>(float, float, float, float) ,public static int HSBtoRG... |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/ui/FontStyle.java | FontStyle | of | class FontStyle {
final public static FontStyle PLAIN = new FontStyle(0);
final public static FontStyle BOLD = new FontStyle(Font.BOLD);
final public static FontStyle ITALIC = new FontStyle(Font.ITALIC);
final public static FontStyle BOLD_ITALIC = new FontStyle(Font.ITALIC | Font.BOLD);
final publi... |
if ((fontStyle & (Font.BOLD | Font.ITALIC)) == (Font.BOLD | Font.ITALIC)) return BOLD_ITALIC;
if ((fontStyle & (Font.BOLD)) == (Font.BOLD)) return BOLD;
if ((fontStyle & (Font.ITALIC)) == (Font.ITALIC)) return ITALIC;
return PLAIN;
| 213 | 101 | 314 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/ui/FontStyleStyler.java | FontStyleStyler | getStyle | class FontStyleStyler extends HtmlStylerBase<FontStyle> {
@Override
public String getStyle(FontStyle item) {<FILL_FUNCTION_BODY>}
} |
return item == null ? "" :
(item.isItalic() ? "font-style:italic;" : "font-style:normal;") +
(item.isBold() ? "font-weight:bold" : "font-weight:normal");
| 47 | 66 | 113 | <methods>public non-sealed void <init>() ,public abstract java.lang.String getStyle(com.vladsch.flexmark.util.html.ui.FontStyle) ,public com.vladsch.flexmark.util.html.ui.FontStyle getStyleable(java.lang.Object) <variables> |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/ui/HtmlBuilder.java | HtmlBuilder | getHtmlStyler | class HtmlBuilder extends HtmlAppendableBase<HtmlBuilder> {
public HtmlBuilder() {
super(0, LineAppendable.F_PASS_THROUGH);
}
public HtmlBuilder(int indentSize, int formatOptions) {
super(indentSize, formatOptions);
}
@SuppressWarnings({ "UnusedReturnValue", "WeakerAccess" })
p... |
HtmlStyler styler = stylerMap.get(item.getClass());
if (styler != null) return styler;
// see if we have one that can handle this
for (Class value : stylerMap.keySet()) {
//noinspection unchecked
if (value.isAssignableFrom(item.getClass())) {
sty... | 1,592 | 153 | 1,745 | <methods>public void <init>(com.vladsch.flexmark.util.sequence.LineAppendable, boolean) ,public void <init>(int, int) ,public void <init>(@Nullable Appendable, int, int) ,public @NotNull HtmlBuilder addIndentOnFirstEOL(@NotNull Runnable) ,public @NotNull HtmlBuilder addPrefix(@NotNull CharSequence) ,public @NotNull Htm... |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/ui/HtmlHelpers.java | HtmlHelpers | mixedColor | class HtmlHelpers {
public static String toHtmlError(String err, boolean withContext) {
if (err == null) return null;
if (withContext) {
Matcher matcher = Pattern.compile("(?:^|\n)(.*\n)(\\s*)\\^(\n?)$").matcher(err);
if (matcher.find()) {
String group = matc... |
float[] hsbColor = java.awt.Color.RGBtoHSB(originalColor.getRed(), originalColor.getGreen(), originalColor.getBlue(), new float[3]);
float[] hsbError = java.awt.Color.RGBtoHSB(overlayColor.getRed(), overlayColor.getGreen(), overlayColor.getBlue(), new float[3]);
float[] hsbMixed = new float[3];... | 786 | 560 | 1,346 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-html/src/main/java/com/vladsch/flexmark/util/html/ui/HtmlStylerBase.java | HtmlStylerBase | getStyleable | class HtmlStylerBase<T> implements HtmlStyler<T> {
@Override
public T getStyleable(Object item) {<FILL_FUNCTION_BODY>}
public abstract String getStyle(T item);
} |
try {
//noinspection unchecked
return (T) item;
} catch (Throwable ignored) {
return null;
}
| 62 | 41 | 103 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/ArrayUtils.java | ArrayUtils | toArray | class ArrayUtils {
public static <T> boolean contained(T value, T[] array) {
return indexOf(value, array) != -1;
}
@SafeVarargs
public static <T> T[] append(Class<T> elemClass, T[] array, T... values) {
if (values.length > 0) {
//noinspection unchecked
T[] newIns... |
int i = bitSet.cardinality();
int[] bits = new int[i];
int lastSet = bitSet.length();
while (lastSet >= 0) {
lastSet = bitSet.previousSetBit(lastSet - 1);
if (lastSet < 0) break;
bits[--i] = lastSet;
}
assert i == 0;
return b... | 1,903 | 104 | 2,007 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/BitFieldSet.java | EnumBitFieldIterator | containsAll | class EnumBitFieldIterator<E extends Enum<E>> implements Iterator<E> {
int nextIndex;
int lastReturnedIndex = -1;
EnumBitFieldIterator() {
nextIndex = -1;
findNext();
}
public boolean hasNext() {
return nextIndex < universe.length;
}
... |
if (!(c instanceof BitFieldSet))
return super.containsAll(c);
BitFieldSet<?> es = (BitFieldSet<?>) c;
if (es.elementType != elementType)
return es.isEmpty();
return (es.elements & ~elements) == 0;
| 913 | 80 | 993 | <methods>public boolean equals(java.lang.Object) ,public int hashCode() ,public boolean removeAll(Collection<?>) <variables> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/DelimitedBuilder.java | DelimitedBuilder | appendAll | class DelimitedBuilder {
private String delimiter;
private StringBuilder out;
private boolean pending = false;
private int lastLen = 0;
private Stack<String> delimiterStack = null;
public DelimitedBuilder() {
this(",", 0);
}
public DelimitedBuilder(String delimiter) {
t... |
for (int i = start; i < end; i++) {
V item = v.get(i);
append(item.toString());
mark();
}
return this;
| 1,881 | 51 | 1,932 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/FileUtil.java | FileUtil | getFileContentWithExceptions | class FileUtil {
public static boolean isChildOf(File receiver, File ancestor) {
return (suffixWith(receiver.getPath(), File.separator)).startsWith(suffixWith(ancestor.getPath(), File.separator));
}
public static String getNameOnly(File receiver) {
String name = receiver.getName();
... |
StringBuilder sb = new StringBuilder();
String line;
InputStream inputStream = new FileInputStream(receiver);
InputStreamReader streamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
BufferedReader reader = new BufferedReader(streamReader);
while ((li... | 632 | 133 | 765 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/MinMaxAvgDouble.java | MinMaxAvgDouble | add | class MinMaxAvgDouble {
private double min = Double.MAX_VALUE;
private double max = Double.MIN_VALUE;
private double total = 0.0;
public MinMaxAvgDouble() {
}
public void add(double value) {<FILL_FUNCTION_BODY>}
public void add(MinMaxAvgDouble other) {
total += other.total;
... |
total += value;
min = Math.min(min, value);
max = Math.max(max, value);
| 241 | 33 | 274 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/MinMaxAvgFloat.java | MinMaxAvgFloat | add | class MinMaxAvgFloat {
private float min = Float.MAX_VALUE;
private float max = Float.MIN_VALUE;
private float total = 0.0f;
public MinMaxAvgFloat() {
}
public void add(float value) {<FILL_FUNCTION_BODY>}
public void add(MinMaxAvgFloat other) {
total += other.total;
min = ... |
total += value;
min = Math.min(min, value);
max = Math.max(max, value);
| 244 | 33 | 277 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/MinMaxAvgInt.java | MinMaxAvgInt | add | class MinMaxAvgInt {
private int min = Integer.MAX_VALUE;
private int max = Integer.MIN_VALUE;
private int total = 0;
public MinMaxAvgInt() {
}
public void add(int value) {
total += value;
min = Math.min(min, value);
max = Math.max(max, value);
}
public void ad... |
total += other.total;
min = Math.min(min, other.min);
max = Math.max(max, other.max);
| 233 | 39 | 272 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/MinMaxAvgLong.java | MinMaxAvgLong | add | class MinMaxAvgLong {
private long min = Long.MAX_VALUE;
private long max = Long.MIN_VALUE;
private long total = 0;
public MinMaxAvgLong() {
}
public void add(long value) {<FILL_FUNCTION_BODY>}
public void add(MinMaxAvgLong other) {
total += other.total;
min = Math.min(min... |
total += value;
min = Math.min(min, value);
max = Math.max(max, value);
| 239 | 33 | 272 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/Pair.java | Pair | toString | class Pair<K, V> implements Paired<K, V> {
public static <K1, V1> Pair<K1, V1> of(K1 first, V1 second) {
return new Pair<>(first, second);
}
final private K first;
final private V second;
public Pair(K first, V second) {
this.first = first;
this.second = second;
}
... |
StringBuilder out = new StringBuilder();
out.append('(');
if (first == null) out.append("null");
else out.append(first);
out.append(", ");
if (second == null) out.append("null");
else out.append(second);
out.append(')');
return out.toString();... | 433 | 94 | 527 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-misc/src/main/java/com/vladsch/flexmark/util/misc/TemplateUtil.java | MappedResolver | resolveRefs | class MappedResolver implements Resolver {
final protected Map<String, String> resolved;
public MappedResolver(Map<String, String> map) {
resolved = map;
}
public MappedResolver() {
this(new HashMap<>());
}
public MappedResolver set(String name,... |
if (text == null) return "";
Matcher matcher = pattern.matcher(text);
if (matcher.find()) {
StringBuffer sb = new StringBuffer();
do {
String[] groups = new String[matcher.groupCount() + 1];
for (int i = 0; i < groups.length; i++) {
... | 221 | 195 | 416 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-options/src/main/java/com/vladsch/flexmark/util/options/BooleanOptionParser.java | BooleanOptionParser | parseOption | class BooleanOptionParser<T> implements OptionParser<T> {
final public static String OPTION_0_PARAMETERS_1_IGNORED = "Option {0} does not have any parameters. {1} was ignored";
final public static String KEY_OPTION_0_PARAMETERS_1_IGNORED = "options.parser.boolean-option.ignored";
final private String option... |
if (optionText.isEmpty()) {
return new Pair<>(setOptions(options), Collections.singletonList(new ParsedOption<>(optionText, this, ParsedOptionStatus.VALID)));
} else {
if (provider == null) provider = MessageProvider.DEFAULT;
String message = provider.message(KEY_OPT... | 275 | 194 | 469 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-options/src/main/java/com/vladsch/flexmark/util/options/OptionsParser.java | OptionsParser | parseOption | class OptionsParser<T> implements OptionParser<T> {
final public static String OPTION_0_IS_AMBIGUOUS = "Option {0} matches: ";
final public static String KEY_OPTION_0_IS_AMBIGUOUS = "options.parser.option.ambiguous";
final public static String OPTION_0_DOES_NOT_MATCH = "Option {0} does not match any of: ";
... |
BasedSequence[] optionsList = optionsText.split(optionDelimiter, 0, BasedSequence.SPLIT_TRIM_SKIP_EMPTY, null);
T result = options;
if (provider == null) provider = MessageProvider.DEFAULT;
List<ParsedOption<T>> parsedOptions = new ArrayList<>(optionsList.length);
for (BasedSeq... | 527 | 720 | 1,247 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-options/src/main/java/com/vladsch/flexmark/util/options/ParserParams.java | ParserParams | add | class ParserParams {
public List<ParserMessage> messages = null;
public boolean skip = false;
public ParsedOptionStatus status = ParsedOptionStatus.VALID;
public ParserParams add(ParserMessage message) {<FILL_FUNCTION_BODY>}
public ParserParams escalate(ParsedOptionStatus other) {
status =... |
if (messages == null) messages = new ArrayList<>();
messages.add(message);
escalate(message.getStatus());
return this;
| 109 | 40 | 149 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/CharSubSequence.java | CharSubSequence | charAt | class CharSubSequence extends BasedSequenceImpl {
final private char[] baseChars;
final private CharSubSequence base;
final private int startOffset;
final private int endOffset;
private CharSubSequence(char[] chars, int hash) {
super(hash);
int iMax = chars.length;
base = t... |
SequenceUtils.validateIndex(index, length());
char c = baseChars[index + startOffset];
return c == SequenceUtils.NUL ? SequenceUtils.ENC_NUL : c;
| 1,519 | 53 | 1,572 | <methods>public void <init>(int) ,public void addSegments(@NotNull IBasedSegmentBuilder<?>) ,public int baseColumnAtEnd() ,public int baseColumnAtIndex(int) ,public int baseColumnAtStart() ,public int baseEndOfLine(int) ,public int baseEndOfLine() ,public int baseEndOfLineAnyEOL(int) ,public int baseEndOfLineAnyEOL() ,... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/Html5Entities.java | Html5Entities | readEntities | class Html5Entities {
final private static Map<String, String> NAMED_CHARACTER_REFERENCES = readEntities();
final private static Pattern NUMERIC_PATTERN = Pattern.compile("^&#[Xx]?");
final private static String ENTITY_PATH = "/com/vladsch/flexmark/util/sequence/entities.properties";
public static Str... |
Map<String, String> entities = new HashMap<>();
InputStream stream = Html5Entities.class.getResourceAsStream(ENTITY_PATH);
Charset charset = StandardCharsets.UTF_8;
try {
String line;
InputStreamReader streamReader = new InputStreamReader(stream, charset);
... | 681 | 237 | 918 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/MappedBasedSequence.java | MappedBasedSequence | sequenceOf | class MappedBasedSequence extends BasedSequenceImpl implements MappedSequence<BasedSequence>, ReplacedBasedSequence {
final private CharMapper mapper;
final private BasedSequence baseSeq;
private MappedBasedSequence(BasedSequence baseSeq, CharMapper mapper) {
super(0);
this.baseSeq = baseS... |
if (baseSeq instanceof MappedBasedSequence) {
return startIndex == 0 && endIndex == baseSeq.length() ? (BasedSequence) baseSeq : ((BasedSequence) baseSeq).subSequence(startIndex, endIndex).toMapped(mapper);
} else return new MappedBasedSequence(this.baseSeq.sequenceOf(baseSeq, startIndex, e... | 872 | 100 | 972 | <methods>public void <init>(int) ,public void addSegments(@NotNull IBasedSegmentBuilder<?>) ,public int baseColumnAtEnd() ,public int baseColumnAtIndex(int) ,public int baseColumnAtStart() ,public int baseEndOfLine(int) ,public int baseEndOfLine() ,public int baseEndOfLineAnyEOL(int) ,public int baseEndOfLineAnyEOL() ,... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/MappedRichSequence.java | MappedRichSequence | toMapped | class MappedRichSequence extends IRichSequenceBase<RichSequence> implements RichSequence, MappedSequence<RichSequence> {
final private CharMapper mapper;
final private RichSequence base;
private MappedRichSequence(CharMapper mapper, RichSequence baseSeq) {
super(0);
this.base = baseSeq;
... |
return mapper == CharMapper.IDENTITY ? this : new MappedRichSequence(this.mapper.andThen(mapper), base);
| 789 | 36 | 825 | <methods>public void <init>(int) ,public final transient @NotNull RichSequence append(java.lang.CharSequence[]) ,public final @NotNull RichSequence append(Iterable<? extends java.lang.CharSequence>) ,public final @NotNull RichSequence appendEOL() ,public final transient @NotNull RichSequence appendRangesTo(@NotNull Str... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/PlaceholderReplacer.java | PlaceholderReplacer | replaceAll | class PlaceholderReplacer {
public static <T> void replaceAll(Collection<T> spanList, Function<String, String> mapper, char openPlaceholder, char closePlaceholder, Function<T, String> getter, BiConsumer<T, String> setter) {<FILL_FUNCTION_BODY>}
} |
if (spanList.isEmpty()) return;
StringBuilder sb = null;
// accumulate text from < to >, because placeholder can be broken up across multiple spans
for (T span : spanList) {
String textValue = getter.apply(span);
int length = textValue.length();
int... | 79 | 564 | 643 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/PrefixedSubSequence.java | PrefixedSubSequence | getIndexOffset | class PrefixedSubSequence extends BasedSequenceImpl implements ReplacedBasedSequence {
final private CharSequence prefix;
final private BasedSequence base;
private PrefixedSubSequence(CharSequence prefix, BasedSequence baseSeq, int startIndex, int endIndex) {
super(0);
this.prefix = prefix... |
SequenceUtils.validateIndexInclusiveEnd(index, length());
if (index < prefix.length()) {
// NOTE: to allow creation of segmented sequences from modified original base return -1 for all such modified content positions
return -1;
}
return base.getIndexOffset(index... | 1,345 | 81 | 1,426 | <methods>public void <init>(int) ,public void addSegments(@NotNull IBasedSegmentBuilder<?>) ,public int baseColumnAtEnd() ,public int baseColumnAtIndex(int) ,public int baseColumnAtStart() ,public int baseEndOfLine(int) ,public int baseEndOfLine() ,public int baseEndOfLineAnyEOL(int) ,public int baseEndOfLineAnyEOL() ,... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/RepeatedSequence.java | RepeatedSequence | charAt | class RepeatedSequence implements CharSequence {
public static RepeatedSequence NULL = new RepeatedSequence(BasedSequence.NULL, 0, 0);
final private CharSequence chars;
final private int startIndex;
final private int endIndex;
private int hashCode;
private RepeatedSequence(CharSequence chars, ... |
if (index < 0 || index >= endIndex - startIndex) throw new IndexOutOfBoundsException();
return chars.charAt((startIndex + index) % chars.length());
| 903 | 47 | 950 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/ReplacedTextMapper.java | ReplacedTextMapper | originalOffset | class ReplacedTextMapper {
private ReplacedTextMapper parent;
private BasedSequence original;
private ArrayList<ReplacedTextRegion> regions = new ArrayList<>();
private ArrayList<BasedSequence> replacedSegments = new ArrayList<>();
private int replacedLength = 0;
private BasedSequence replacedSe... |
finalizeMods();
if (regions.isEmpty()) return parentOriginalOffset(replacedIndex);
if (replacedIndex == replacedLength) return parentOriginalOffset(original.length());
int originalIndex = replacedIndex;
for (ReplacedTextRegion region : regions) {
if (region.contai... | 891 | 172 | 1,063 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/RichSequenceImpl.java | RichSequenceImpl | subSequence | class RichSequenceImpl extends IRichSequenceBase<RichSequence> implements RichSequence {
final CharSequence charSequence;
private RichSequenceImpl(CharSequence charSequence) {
super(charSequence instanceof String ? charSequence.hashCode() : 0);
this.charSequence = charSequence;
}
@NotN... |
SequenceUtils.validateStartEnd(startIndex, endIndex, length());
if (startIndex == 0 && endIndex == charSequence.length()) return this;
return create(charSequence, startIndex, endIndex);
| 646 | 55 | 701 | <methods>public void <init>(int) ,public final transient @NotNull RichSequence append(java.lang.CharSequence[]) ,public final @NotNull RichSequence append(Iterable<? extends java.lang.CharSequence>) ,public final @NotNull RichSequence appendEOL() ,public final transient @NotNull RichSequence appendRangesTo(@NotNull Str... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/SegmentedSequence.java | SegmentedSequence | create | class SegmentedSequence extends BasedSequenceImpl implements ReplacedBasedSequence {
protected final BasedSequence baseSeq; // base sequence
protected final int startOffset; // this sequence's start offset in base
protected final int endOffset; // this sequence's end offset in base
... |
BasedSequence baseSubSequence = builder.getSingleBasedSequence();
if (baseSubSequence != null) {
return baseSubSequence;
} else if (!builder.isEmpty()) {
BasedSequence baseSequence = builder.getBaseSequence();
if (baseSequence.anyOptions(F_FULL_SEGMENTED_SEQU... | 1,420 | 235 | 1,655 | <methods>public void <init>(int) ,public void addSegments(@NotNull IBasedSegmentBuilder<?>) ,public int baseColumnAtEnd() ,public int baseColumnAtIndex(int) ,public int baseColumnAtStart() ,public int baseEndOfLine(int) ,public int baseEndOfLine() ,public int baseEndOfLineAnyEOL(int) ,public int baseEndOfLineAnyEOL() ,... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/SegmentedSequenceFull.java | SegmentedSequenceFull | create | class SegmentedSequenceFull extends SegmentedSequence {
final private boolean nonBaseChars; // true if contains non-base chars
final private int[] baseOffsets; // list of base offsets, offset by baseStartOffset
final private int baseStartOffset; // start offset for baseOffsets of this sequen... |
BasedSequence baseSeq = baseSequence.getBaseSequence();
int length = builder.length();
int baseStartOffset = 0;
int[] baseOffsets = new int[length + 1];
int index = 0;
for (Object part : builder) {
if (part instanceof Range) {
if (((Range) pa... | 1,539 | 480 | 2,019 | <methods>public final boolean allOptions(int) ,public final boolean anyOptions(int) ,public final @NotNull BasedSequence baseSubSequence(int, int) ,public static com.vladsch.flexmark.util.sequence.BasedSequence create(com.vladsch.flexmark.util.sequence.BasedSequence, @NotNull Iterable<? extends BasedSequence>) ,public ... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/SegmentedSequenceTree.java | Cache | create | class Cache {
final @NotNull Segment segment;
final @NotNull CharSequence chars;
final int indexDelta;
public Cache(@NotNull Segment segment, @NotNull CharSequence chars, int startIndex) {
this.segment = segment;
this.chars = chars;
indexDelta = start... |
SegmentTree segmentTree = SegmentTree.build(builder.getSegments(), builder.getText());
if (baseSeq.anyOptions(F_COLLECT_SEGMENTED_STATS)) {
SegmentedSequenceStats stats = baseSeq.getOption(SEGMENTED_STATS);
if (stats != null) {
stats.addStats(builder.noAnchorsSi... | 1,083 | 171 | 1,254 | <methods>public final boolean allOptions(int) ,public final boolean anyOptions(int) ,public final @NotNull BasedSequence baseSubSequence(int, int) ,public static com.vladsch.flexmark.util.sequence.BasedSequence create(com.vladsch.flexmark.util.sequence.BasedSequence, @NotNull Iterable<? extends BasedSequence>) ,public ... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/TagRange.java | TagRange | withStart | class TagRange extends Range {
protected final String tag;
public static TagRange of(CharSequence tag, int start, int end) {
return new TagRange(tag, start, end);
}
public TagRange(CharSequence tag, Range range) {
super(range);
this.tag = String.valueOf(tag);
}
public ... |
return start == getStart() ? this : new TagRange(getTag(), start, getEnd());
| 319 | 26 | 345 | <methods>public @NotNull BasedSequence basedSafeSubSequence(@NotNull CharSequence) ,public @NotNull BasedSequence basedSubSequence(@NotNull CharSequence) ,public @NotNull CharSequence charSubSequence(@NotNull CharSequence) ,public int compare(@NotNull Range) ,public int component1() ,public int component2() ,public boo... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/BasedSegmentBuilder.java | BasedSegmentBuilder | handleOverlap | class BasedSegmentBuilder extends SegmentBuilderBase<BasedSegmentBuilder> implements IBasedSegmentBuilder<BasedSegmentBuilder> {
final @NotNull BasedSequence baseSeq;
final @NotNull SegmentOptimizer optimizer;
protected BasedSegmentBuilder(@NotNull BasedSequence baseSeq) {
this(baseSeq, new CharRec... |
// convert overlap to text from our base
// range overlaps with last segment in the list
Range lastSeg = (Range) parts[0];
CharSequence text = (CharSequence) parts[1];
Range range = (Range) parts[2];
assert !lastSeg.isNull() && lastSeg.getEnd() > range.getStart();
... | 646 | 444 | 1,090 | <methods>public @NotNull BasedSegmentBuilder append(@NotNull Range) ,public @NotNull BasedSegmentBuilder append(int, int) ,public @NotNull BasedSegmentBuilder append(@NotNull CharSequence) ,public @NotNull BasedSegmentBuilder append(char) ,public @NotNull BasedSegmentBuilder append(char, int) ,public @NotNull BasedSegm... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/RichSequenceBuilder.java | RichSequenceBuilder | append | class RichSequenceBuilder implements ISequenceBuilder<RichSequenceBuilder, RichSequence> {
@NotNull
public static RichSequenceBuilder emptyBuilder() {
return new RichSequenceBuilder();
}
final private StringBuilder segments;
private RichSequenceBuilder() {
this.segments = new Strin... |
if (chars != null && chars.length() > 0 && startIndex < endIndex) {
segments.append(chars, startIndex, endIndex);
}
return this;
| 399 | 51 | 450 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/Seg.java | Seg | toString | class Seg {
final public static Seg NULL = new Seg(Range.NULL.getStart(), Range.NULL.getEnd());
final public static Seg ANCHOR_0 = new Seg(0, 0);
final public static int MAX_TEXT_OFFSET = Integer.MAX_VALUE >> 1;
final public static int F_TEXT_OPTION = Integer.MAX_VALUE & ~(MAX_TEXT_OFFSET);
final p... |
if (this.isNull()) {
return "NULL";
} else if (isBase()) {
if (start == end) {
return "[" + start + ")";
} else {
return "[" + start + ", " + end + ")";
}
} else {
CharSequence charSequence = allText.sub... | 1,153 | 318 | 1,471 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/SegmentBuilderBase.java | SegIterator | handleOverlap | class SegIterator implements Iterator<Seg> {
final SegmentBuilderBase<?> builder;
int nextIndex;
public SegIterator(SegmentBuilderBase<?> builder) {
this.builder = builder;
}
@Override
public boolean hasNext() {
return nextIndex < builder.size();... |
// range overlaps with last segment in the list
Range lastSeg = (Range) parts[0];
CharSequence text = (CharSequence) parts[1];
Range range = (Range) parts[2];
assert !lastSeg.isNull() && lastSeg.getEnd() > range.getStart();
if (lastSeg.getEnd() < range.getEnd()) {
... | 969 | 227 | 1,196 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/SegmentedSequenceStats.java | StatsEntry | getStatsText | class StatsEntry implements Comparable<StatsEntry> {
int segments;
int count;
final MinMaxAvgLong segStats = new MinMaxAvgLong();
final MinMaxAvgLong length = new MinMaxAvgLong();
final MinMaxAvgLong overhead = new MinMaxAvgLong();
public StatsEntry(int segments) {
... |
StringBuilder out = new StringBuilder();
int iMax = entries.size();
out.append(
String.format("%10s,%10s,%10s,%10s,%10s,%10s,%10s,%10s,%10s,%10s,%10s,%10s,%10s,%8s",
"count",
"min-seg",
"avg-seg",
... | 619 | 567 | 1,186 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/StringSequenceBuilder.java | StringSequenceBuilder | append | class StringSequenceBuilder implements ISequenceBuilder<StringSequenceBuilder, CharSequence> {
@NotNull
public static StringSequenceBuilder emptyBuilder() {
return new StringSequenceBuilder();
}
final private StringBuilder segments;
private StringSequenceBuilder() {
this.segments =... |
if (chars != null && chars.length() > 0 && startIndex < endIndex) {
segments.append(chars, startIndex, endIndex);
}
return this;
| 393 | 51 | 444 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/tree/BasedOffsetTracker.java | BasedOffsetTracker | getOffsetInfo | class BasedOffsetTracker {
protected final @NotNull BasedSequence sequence; // sequence on which this tracker is based, not the base sequence of original sequence
protected final @NotNull SegmentOffsetTree segmentOffsetTree;
private @Nullable Segment lastSegment;
protected BasedOffsetTracker(@NotNull... |
// if is end offset then will not
int offsetEnd = isEndOffset ? offset : offset + 1;
// if offsetEnd <= firstSegment.startOffset then indexRange is [0,0)
// if offset >= lastSegment.endOffset then indexRange is [sequence.length, sequence.length)
// otherwise, find segment for ... | 689 | 934 | 1,623 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/tree/OffsetInfo.java | OffsetInfo | toString | class OffsetInfo {
final public int pos;
final public int offset;
final public boolean isEndOffset;
final public int startIndex;
final public int endIndex;
public OffsetInfo(int pos, int offset, boolean isEndOffset, int startIndex) {
this(pos, offset, isEndOffset, startIndex, startIndex... |
return "OffsetInfo{ " +
"p=" + pos +
", o=" + (isEndOffset ? "[" + offset + ")" : "[" + offset + ", " + (offset + 1) + ")") +
", i=[" + startIndex + ", " + endIndex + ") }";
| 196 | 77 | 273 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/tree/Segment.java | Text | getSegByteLength | class Text extends Segment {
protected final @NotNull CharSequence chars;
public Text(int pos, byte[] bytes, int byteOffset, int indexOffset) {
super(pos, bytes, byteOffset, indexOffset);
int type = bytes[byteOffset++] & 0x00ff;
int segTypeMask = type & TYPE_MASK;
... |
int length = 1;
if (segType.hasBoth()) {
length += getIntBytes(segStart) + getIntBytes(segLength);
} else if (segType.hasOffset()) {
length += getOffsetBytes(segStart);
} else if (segType.hasLength()) {
length += getLengthBytes(segLength);
}
... | 1,607 | 163 | 1,770 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/tree/SegmentOffsetTree.java | SegmentOffsetTree | findSegmentPos | class SegmentOffsetTree extends SegmentTree {
final protected @NotNull int[] startIndices;
protected SegmentOffsetTree(@NotNull int[] treeData, @NotNull byte[] segmentBytes, @NotNull int[] startIndices) {
super(treeData, segmentBytes);
this.startIndices = startIndices;
}
@NotNull
p... |
throw new IllegalStateException("Method in SegmentOffsetTree should not be used");
| 1,769 | 22 | 1,791 | <methods>public void addSegments(@NotNull IBasedSegmentBuilder<?>, @NotNull SegmentTreeRange) ,public void addSegments(@NotNull IBasedSegmentBuilder<?>, int, int, int, int, int, int) ,public int aggrLength(int) ,public static int aggrLength(int, int[]) ,public static @NotNull SegmentTree build(@NotNull Iterable<Seg>, @... |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/tree/SegmentTreePos.java | SegmentTreePos | equals | class SegmentTreePos {
final public int pos;
final public int startIndex;
final public int iterations;
public SegmentTreePos(int pos, int startIndex, int iterations) {
this.pos = pos;
this.startIndex = startIndex;
this.iterations = iterations;
}
@Override
public boo... |
if (this == o) return true;
if (!(o instanceof SegmentTreePos)) return false;
SegmentTreePos pos1 = (SegmentTreePos) o;
if (pos != pos1.pos) return false;
return startIndex == pos1.startIndex;
| 190 | 74 | 264 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/builder/tree/SegmentTreeRange.java | SegmentTreeRange | toString | class SegmentTreeRange {
final public int startIndex;
final public int endIndex;
final public int startOffset;
final public int endOffset;
final public int startPos;
final public int endPos;
final public int length;
public SegmentTreeRange(int startIndex, int endIndex, int startOffset, ... |
return "SegmentTreeRange{" +
"startIndex=" + startIndex +
", endIndex=" + endIndex +
", startOffset=" + startOffset +
", endOffset=" + endOffset +
", startPos=" + startPos +
", endPos=" + endPos +
",... | 198 | 92 | 290 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/mappers/SpaceMapper.java | SpaceMapper | areEquivalent | class SpaceMapper {
final public static CharMapper toNonBreakSpace = new ToNonBreakSpace();
final public static CharMapper fromNonBreakSpace = new FromNonBreakSpace();
public static boolean areEquivalent(char c1, char c2) {<FILL_FUNCTION_BODY>}
public static @NotNull CharMapper toSpaces(@NotNull C... |
return c1 == c2 || (c1 == ' ' && c2 == SequenceUtils.NBSP) || (c2 == ' ' && c1 == SequenceUtils.NBSP);
| 331 | 49 | 380 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/mappers/SpecialLeadInCharsHandler.java | SpecialLeadInCharsHandler | escape | class SpecialLeadInCharsHandler implements SpecialLeadInHandler {
final CharPredicate predicate;
protected SpecialLeadInCharsHandler(CharPredicate predicate) {
this.predicate = predicate;
}
/**
* Escape special lead-in characters which start a block element if first non-whitespace on the ... |
if (sequence.length() == 1 && predicate.test(sequence.charAt(0))) {
consumer.accept("\\");
consumer.accept(sequence);
return true;
}
return false;
| 610 | 55 | 665 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-sequence/src/main/java/com/vladsch/flexmark/util/sequence/mappers/SpecialLeadInStartsWithCharsHandler.java | SpecialLeadInStartsWithCharsHandler | unEscape | class SpecialLeadInStartsWithCharsHandler implements SpecialLeadInHandler {
final CharPredicate predicate;
protected SpecialLeadInStartsWithCharsHandler(CharPredicate predicate) {
this.predicate = predicate;
}
/**
* Escape special lead-in characters which start a block element if first no... |
if (sequence.length() >= 2 && sequence.charAt(0) == '\\' && predicate.test(sequence.charAt(1))) {
consumer.accept(sequence.subSequence(1));
return true;
}
return false;
| 619 | 64 | 683 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-visitor/src/main/java/com/vladsch/flexmark/util/visitor/AstActionHandler.java | AstActionHandler | processChildren | class AstActionHandler<C extends AstActionHandler<C, N, A, H>, N, A extends AstAction<N>, H extends AstHandler<N, A>> {
final private @NotNull Map<Class<? extends N>, H> customHandlersMap = new HashMap<>();
final private @NotNull AstNode<N> astAdapter;
public AstActionHandler(@NotNull AstNode<N> astAdapter... |
N child = astAdapter.getFirstChild(node);
while (child != null) {
// A subclass of this visitor might modify the node, resulting in getNext returning a different node or no
// node after visiting it. So get the next node before visiting.
N next = astAdapter.getNext(c... | 868 | 100 | 968 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-util-visitor/src/main/java/com/vladsch/flexmark/util/visitor/AstHandler.java | AstHandler | hashCode | class AstHandler<N, A extends AstAction<? super N>> {
final private @NotNull Class<? extends N> aClass;
final private @NotNull A adapter;
public AstHandler(@NotNull Class<? extends N> klass, @NotNull A adapter) {
aClass = klass;
this.adapter = adapter;
}
public @NotNull Class<? ext... |
int result = aClass.hashCode();
result = 31 * result + adapter.hashCode();
return result;
| 254 | 33 | 287 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark-youtrack-converter/src/main/java/com/vladsch/flexmark/youtrack/converter/YouTrackConverterExtension.java | YouTrackConverterExtension | extend | class YouTrackConverterExtension implements Parser.ParserExtension, HtmlRenderer.HtmlRendererExtension {
private YouTrackConverterExtension() {
}
public static YouTrackConverterExtension create() {
return new YouTrackConverterExtension();
}
@Override
public void extend(Parser.Builder p... |
if (htmlRendererBuilder.isRendererType("YOUTRACK")) {
htmlRendererBuilder.nodeRendererFactory(new YouTrackConverterNodeRenderer.Factory());
} else {
throw new IllegalStateException("YouTrack Converter Extension used with non YouTrack Renderer " + rendererType);
}
| 292 | 75 | 367 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/AutoLink.java | AutoLink | getSegmentsForChars | class AutoLink extends DelimitedLinkNode {
public AutoLink() {
}
@NotNull
@Override
public BasedSequence[] getSegments() {
return new BasedSequence[] { openingMarker, pageRef, anchorMarker, anchorRef, closingMarker };
}
@NotNull
@Override
public BasedSequence[] getSegmentsF... |
return new BasedSequence[] {
openingMarker,
pageRef,
anchorMarker,
anchorRef,
closingMarker
};
| 312 | 38 | 350 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence) ,public void getAstExtra(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/FencedCodeBlock.java | FencedCodeBlock | getAstExtra | class FencedCodeBlock extends Block implements DoNotDecorate {
private int fenceIndent;
private BasedSequence openingMarker = BasedSequence.NULL;
private BasedSequence info = BasedSequence.NULL;
private BasedSequence attributes = BasedSequence.NULL;
private BasedSequence closingMarker = BasedSequenc... |
BasedSequence content = getContentChars();
int lines = getContentLines().size();
segmentSpanChars(out, openingMarker, "open");
segmentSpanChars(out, info, "info");
segmentSpanChars(out, attributes, "attributes");
segmentSpan(out, content, "content");
out.append("... | 757 | 113 | 870 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/HardLineBreak.java | HardLineBreak | collectText | class HardLineBreak extends Node implements DoNotTrim, TextContainer {
@NotNull
@Override
public BasedSequence[] getSegments() {
return EMPTY_SEGMENTS;
}
public HardLineBreak() {
}
public HardLineBreak(BasedSequence chars) {
super(chars);
}
@Override
public boo... |
BasedSequence chars = getChars();
out.add(chars.subSequence(chars.length() - 1, chars.length()));
return false;
| 143 | 45 | 188 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/Heading.java | Heading | getAnchorRefText | class Heading extends Block implements AnchorRefTarget {
protected int level;
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence text = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
protected String anchorRefId = "";
protected bo... |
boolean trimLeadingSpaces = HtmlRenderer.HEADER_ID_REF_TEXT_TRIM_LEADING_SPACES.get(getDocument());
boolean trimTrailingSpaces = HtmlRenderer.HEADER_ID_REF_TEXT_TRIM_TRAILING_SPACES.get(getDocument());
return new TextCollectingVisitor().collectAndGetText(this, TextContainer.F_FOR_HEADING_ID + ... | 692 | 163 | 855 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/HtmlEntity.java | HtmlEntity | collectText | class HtmlEntity extends Node implements TextContainer {
@Override
public void getAstExtra(@NotNull StringBuilder out) {
if (!getChars().isEmpty()) out.append(" \"").append(getChars()).append("\"");
}
// TODO: add opening and closing marker with intermediate text so that completions can be easi... |
if (any(flags, F_NODE_TEXT)) {
out.append(getChars());
} else {
ReplacedTextMapper textMapper = new ReplacedTextMapper(getChars());
BasedSequence unescaped = Escaping.unescape(getChars(), textMapper);
out.append(unescaped);
}
return false;... | 208 | 91 | 299 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/Image.java | Image | getAstExtra | class Image extends InlineLinkNode {
private BasedSequence urlContent = BasedSequence.NULL;
@NotNull
@Override
public BasedSequence[] getSegments() {
return new BasedSequence[] {
textOpeningMarker,
text,
textClosingMarker,
linkOpen... |
delimitedSegmentSpanChars(out, textOpeningMarker, text, textClosingMarker, "text");
segmentSpanChars(out, linkOpeningMarker, "linkOpen");
delimitedSegmentSpanChars(out, urlOpeningMarker, url, urlClosingMarker, "url");
if (pageRef.isNotNull()) segmentSpanChars(out, pageRef, "pageRef");
... | 708 | 216 | 924 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, ... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/ImageRef.java | ImageRef | setTextChars | class ImageRef extends RefNode {
public ImageRef() {
}
public ImageRef(BasedSequence chars) {
super(chars);
}
public ImageRef(BasedSequence textOpenMarker, BasedSequence text, BasedSequence textCloseMarker, BasedSequence referenceOpenMarker, BasedSequence reference, BasedSequence reference... |
int textCharsLength = textChars.length();
this.textOpeningMarker = textChars.subSequence(0, 2);
this.text = textChars.subSequence(2, textCharsLength - 1).trim();
this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength);
| 369 | 92 | 461 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, ... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/IndentedCodeBlock.java | IndentedCodeBlock | collectText | class IndentedCodeBlock extends Block implements TextContainer {
@NotNull
@Override
public BasedSequence[] getSegments() {
return EMPTY_SEGMENTS;
}
public IndentedCodeBlock() {
}
public IndentedCodeBlock(BasedSequence chars) {
super(chars);
}
public IndentedCodeBl... |
final BasedSequence chars = getContentChars();
if (any(flags, F_NODE_TEXT)) {
out.append(chars);
} else {
ReplacedTextMapper textMapper = new ReplacedTextMapper(chars);
BasedSequence unescaped = Escaping.unescape(chars, textMapper);
if (!unescaped... | 201 | 115 | 316 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/InlineLinkNode.java | InlineLinkNode | getSegments | class InlineLinkNode extends LinkNode {
protected BasedSequence textOpeningMarker = BasedSequence.NULL;
protected BasedSequence text = BasedSequence.NULL;
protected BasedSequence textClosingMarker = BasedSequence.NULL;
protected BasedSequence linkOpeningMarker = BasedSequence.NULL;
protected BasedSe... |
return new BasedSequence[] {
textOpeningMarker,
text,
textClosingMarker,
linkOpeningMarker,
urlOpeningMarker,
url,
pageRef,
anchorMarker,
anchorRef,
ur... | 1,519 | 96 | 1,615 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public boolean collectText(ISequenceBuilder<? extends ISequenceBuilder<?,com.vladsch.flexmark.util.sequence.BasedSequence>,com.vladsch.flexmark.util.sequence.BasedSequence>, int, com.vladsch.flexmark.util.ast.NodeVisito... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/Link.java | Link | setTextChars | class Link extends InlineLinkNode {
public Link() {
}
public Link(BasedSequence chars) {
super(chars);
}
public Link(BasedSequence textOpenMarker, BasedSequence text, BasedSequence textCloseMarker, BasedSequence linkOpenMarker, BasedSequence url, BasedSequence titleOpenMarker, BasedSequenc... |
int textCharsLength = textChars.length();
this.textOpeningMarker = textChars.subSequence(0, 1);
this.text = textChars.subSequence(1, textCharsLength - 1).trim();
this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength);
| 407 | 92 | 499 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, ... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/LinkNode.java | LinkNode | collectText | class LinkNode extends LinkNodeBase implements DoNotLinkDecorate, TextContainer {
public LinkNode() {
}
public LinkNode(BasedSequence chars) {
super(chars);
}
@Override
public boolean collectText(ISequenceBuilder<? extends ISequenceBuilder<?, BasedSequence>, BasedSequence> out, int fl... |
int urlType = flags & F_LINK_TEXT_TYPE;
BasedSequence url;
switch (urlType) {
case F_LINK_PAGE_REF:
url = getPageRef();
break;
case F_LINK_ANCHOR:
url = getAnchorRef();
break;
case F_LINK_URL:
... | 110 | 270 | 380 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public com.vladsch.flexmark.util.sequence.BasedSequence getAnchorMarker() ,public com.vladsch.flexmark.util.sequence.BasedSequence getAnchorRef() ,public com.vladsch.flexmark.util.sequence.BasedSequence getPageRef() ,pu... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/LinkNodeBase.java | LinkNodeBase | setUrlChars | class LinkNodeBase extends Node {
protected BasedSequence urlOpeningMarker = BasedSequence.NULL;
protected BasedSequence url = BasedSequence.NULL;
protected BasedSequence pageRef = BasedSequence.NULL;
protected BasedSequence anchorMarker = BasedSequence.NULL;
protected BasedSequence anchorRef = Base... |
if (url != null && url != BasedSequence.NULL) {
// strip off <> wrapping
if (url.startsWith("<") && url.endsWith(">")) {
urlOpeningMarker = url.subSequence(0, 1);
this.url = url.subSequence(1, url.length() - 1);
urlClosingMarker = url.subS... | 832 | 279 | 1,111 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/ListItem.java | ListItem | isItemParagraph | class ListItem extends Block implements ParagraphItemContainer, BlankLineContainer, ParagraphContainer {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence markerSuffix = BasedSequence.NULL;
private boolean tight = true;
private boolean hadBlankAfterItemParagraph = false... |
// see if this is the first paragraph child item
Node child = getFirstChild();
while (child != null && !(child instanceof Paragraph)) child = child.getNext();
return child == node;
| 1,280 | 54 | 1,334 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/OrderedList.java | OrderedList | getAstExtra | class OrderedList extends ListBlock {
private int startNumber;
private char delimiter;
@NotNull
@Override
public BasedSequence[] getSegments() {
return EMPTY_SEGMENTS;
}
public OrderedList() {
}
public OrderedList(BasedSequence chars) {
super(chars);
}
pub... |
super.getAstExtra(out);
if (startNumber > 1) out.append(" start:").append(startNumber);
out.append(" delimiter:'").append(delimiter).append("'");
| 283 | 55 | 338 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence, List<com.vladsch.flexmark.util.sequence.BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public void getAstExtra(@NotN... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/Paragraph.java | Paragraph | setContent | class Paragraph extends Block implements TextContainer {
final private static int[] EMPTY_INDENTS = new int[0];
private int[] lineIndents = EMPTY_INDENTS;
private boolean trailingBlankLine = false;
private boolean hasTableSeparator;
@NotNull
@Override
public BasedSequence[] getSegments() {
... |
super.setContent(other.getContentLines(startLine, endLine));
if (endLine > startLine) {
int[] lineIndents = new int[endLine - startLine];
System.arraycopy(other.lineIndents, startLine, lineIndents, 0, endLine - startLine);
this.lineIndents = lineIndents;
} el... | 1,204 | 115 | 1,319 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void <init>(@NotNull BasedSequence, @NotNull List<BasedSequence>) ,public void <init>(@NotNull List<BasedSequence>) ,public void <init>(com.vladsch.flexmark.util.ast.BlockContent) ,public @Nullable Block getParent() <variables> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/Reference.java | Reference | getSegmentsForChars | class Reference extends LinkNodeBase implements ReferenceNode<ReferenceRepository, Reference, RefNode> {
protected BasedSequence openingMarker = BasedSequence.NULL;
protected BasedSequence reference = BasedSequence.NULL;
protected BasedSequence closingMarker = BasedSequence.NULL;
@NotNull
@Override... |
return new BasedSequence[] {
openingMarker,
reference,
closingMarker,
PrefixedSubSequence.prefixOf(" ", closingMarker.getEmptySuffix()),
urlOpeningMarker,
pageRef,
anchorMarker,
ancho... | 1,224 | 94 | 1,318 | <methods>public void <init>() ,public void <init>(com.vladsch.flexmark.util.sequence.BasedSequence) ,public com.vladsch.flexmark.util.sequence.BasedSequence getAnchorMarker() ,public com.vladsch.flexmark.util.sequence.BasedSequence getAnchorRef() ,public com.vladsch.flexmark.util.sequence.BasedSequence getPageRef() ,pu... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/Text.java | Text | collectText | class Text extends Node implements TextContainer {
public Text() {
}
public Text(BasedSequence chars) {
super(chars);
}
public Text(String chars) {
super(BasedSequence.of(chars));
}
public Text(String chars, BasedSequence baseSeq) {
super(PrefixedSubSequence.prefix... |
if (any(flags, F_NODE_TEXT)) {
out.append(getChars());
} else {
ReplacedTextMapper textMapper = new ReplacedTextMapper(getChars());
BasedSequence unescaped = Escaping.unescape(getChars(), textMapper);
if (!unescaped.isEmpty()) out.append(unescaped);
... | 294 | 99 | 393 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/TextBase.java | TextBase | collectText | class TextBase extends Node implements TextContainer {
public TextBase() {
}
public TextBase(BasedSequence chars) {
super(chars);
}
public TextBase(String chars) {
super(BasedSequence.of(chars));
}
@NotNull
@Override
public BasedSequence[] getSegments() {
r... |
if (any(flags, F_NODE_TEXT)) {
out.append(getChars());
} else {
ReplacedTextMapper textMapper = new ReplacedTextMapper(getChars());
BasedSequence unescaped = Escaping.unescape(getChars(), textMapper);
out.append(unescaped);
}
return false;... | 226 | 91 | 317 | <methods>public void <init>() ,public void <init>(@NotNull BasedSequence) ,public void appendChain(@NotNull Node) ,public void appendChild(com.vladsch.flexmark.util.ast.Node) ,public static void astChars(@NotNull StringBuilder, @NotNull CharSequence, @NotNull String) ,public void astExtraChars(@NotNull StringBuilder) ,... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/AnchorRefTargetBlockVisitor.java | AnchorRefTargetBlockVisitor | visit | class AnchorRefTargetBlockVisitor extends NodeVisitorBase {
protected abstract void visit(AnchorRefTarget node);
protected boolean preVisit(@NotNull Node node) {
return true;
}
public void visit(@NotNull Node node) {<FILL_FUNCTION_BODY>}
} |
if (node instanceof AnchorRefTarget) visit((AnchorRefTarget) node);
if (preVisit(node) && node instanceof Block) {
visitChildren(node);
}
| 77 | 50 | 127 | <methods>public non-sealed void <init>() ,public void visitChildren(@NotNull Node) <variables> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/BlockVisitorExt.java | BlockVisitorExt | VISIT_HANDLERS | class BlockVisitorExt {
public static <V extends BlockVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(BlockQuote.class, visitor::visit),
new VisitHandler<>(BulletList.class, visitor::visit),
new VisitHandler<>(Document.class, visitor::visit),
new VisitHandler<>(FencedCodeBlock.class, visitor::visit... | 51 | 268 | 319 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/ClassifyingBlockTracker.java | ClassifyingBlockTracker | validateLinked | class ClassifyingBlockTracker implements BlockTracker, BlockParserTracker {
protected final ClassificationBag<Class<?>, Node> nodeClassifier = new ClassificationBag<>(NodeClassifier.INSTANCE);
protected final OrderedMultiMap<BlockParser, Block> allBlockParsersMap = new OrderedMultiMap<>(new CollectionHost<Paire... |
if (node.getNext() == null && node.getParent() == null) {
throw new IllegalStateException("Added block " + node + " is not linked into the AST");
}
| 1,176 | 50 | 1,226 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/HtmlInnerVisitorExt.java | HtmlInnerVisitorExt | VISIT_HANDLERS | class HtmlInnerVisitorExt {
public static <V extends HtmlInnerVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(HtmlInnerBlock.class, visitor::visit),
new VisitHandler<>(HtmlInnerBlockComment.class, visitor::visit),
};
| 55 | 54 | 109 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/InlineVisitorExt.java | InlineVisitorExt | VISIT_HANDLERS | class InlineVisitorExt {
public static <V extends InlineVisitor> VisitHandler<?>[] VISIT_HANDLERS(V visitor) {<FILL_FUNCTION_BODY>}
} |
return new VisitHandler<?>[] {
new VisitHandler<>(AutoLink.class, visitor::visit),
new VisitHandler<>(Code.class, visitor::visit),
new VisitHandler<>(Emphasis.class, visitor::visit),
new VisitHandler<>(HardLineBreak.class, visitor::visit),
... | 53 | 277 | 330 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/LineCollectingVisitor.java | LineCollectingVisitor | finalizeLines | class LineCollectingVisitor {
final private NodeVisitor myVisitor;
private List<Range> myLines;
private List<Integer> myEOLs;
private int myStartOffset;
private int myEndOffset;
public LineCollectingVisitor() {
myVisitor = new NodeVisitor(
new VisitHandler<>(Text.class, ... |
if (myStartOffset < myEndOffset) {
Range range = Range.of(myStartOffset, myEndOffset);
myLines.add(range);
myEOLs.add(0);
myStartOffset = myEndOffset;
}
| 647 | 67 | 714 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/LinkResolverAdapter.java | LinkResolverAdapter | resolveLink | class LinkResolverAdapter extends AstActionHandler<LinkResolverAdapter, Node, LinkResolvingHandler.LinkResolvingVisitor<Node>, LinkResolvingHandler<Node>> implements LinkResolvingHandler.LinkResolvingVisitor<Node> {
protected static final LinkResolvingHandler[] EMPTY_HANDLERS = new LinkResolvingHandler[0];
pub... |
return processNodeOnly(node, link, (n, handler) -> handler.resolveLink(n, context, link));
| 437 | 32 | 469 | <methods>public void <init>(@NotNull AstNode<Node>) ,public LinkResolvingHandler.@Nullable LinkResolvingVisitor<Node> getAction(@NotNull Node) ,public LinkResolvingHandler.@Nullable LinkResolvingVisitor<Node> getAction(@NotNull Class<?>) ,public @NotNull Set<Class<? extends Node>> getNodeClasses() <variables>private fi... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/Parsing.java | PatternTypeFlags | withAllowNameSpace | class PatternTypeFlags {
final @Nullable Boolean intellijDummyIdentifier;
final @Nullable Boolean htmlForTranslator;
final @Nullable String translationHtmlInlineTagPattern;
final @Nullable String translationAutolinkTagPattern;
final @Nullable Boolean spaceInLinkUrl;
final... | return new PatternTypeFlags(null, null, null, null, null, null, null, null, null, allowNameSpace); | 1,768 | 31 | 1,799 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/ReferenceRepository.java | ReferenceRepository | getReferencedElements | class ReferenceRepository extends NodeRepository<Reference> {
public ReferenceRepository(DataHolder options) {
super(Parser.REFERENCES_KEEP.get(options));
}
@NotNull
@Override
public DataKey<ReferenceRepository> getDataKey() {
return Parser.REFERENCES;
}
@NotNull
@Over... |
HashSet<Reference> references = new HashSet<>();
visitNodes(parent, value -> {
if (value instanceof RefNode) {
Reference reference = ((RefNode) value).getReferenceNode(ReferenceRepository.this);
if (reference != null) {
references.add(refe... | 204 | 100 | 304 | <methods>public void <init>(@Nullable KeepType) ,public void clear() ,public boolean containsKey(@NotNull Object) ,public boolean containsValue(java.lang.Object) ,public @NotNull Set<Map.Entry<String,Reference>> entrySet() ,public boolean equals(java.lang.Object) ,public @Nullable Reference get(@NotNull Object) ,public... |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/TextCollectingVisitor.java | TextCollectingVisitor | visit | class TextCollectingVisitor {
SequenceBuilder out;
final private NodeVisitor myVisitor;
final HashSet<Class<?>> myLineBreakNodes;
protected static Class<?>[] concatArrays(Class<?>[]... classes) {
int total = 0;
for (Class<?>[] classList : classes) {
total += classList.length... |
if (!node.isOrDescendantOfType(DoNotCollectText.class)) {
if (!out.isEmpty()) {
out.add("\n\n");
}
myVisitor.visitChildren(node);
}
| 844 | 61 | 905 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/TextNodeConverter.java | TextNodeConverter | insertMergedBefore | class TextNodeConverter {
final private BasedSequence nodeChars;
private BasedSequence remainingChars;
final private ArrayList<Node> list = new ArrayList<>();
public TextNodeConverter(BasedSequence nodeChars) {
this.nodeChars = nodeChars;
this.remainingChars = nodeChars;
}
publ... |
mergeList();
for (Node node : list) {
sibling.insertBefore(node);
}
clear();
| 830 | 35 | 865 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/ast/util/TextNodeMergingList.java | TextNodeMergingList | mergeList | class TextNodeMergingList {
private ArrayList<Node> list = new ArrayList<>();
private boolean isMerged = true;
public void add(Node node) {
list.add(node);
if (node instanceof Text) isMerged = false;
}
public void add(BasedSequence nodeChars) {
if (!nodeChars.isEmpty()) {
... |
if (!isMerged) {
// go through and see if some can be combined
ArrayList<Node> mergedList = null;
Node lastText = null;
for (Node child : list) {
if (child instanceof Text) {
if (!child.getChars().isEmpty()) {
... | 428 | 352 | 780 | <no_super_class> |
vsch_flexmark-java | flexmark-java/flexmark/src/main/java/com/vladsch/flexmark/formatter/MarkdownWriter.java | MarkdownWriter | lastBlockQuoteChildPrefix | class MarkdownWriter extends MarkdownWriterBase<MarkdownWriter, Node, NodeFormatterContext> {
public MarkdownWriter() {
this(null, 0);
}
public MarkdownWriter(int formatOptions) {
this(null, formatOptions);
}
public MarkdownWriter(@Nullable Appendable appendable, int formatOptions)... |
Node node = context.getCurrentNode();
while (node != null && node.getNextAnyNot(BlankLine.class) == null) {
Node parent = node.getParent();
if (parent == null || parent instanceof Document) break;
if (parent instanceof BlockQuoteLike) {
int pos = pref... | 707 | 187 | 894 | <methods>public void <init>() ,public void <init>(int) ,public void <init>(@Nullable Appendable, int) ,public @NotNull MarkdownWriter addIndentOnFirstEOL(@NotNull Runnable) ,public @NotNull MarkdownWriter addPrefix(@NotNull CharSequence) ,public @NotNull MarkdownWriter addPrefix(@NotNull CharSequence, boolean) ,public ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.