Skip to main content

Io object collection

This is a collection of java classes to work on array, list,etc... It's used by several of my project, and therefore might by required.

  • Arrays : This is an helper call to perform actions on array of generic ; append, prepend, remove, shift, insert, concat...
  • CharBuffer : A buffer build on char primitive than can automatically grow when adding new data. Intended for IO operations.
  • ByteBuffer : Same but build around the byte primitive. Also intended for IO operations.
  • PriorityList : A sequential list whom elements shift to the beginning of the list upon request for faster access.
PriorityList

A priority list should be used when target element position's cannot be determined in advance, so a sequential iteration must be used but the deviation is narrow.
Each time a request is done for a specific element, its position change, up on the list, therefore, when doing a sequential iteration it's likely to be checked sooner. Note the element is not put directly on the top of the stack but shitfed over, according to the list configuration.
PriorityList extend "Collection". On an "Entry", object can be of any kind, you can also mix different object in the same list.

Example
Using PriorityList

This is just snippet of the full sample code on simple int


----------------  Priority list ------------------

-->  create priority list for type String 

-->  state of the list, length : 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 

 --> search for 18
recherche 18
# found en entry for 18 at index 8

-->  state of the list, length : 20
1 2 3 4 5 6 7 8 18 9 10 11 12 13 14 15 16 17 19 20 

 --> search for 89
recherche 89
# no entry found for 89

 --> search for 18
recherche 18
# found en entry for 18 at index 4

-->  state of the list, length : 20
1 2 3 4 18 5 6 7 8 9 10 11 12 13 14 15 16 17 19 20 

-->  remove from the list entry with key :6

-->  state of the list, length : 19
1 2 3 4 18 5 7 8 9 10 11 12 13 14 15 16 17 19 20 

You will find more example in the sample source code.

Install

VostokIoLib is made of a single jar weight 8.5Ko.

Download

 

 

Maven repository

A repository will be available soon

Javadocs
Licence

VostokIOLib is provided for free, for community, private or commercial work under the creative commons licence, CC-BY, no attribution needed.