Verified Owner
Top Inners Fields Constructors Methods
org.jabref.logic.journals.ltwa

public Class PrefixTree<D>

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .HashSet, .List, .Map, .Set

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static record

Field Summary

Modifier and TypeField and Description
private final PrefixTree.Node<D>
public static final int
WILD_CARD

Wildcard character used to match any character in the prefix tree.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
insert(String key, List<D> data)

public List<D>
search(String word)

private void
searchRecursive(PrefixTree.Node<D> node, String word, int index, Set<D> result, Set<PrefixTree.SearchState> visited)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rootback to summary
private final PrefixTree.Node<D> root
WILD_CARDback to summary
public static final int WILD_CARD

Wildcard character used to match any character in the prefix tree. For example, WILD_CARD + WILD_CARD + WILD_CARD + "Hello World" -> would match .{,3}Hello World in this prefix tree

Constructor Detail

PrefixTreeback to summary
public PrefixTree()

Method Detail

insertback to summary
public void insert(String key, List<D> data)
searchback to summary
public List<D> search(String word)
searchRecursiveback to summary
private void searchRecursive(PrefixTree.Node<D> node, String word, int index, Set<D> result, Set<PrefixTree.SearchState> visited)
org.jabref.logic.journals.ltwa back to summary

private Class PrefixTree.Node<D>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Map<Integer, PrefixTree.Node<D>>
private final List<D>

Constructor Summary

AccessConstructor and Description
public
Node()

Method Summary

Modifier and TypeMethod and Description
public void
insert(String key, List<D> data)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

childrenback to summary
private final Map<Integer, PrefixTree.Node<D>> children
databack to summary
private final List<D> data

Constructor Detail

Nodeback to summary
public Node()

Method Detail

insertback to summary
public void insert(String key, List<D> data)
org.jabref.logic.journals.ltwa back to summary

private final Record PrefixTree.SearchState

extends Record
Class Inheritance
Record Components
node:PrefixTree.Node<?> 
index:int 

Field Summary

Modifier and TypeField and Description
private final int
index

Record Component accessed by index().

private final PrefixTree.Node<?>
node

Record Component accessed by node().

Constructor Summary

AccessConstructor and Description
private
SearchState(PrefixTree.Node<?> node, int index)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public int
index()

Record Component getter of index.

public PrefixTree.Node<?>
node()

Record Component getter of node.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

indexback to summary
private final int index

Record Component accessed by index().

nodeback to summary
private final PrefixTree.Node<?> node

Record Component accessed by node().

Constructor Detail

SearchStateback to summary
private SearchState(PrefixTree.Node<?> node, int index)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

indexback to summary
public int index()

Record Component getter of index.

nodeback to summary
public PrefixTree.Node<?> node()

Record Component getter of node.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.