Common Datastructures

Some common datastructures

Лицензия

Лицензия

Группа

Группа

de.agentlab
Идентификатор

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

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

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

1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

Common Datastructures
Some common datastructures
Ссылка на сайт

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

http://www.agentlab.de
Система контроля версий

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

https://github.com/agent0/ds

Скачать ds

Имя Файла Размер
ds-1.3.pom
ds-1.3.jar 49 KB
ds-1.3-sources.jar 27 KB
ds-1.3-javadoc.jar 121 KB
Обзор

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

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

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
org.testng : testng jar 6.8.8

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

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

My data structures

This project is a collection of some basic data strutures that I use frequently in my projects. The data structures are taylored towards my personal needs and thus may not be universally usable.

Tree

The tree is the most advanced data structure of the collection. It is a collection container that arranges the elements in a tree-like structure. Each element can only be added to the tree once (as in a set). The elements that are managed by the container do not have to implement a particular interface or extend a given base class. Instead, the container internally wraps each element within an internal object that manages the relationships with other elements.

A tree can have multiple root nodes, thus making it effectively a forrest. Since this denomination is far less known than the term tree, I will stick with the latter term.

Table

The table data structure provides means to deal with two-dimensional mappings: each table entry consists of a row key, a column key and a value. The row and column keys are unordered, any structure on these keys has to be provided by the user.

Graph

The graph data structure reprents simple graphs that consist of nodes and edges between these nodes. Furthermore, graphs can be nested using subgraphs. The library provides some means to render graphs into different format. Currently supported formats are dot, GraphML and GEXF.

Timer

The timer is essentially not data structure but a small library to do micro-benchmarking in an application. Timer checkpoints can be nested to collect hierarchical call time data.

The following code shows a basic use case with one out timer that aggregates two inner timers.

Checkpoint outer = Timer.start("outer");

  /* code to measure */

Checkpoint inner_1 = Timer.start("inner_1");

Timer.stop(inner_1);

  /* code to measure */

Checkpoint inner_2 = Timer.start("inner_2");

Timer.stop(inner_2);

  /* code to measure */

Timer.stop(outer);

TextTableFormatter f = new TextTableFormatter();
f.print(Timer.getData());

The following table shows the output of the previous code: the columns are the name of the timer, the hit count (HC) for the timer, the elapsed total time within the timer (ET), the time spent in the children of the timer (EC) and the time spent in the timer itself (ES). Thus, we always have ET = EC + ES.

Name                          | HC   | ET      | EC      | ES      
------------------------------+------+---------+---------+---------
outer                         | 1    | 0       | 0       | 0       
  inner_1                     | 1    | 0       | 0       | 0       
  inner_2                     | 1    | 0       | 0       | 0       

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

Версия
1.3
1.2
1.1
1.0