prune

A zero-nonsense tree library for Java 8.

Лицензия

Лицензия

MIT
Группа

Группа

com.github.rutledgepaulv
Идентификатор

Идентификатор

prune
Последняя версия

Последняя версия

1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

prune
A zero-nonsense tree library for Java 8.
Ссылка на сайт

Ссылка на сайт

https://github.com/rutledgepaulv/prune
Система контроля версий

Система контроля версий

https://github.com/rutledgepaulv/prune

Скачать prune

Имя Файла Размер
prune-1.3.pom
prune-1.3.jar 10 KB
prune-1.3-sources.jar 5 KB
prune-1.3-javadoc.jar 32 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.rutledgepaulv/prune/ -->
<dependency>
    <groupId>com.github.rutledgepaulv</groupId>
    <artifactId>prune</artifactId>
    <version>1.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.rutledgepaulv/prune/
implementation 'com.github.rutledgepaulv:prune:1.3'
// https://jarcasting.com/artifacts/com.github.rutledgepaulv/prune/
implementation ("com.github.rutledgepaulv:prune:1.3")
'com.github.rutledgepaulv:prune:jar:1.3'
<dependency org="com.github.rutledgepaulv" name="prune" rev="1.3">
  <artifact name="prune" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.rutledgepaulv', module='prune', version='1.3')
)
libraryDependencies += "com.github.rutledgepaulv" % "prune" % "1.3"
[com.github.rutledgepaulv/prune "1.3"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Build Status Coverage Status Maven Central

A zero-nonsense tree library for Java 8

No dependencies. One top-level class. Depth-first and breadth-first node streaming, visiting, and searching. Prune off sections of the tree using predicate filters. ToString of a tree returns an ascii representation of the tree. Two nodes with the same data are equal. Two trees with the same structure and ordering of nodes with the same data are equal.

Usage

Tree<Integer> tree = node(1, 
                            node(2, 
                                node(5), node(5)), 
                            node(6, 
                                node(4), node(4)), 
                            node(2, 
                                node(3), node(3))).asTree();

Optional<Integer> firstIntegerGreaterThan4DepthFirst = tree.depthFirstSearch(val -> val > 4);
Optional<Integer> firstIntegerGreaterThan4BreadthFirst = tree.breadthFirstSearch(val -> val > 4);

assertTrue(firstIntegerGreaterThan4DepthFirst.isPresent());
assertTrue(firstIntegerGreaterThan4BreadthFirst.isPresent());

assertEquals((Integer) 5, firstIntegerGreaterThan4DepthFirst.get());
assertEquals((Integer) 6, firstIntegerGreaterThan4BreadthFirst.get());


System.out.println(tree);
1 -
    |
    |- 2
    |   |
    |   |- 5
    |   |
    |   |- 5
    |
    |- 6
    |   |
    |   |- 4
    |   |
    |   |- 4
    |
    |- 2
        |
        |- 3
        |
        |- 3

Install

<dependencies>
    
    <dependency>
        <groupId>com.github.rutledgepaulv</groupId>
        <artifactId>prune</artifactId>
        <version>1.3</version>
    </dependency>
            
</dependencies>

License

This project is licensed under MIT license.

Версии библиотеки

Версия
1.3
1.2
1.1
1.0