darts-clone-java

Darts-Clone for Java

License

License

Categories

Categories

Java Languages Net
GroupId

GroupId

net.arnx
ArtifactId

ArtifactId

darts-clone-java
Last Version

Last Version

0.6.0
Release Date

Release Date

Type

Type

jar
Description

Description

darts-clone-java
Darts-Clone for Java
Project URL

Project URL

https://github.com/hidekatsu-izuno/darts-clone-java
Source Code Management

Source Code Management

https://github.com/hidekatsu-izuno/darts-clone-java

Download darts-clone-java

How to add to project

<!-- https://jarcasting.com/artifacts/net.arnx/darts-clone-java/ -->
<dependency>
    <groupId>net.arnx</groupId>
    <artifactId>darts-clone-java</artifactId>
    <version>0.6.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.arnx/darts-clone-java/
implementation 'net.arnx:darts-clone-java:0.6.0'
// https://jarcasting.com/artifacts/net.arnx/darts-clone-java/
implementation ("net.arnx:darts-clone-java:0.6.0")
'net.arnx:darts-clone-java:jar:0.6.0'
<dependency org="net.arnx" name="darts-clone-java" rev="0.6.0">
  <artifact name="darts-clone-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.arnx', module='darts-clone-java', version='0.6.0')
)
libraryDependencies += "net.arnx" % "darts-clone-java" % "0.6.0"
[net.arnx/darts-clone-java "0.6.0"]

Dependencies

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.2.0
org.junit.jupiter : junit-jupiter-engine jar 5.2.0

Project Modules

There are no modules declared in this project.

License Maven Central

darts-clone-java

Double-ARray Trie System clone written in Java.

This library is based on Darts Clone that known as a fast and efficient library.

Getting Started

Setup

To add a dependency using Maven, use the following:

<dependency>
  <groupId>net.arnx</groupId>
  <artifactId>darts-clone-java</artifactId>
  <version>0.6.0</version>
</dependency>

Usage

import net.arnx.dartsclone.DoubleArrayTrie;

// Build index
DoubleArrayTrie.Builder dab = new DoubleArrayTrie.Builder();
dab.put("ALGOL", 1);
dab.put("ANSI", 2);
dab.put("ARCO", 3);
dab.put("ARPA", 4);
dab.put("ARPANET", 5);
dab.put("ASCII", 6);
DoubleArrayTrie da = dab.build();

// Gets value by searching in the index
int value = da.get("ALGOL");

// Search values by searching a common prefix
IntStream values = da.findByCommonPrefix("ARPANET");

// Write the index to a file
try (OutputStream out = Files.newOutputStream(Paths.get("./index.dat"))) {
    da.writeTo(out);
}

// Read the index from the file
try (InputStream in = Files.newInputStream(Paths.get("./index.dat"))) {
    da = DoubleArrayTrie.load(in);
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Versions

Version
0.6.0