Persistent data structures in Java

前端 未结 8 1305
轻奢々
轻奢々 2021-01-30 02:54

Does anyone know a library or some at least some research on creating and using persistent data structures in Java? I don\'t refer to persistence as long term storage but persis

8条回答
  •  有刺的猬
    2021-01-30 03:10

    Have a look at Functional Java. Currently provided persistent datastructures include:

    • Singly-linked list (fj.data.List)
    • Lazy singly-linked list (fj.data.Stream)
    • Nonempty list (fj.data.NonEmptyList)
    • Optional value (a container of length 0 or 1) (fj.data.Option)
    • Set (fj.data.Set)
    • Multi-way tree (a.k.a. rose tree) (fj.data.Tree)
    • Immutable map (fj.data.TreeMap)
    • Products (tuples) of arity 1-8 (fj.P1..P8)
    • Vectors of arity 2-8 (fj.data.vector.V2..V8)
    • Pointed list (fj.data.Zipper)
    • Pointed tree (fj.data.TreeZipper)
    • Type-safe, generic heterogeneous list (fj.data.hlist.HList)
    • Immutable arrays (fj.data.Array)
    • Disjoint union datatype (fj.data.Either)

    A number of usage examples are provided with the binary distribution. The source is available under a BSD license from Google Code.

提交回复
热议问题