GithubHelp home page GithubHelp logo

m1123581e / darts-clone-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hiroshi-manabe/darts-clone-java

0.0 0.0 0.0 152 KB

A Java port of darts-clone.

License: BSD 3-Clause "New" or "Revised" License

Java 100.00%

darts-clone-java's Introduction

darts-clone-java: A Java port of darts-clone.

SYNOPSIS

A Java port of darts-clone by Susumu Yata.

USAGE

Pass an array of keys and int values to build a double array. There are some points you should be aware of:

  1. Keys should be given in byte[], not String.
  2. Keys must not contain zeros.
  3. Keys must be sorted lexically based on their unsigned values. For example, the key 0x80 should be sorted after the key 0x7f. See jp.dartsclone.DoubleArrayTest.java.
  4. If you don't need to associate values to keys, pass an array of 0 with the same length as that of keys. This way, you can save some memory. If you pass NULL, consecutive integers starting from 0 will be associated to the keys.
  5. Values should not contain negative numbers.

Caveats:

  1. "Keys must not contain zeros" means you cannot put UTF-16 string (Java String) represented in byte array.
  2. Maybe you want to use UTF-8 string represented in byte arrays. That is basically a good idea. But if you do so, be sure to sort the keys AFTER converting to UTF-8, not before. The sort order may change before converting from String and after converting to UTF-8 byte arrays.

LICENSE

BSD. See LICENSE file.

darts-clone-java's People

Contributors

hiroshi-manabe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.