Skip to content

Commit 7a0d4ee

Browse files
author
selentd
committed
1. Updated project
2. Removed all other serialization methods and kept the default Java object serialization 3. Fixed a bug where files were being deleted without specifying the exact prefix
1 parent 792eab2 commit 7a0d4ee

33 files changed

+1884
-3797
lines changed

BigArrayList-1.3.jar

-1.58 MB
Binary file not shown.

BigArrayList-1.4.jar

17.7 KB
Binary file not shown.

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ A BigArrayList is basically an ArrayList that can handle a much larger amount of
55
1. Adding elements to the end of the list
66
2. Getting and Setting elements
77
3. Removing elements from the list
8+
4. Sorting the list
89

910
## BigArrayList Size
1011

@@ -21,13 +22,6 @@ BigArrayList uses an LRU cache replacement policy to determine which block of da
2122
All files written to disk are stored in one folder, which can be specified by the programmer. Each BigArrayList instance has its own file prefix in order to distinguish one instance from another. This is done automatically by analyzing the files in the designated folder. The first file will always be named in the form of “<memoryInstanceNumber >_memory_0.jobj", where the variable “memoryInstanceNumber” uniquely defines the instance. A loop in the program starts with this variable set to zero and will continue to loop and increment the variable until a file name does not exist. This allows for multiple BigArrayList objects to be used in a single program as well as an array of BigArrayList objects.
2223

2324

24-
## Types of serialization
25-
26-
1. Regular Object
27-
2. Memory-mapped
28-
3. [FST](https://github.com/RuedigerMoeller/fast-serialization/wiki/Serialization)
29-
4. Memory-mapped + FST
30-
3125
## Code Example
3226

3327

@@ -52,7 +46,7 @@ All files written to disk are stored in one folder, which can be specified by th
5246
System.out.println(bal.get(5));
5347
5448
//set the element at index 5
55-
bal.set(5, 100l);
49+
bal.set(5, 100L);
5650
5751
//get the element at index 5
5852
System.out.println(bal.get(5));
@@ -75,4 +69,4 @@ Some types of serialization will clear the contents on disk automatically when y
7569
You should treat storing any element retrieved from a BigArrayList as if it were a copy-by-value. The reason for this is because the content in a BigArrayList can be serialized and deserialized during any operation. Therefore, upon deserialization, a new object is created. Any old references in the program are now referencing a different object than what is being stored in the BigArrayList. If you retrieve an element from a BigArrayList and change it, make sure to save it back to the list.
7670

7771
## How to Build
78-
Import normally as a Gradle project which will handle all dependencies (current fast serialization library). The SimpleTest.java file can be run as a standard Java application to test the build.
72+
Import normally as a Gradle project. The SimpleTest.java file can be run as a standard Java application to test the build.

build.gradle

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
11

2-
apply plugin: 'java'
3-
version="1.3"
4-
5-
targetCompatibility = 1.8
6-
sourceCompatibility = 1.8
7-
8-
jar.baseName='BigArrayList'
2+
plugins {
3+
id 'java'
4+
id 'idea'
5+
}
96

107
repositories {
118
mavenCentral()
129
}
1310

14-
configurations {
15-
extraLibs
11+
test {
12+
useJUnitPlatform()
1613
}
1714

1815
dependencies {
19-
testCompile group: 'junit', name: 'junit', version: '4.4'
20-
compile group: 'de.ruedigermoeller', name: 'fst', version: '2.50'
21-
extraLibs group: 'de.ruedigermoeller', name: 'fst', version: '2.50'
22-
configurations.compile.extendsFrom(configurations.extraLibs)
16+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.3'
2317
}
2418

2519

26-
jar {
27-
from {
28-
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
29-
}
30-
}
3120

3221

3322

0 commit comments

Comments
 (0)