Added getFirst/getLast/removeFirst/removeLast to lists
This commit is contained in:
parent
ed9ce60af4
commit
2da4588430
521
Changelog.md
521
Changelog.md
|
@ -1,260 +1,263 @@
|
||||||
# Changelog of versions
|
# Changelog of versions
|
||||||
|
|
||||||
### Version 0.8.0
|
### Version 0.8.0
|
||||||
- Added: ISizeProvider interface (Optimization Helper)
|
- Added: getFirst/getLast/removeFirst/removeLast to Lists
|
||||||
- Added: ISizeProvider into most Iterable implementations (Distinct/Filter/FlatMap/ArrayFlatMap don't support it, for obvious reasons)
|
|
||||||
- Added: ToArray function into Iterable which uses ISizeProvider to reduce overhead of duplicating arrays.
|
### Version 0.8.0
|
||||||
- Added: Functions that have the same type, Int2IntFunction as example, have now a identity function.
|
- Added: ISizeProvider interface (Optimization Helper)
|
||||||
- Added: Functions of a BooleanValue have now alwaysTrue/False function.
|
- Added: ISizeProvider into most Iterable implementations (Distinct/Filter/FlatMap/ArrayFlatMap don't support it, for obvious reasons)
|
||||||
- Added: ForEachIndexed for all Iterable implementations
|
- Added: ToArray function into Iterable which uses ISizeProvider to reduce overhead of duplicating arrays.
|
||||||
- Added: RandomGenerator support (Java17), though requires self compilation
|
- Added: Functions that have the same type, Int2IntFunction as example, have now a identity function.
|
||||||
- Added: Optimizations for HashUtils next power of function.
|
- Added: Functions of a BooleanValue have now alwaysTrue/False function.
|
||||||
- Added: toArray() now returns a cached empty array if the collection is empty.
|
- Added: ForEachIndexed for all Iterable implementations
|
||||||
- Added: toArray function for AsyncBuilder
|
- Added: RandomGenerator support (Java17), though requires self compilation
|
||||||
- Added: Modularization to the library where feature can be disabled as needed. (Requires Self-Compilation)
|
- Added: Optimizations for HashUtils next power of function.
|
||||||
- Fixed: putIfAbsent now replaces defaultValues
|
- Added: toArray() now returns a cached empty array if the collection is empty.
|
||||||
- Fixed: OpenHashSet/Map and their Custom Variants no longer rely on List implementations.
|
- Added: toArray function for AsyncBuilder
|
||||||
- Fixed: ObjectCopyOnWriteList.of did create a ObjectArrayList instead of the CopyOnWrite variant.
|
- Added: Modularization to the library where feature can be disabled as needed. (Requires Self-Compilation)
|
||||||
- Removed: BooleanSet and Maps that start with a Boolean classes since they can not be used anyways.
|
- Fixed: putIfAbsent now replaces defaultValues
|
||||||
- Breaking Change: Function classes now use the "apply/applyAs/test" format from Java itself, instead of the "get" format. This cleans up a lot of things. But will break existing function class implementations
|
- Fixed: OpenHashSet/Map and their Custom Variants no longer rely on List implementations.
|
||||||
- Breaking Change: Classes that used PrimitiveCollection functions now default to java functions where applicable, this is to increase compat.
|
- Fixed: ObjectCopyOnWriteList.of did create a ObjectArrayList instead of the CopyOnWrite variant.
|
||||||
- Breaking Change: Some function classes now get closer to javas terms. (Predicate/UnaryOperator etc)
|
- Removed: BooleanSet and Maps that start with a Boolean classes since they can not be used anyways.
|
||||||
|
- Breaking Change: Function classes now use the "apply/applyAs/test" format from Java itself, instead of the "get" format. This cleans up a lot of things. But will break existing function class implementations
|
||||||
### Version 0.7.0
|
- Breaking Change: Classes that used PrimitiveCollection functions now default to java functions where applicable, this is to increase compat.
|
||||||
- Added: Over 11 Million Unit Tests to this library to ensure quality.
|
- Breaking Change: Some function classes now get closer to javas terms. (Predicate/UnaryOperator etc)
|
||||||
- Added: ArrayList size constructor now throws IllegalStateException if the size parameter is negative
|
|
||||||
- Added: EnumMap specialized forEach implementation.
|
### Version 0.7.0
|
||||||
- Added: AbstractMap.remove now delegates to its primitive counterpart.
|
- Added: Over 11 Million Unit Tests to this library to ensure quality.
|
||||||
- Added: ConcurrentHashMap now implements ITrimmable
|
- Added: ArrayList size constructor now throws IllegalStateException if the size parameter is negative
|
||||||
- Refactor: Removed a lot of disabled code from ArraySet.
|
- Added: EnumMap specialized forEach implementation.
|
||||||
- Removed: LinkedList.addAll(index, List) now delegates to LinkedList.addAll(index, Collection) due to no special optimization required.
|
- Added: AbstractMap.remove now delegates to its primitive counterpart.
|
||||||
- Fixed: AbstractList.SubList.get/set/swapRemove didn't calculate their List index Properly
|
- Added: ConcurrentHashMap now implements ITrimmable
|
||||||
- Fixed: AbstractList.SubList chains now properly if you create SubLists within SubLists.
|
- Refactor: Removed a lot of disabled code from ArraySet.
|
||||||
- Fixed: AbstractList.Iterator.add now respects Immutable/UnmodifiableLists.
|
- Removed: LinkedList.addAll(index, List) now delegates to LinkedList.addAll(index, Collection) due to no special optimization required.
|
||||||
- Fixed: AbstractList.Iterator.skip/back now keep track of the last returned value for remove function to work properly.
|
- Fixed: AbstractList.SubList.get/set/swapRemove didn't calculate their List index Properly
|
||||||
- Fixed: CopyOnWriteArrayList.extract/removeElements(int, int) does now proper range checks and remove elements properly.
|
- Fixed: AbstractList.SubList chains now properly if you create SubLists within SubLists.
|
||||||
- Fixed: CopyOnWriteArrayList.SubList now works properly. (Reimplemented entirely)
|
- Fixed: AbstractList.Iterator.add now respects Immutable/UnmodifiableLists.
|
||||||
- Fixed: CopyOnWriteArrayList.Iterator.previous() was returning the wrong values.
|
- Fixed: AbstractList.Iterator.skip/back now keep track of the last returned value for remove function to work properly.
|
||||||
- Fixed: CopyOnWriteArrayList.Iterator.skip now skips the right amount of elements and stops where it should.
|
- Fixed: CopyOnWriteArrayList.extract/removeElements(int, int) does now proper range checks and remove elements properly.
|
||||||
- Fixed: LinkedList.first/last/dequeue/dequeueLast now throws NoSuchElementException when empty instead of IllegalStateException.
|
- Fixed: CopyOnWriteArrayList.SubList now works properly. (Reimplemented entirely)
|
||||||
- Fixed: LinkedList had an edge case where the entire reverse iterator would break if the wrong element was removed.
|
- Fixed: CopyOnWriteArrayList.Iterator.previous() was returning the wrong values.
|
||||||
- Fixed: LinkedList.extractElement now returns the correct values.
|
- Fixed: CopyOnWriteArrayList.Iterator.skip now skips the right amount of elements and stops where it should.
|
||||||
- Fixed: AbstractMap.entrySet().remove(Object) now returns true if defaultReturnValue elements were removed.
|
- Fixed: LinkedList.first/last/dequeue/dequeueLast now throws NoSuchElementException when empty instead of IllegalStateException.
|
||||||
- Fixed: ConcurrentHashMap.remove(Object, Object) checks if the type matches before comparing against null Values.
|
- Fixed: LinkedList had an edge case where the entire reverse iterator would break if the wrong element was removed.
|
||||||
- Fixed: LinkedHashMap.clearAndTrim() was checking the wrong value for determining the full reset or clearing of a Map.
|
- Fixed: LinkedList.extractElement now returns the correct values.
|
||||||
- Fixed: HashMap.trim/clearToTrim() was using the wrong value to determin if something should be done.
|
- Fixed: AbstractMap.entrySet().remove(Object) now returns true if defaultReturnValue elements were removed.
|
||||||
- Fixed: HashMap now compares empty values (0) against nullKeys when Object Variants of the type are used.
|
- Fixed: ConcurrentHashMap.remove(Object, Object) checks if the type matches before comparing against null Values.
|
||||||
- Fixed: ImmutableMap now compares empty values (0) against nullKeys when Object Variants of the type are used.
|
- Fixed: LinkedHashMap.clearAndTrim() was checking the wrong value for determining the full reset or clearing of a Map.
|
||||||
- Fixed: ArrayMap.iterator(key) now throws NoSuchElementException when the element wasn't found.
|
- Fixed: HashMap.trim/clearToTrim() was using the wrong value to determin if something should be done.
|
||||||
- Fixed: Linked/EnumMap array constructor was creating the wrong size values array.
|
- Fixed: HashMap now compares empty values (0) against nullKeys when Object Variants of the type are used.
|
||||||
- Fixed: LinkedEnumMap.getAndMoveToFirst/Last was moving elements even if the element wasn't present.
|
- Fixed: ImmutableMap now compares empty values (0) against nullKeys when Object Variants of the type are used.
|
||||||
- Fixed: AVL/RBTreeMap.getFirst/LastKey was not throwing a NoSuchElementException if the map was empty.
|
- Fixed: ArrayMap.iterator(key) now throws NoSuchElementException when the element wasn't found.
|
||||||
- Fixed: Map.Builder wasn't throwing a IllegalStateException when creating a negative size builder.
|
- Fixed: Linked/EnumMap array constructor was creating the wrong size values array.
|
||||||
- Fixed: AVL/RBTreeSet.DecendingSet.subSet(from, fromInclusive, to, toInclusive) was creating a corrupt asending subset.
|
- Fixed: LinkedEnumMap.getAndMoveToFirst/Last was moving elements even if the element wasn't present.
|
||||||
- Fixed: ArraySet throws now a IllegalStateException when trying to create it with a negative size.
|
- Fixed: AVL/RBTreeMap.getFirst/LastKey was not throwing a NoSuchElementException if the map was empty.
|
||||||
- Fixed: ArraySet.addMoveToLast(key) was crashing when a key was already present.
|
- Fixed: Map.Builder wasn't throwing a IllegalStateException when creating a negative size builder.
|
||||||
- Fixed: Immutable/LinkedHashSet now keep track of their iteration index properly.
|
- Fixed: AVL/RBTreeSet.DecendingSet.subSet(from, fromInclusive, to, toInclusive) was creating a corrupt asending subset.
|
||||||
- Fixed: LinkedHashSet.moveToFirst/Last(key) would crash if the Set was empty.
|
- Fixed: ArraySet throws now a IllegalStateException when trying to create it with a negative size.
|
||||||
- Fixed: LinkedHashSet.clearAndTrim() was checking the wrong value for determining the full reset or clearing of a Map.
|
- Fixed: ArraySet.addMoveToLast(key) was crashing when a key was already present.
|
||||||
- Fixed: HashSet.trim/clearToTrim() was using the wrong value to determin if something should be done.
|
- Fixed: Immutable/LinkedHashSet now keep track of their iteration index properly.
|
||||||
|
- Fixed: LinkedHashSet.moveToFirst/Last(key) would crash if the Set was empty.
|
||||||
|
- Fixed: LinkedHashSet.clearAndTrim() was checking the wrong value for determining the full reset or clearing of a Map.
|
||||||
### Version 0.6.2
|
- Fixed: HashSet.trim/clearToTrim() was using the wrong value to determin if something should be done.
|
||||||
- Added: Array only sorting function return the inputed array. This was done to allow for static final references to use the method in one go without having to make lambda wrappers. Cleaner code.
|
|
||||||
- Added: Iterator Wrappers are now a bit more in Compliance with Java Standards.
|
|
||||||
- Added: AsyncBuilders now Support Array Inputs to create cleaner code.
|
### Version 0.6.2
|
||||||
- Changed: LinkedList.addBulk variable definition was triggering a false positive.
|
- Added: Array only sorting function return the inputed array. This was done to allow for static final references to use the method in one go without having to make lambda wrappers. Cleaner code.
|
||||||
- Fixed: TreeMap.subMap().entrySet().remove() wouldn't check primitives properly.
|
- Added: Iterator Wrappers are now a bit more in Compliance with Java Standards.
|
||||||
- Fixed: SortedMap.sub/tail/headMap were looping into themselves.
|
- Added: AsyncBuilders now Support Array Inputs to create cleaner code.
|
||||||
- Fixed: AbstractCollection.retainAll didn't push removed values through the consumer.
|
- Changed: LinkedList.addBulk variable definition was triggering a false positive.
|
||||||
- Fixed: AbstractCollection.toArray wouldn't reset the last entry if the input array was larger then the elements in the collection.
|
- Fixed: TreeMap.subMap().entrySet().remove() wouldn't check primitives properly.
|
||||||
- Fixed: SubList didn't check for ranges properly or didn't use parent list to validate changes.
|
- Fixed: SortedMap.sub/tail/headMap were looping into themselves.
|
||||||
- Fixed: ArrayList.addElements didn't check input array fully and used the wrong variable to move the elements around.
|
- Fixed: AbstractCollection.retainAll didn't push removed values through the consumer.
|
||||||
- Fixed: LinkedList.addElements(EmptyInput) would crash.
|
- Fixed: AbstractCollection.toArray wouldn't reset the last entry if the input array was larger then the elements in the collection.
|
||||||
- Fixed: LinkedList.swapRemove didn't account for if the removed element was the prelast one.
|
- Fixed: SubList didn't check for ranges properly or didn't use parent list to validate changes.
|
||||||
- Fixed: LinkedList.removeElements would break the implementation if the list was almost empty and the middle element was removed.
|
- Fixed: ArrayList.addElements didn't check input array fully and used the wrong variable to move the elements around.
|
||||||
- Fixed: LinkedHashSet.addAndMoveToFirst wouldn't move elements to the first place.
|
- Fixed: LinkedList.addElements(EmptyInput) would crash.
|
||||||
- Fixed: ArrayList/LinkedList extractElements crashing when 0 or less elements are desired.
|
- Fixed: LinkedList.swapRemove didn't account for if the removed element was the prelast one.
|
||||||
- Fixed: TreeMap pollFirst/LastKey should return the defaultMin/max value instead of a Empty value.
|
- Fixed: LinkedList.removeElements would break the implementation if the list was almost empty and the middle element was removed.
|
||||||
- Fixed: TreeMap keySet implementation was missing the class type implementations to pass keySet tests.
|
- Fixed: LinkedHashSet.addAndMoveToFirst wouldn't move elements to the first place.
|
||||||
- Fixed: TreeMap.SubMap Iterator (primitive Keys) was crashing because a Null was set on to a primitive.
|
- Fixed: ArrayList/LinkedList extractElements crashing when 0 or less elements are desired.
|
||||||
|
- Fixed: TreeMap pollFirst/LastKey should return the defaultMin/max value instead of a Empty value.
|
||||||
|
- Fixed: TreeMap keySet implementation was missing the class type implementations to pass keySet tests.
|
||||||
### Version 0.6.1
|
- Fixed: TreeMap.SubMap Iterator (primitive Keys) was crashing because a Null was set on to a primitive.
|
||||||
- Fixed: FIFO queue crashing when the last index is before the first index when peek is called.
|
|
||||||
- Fixed: FIFO queue only clears the array if it was in use.
|
|
||||||
- Added: Sorted Method for the stream replacing functions.
|
### Version 0.6.1
|
||||||
|
- Fixed: FIFO queue crashing when the last index is before the first index when peek is called.
|
||||||
### Version 0.6.0
|
- Fixed: FIFO queue only clears the array if it was in use.
|
||||||
- Added: addOrGet for sets.
|
- Added: Sorted Method for the stream replacing functions.
|
||||||
- Added: Async API which allows to easily execute Iterables/Collections offthread without the complexity.
|
|
||||||
- Added: CopyOnWriteArrayList and tests for it
|
### Version 0.6.0
|
||||||
- Added: Support up to Java17.
|
- Added: addOrGet for sets.
|
||||||
- Added: Build System now adds module-info if the Running JVM is 9 or higher
|
- Added: Async API which allows to easily execute Iterables/Collections offthread without the complexity.
|
||||||
- Added: ArrayList.of(Class, size) that allows you to allocate a size right at the creation of the List without having to create a wrapper array.
|
- Added: CopyOnWriteArrayList and tests for it
|
||||||
- Added: A ConcurrentHashMap implementation.
|
- Added: Support up to Java17.
|
||||||
- Fixed: containsValue in the HashMap wouldn't check the nullKey
|
- Added: Build System now adds module-info if the Running JVM is 9 or higher
|
||||||
- Removed: Deprecated functions from SortedMaps/Sets
|
- Added: ArrayList.of(Class, size) that allows you to allocate a size right at the creation of the List without having to create a wrapper array.
|
||||||
|
- Added: A ConcurrentHashMap implementation.
|
||||||
### Version 0.5.3
|
- Fixed: containsValue in the HashMap wouldn't check the nullKey
|
||||||
- Added: OrderedMap/Set
|
- Removed: Deprecated functions from SortedMaps/Sets
|
||||||
- Added: Deprecation to Functions that are specific to Ordered interfaces in the SortedMap/Set
|
|
||||||
- Added: subFrom to Maps which is the counterpart of the addTo method
|
### Version 0.5.3
|
||||||
- Added: pourAsList and pourAsSet (booleans excluded for sets) to Iterable
|
- Added: OrderedMap/Set
|
||||||
- Fixed: ArrayList.grow had a small bug where it would trigger to early causing performance problems with exact sized collections.
|
- Added: Deprecation to Functions that are specific to Ordered interfaces in the SortedMap/Set
|
||||||
- Fixed: FIFOQueue size constructor had a small bug where it would trigger a array enlargement when all elements were inserted.
|
- Added: subFrom to Maps which is the counterpart of the addTo method
|
||||||
|
- Added: pourAsList and pourAsSet (booleans excluded for sets) to Iterable
|
||||||
### Version 0.5.2
|
- Fixed: ArrayList.grow had a small bug where it would trigger to early causing performance problems with exact sized collections.
|
||||||
- Fixed: Bugs with Queues starting with the wrong size
|
- Fixed: FIFOQueue size constructor had a small bug where it would trigger a array enlargement when all elements were inserted.
|
||||||
- Fixed: ArrayGrowth for Queues was +1 instead of +50%
|
|
||||||
- Added: Benchmarks with java and FastUtil
|
### Version 0.5.2
|
||||||
|
- Fixed: Bugs with Queues starting with the wrong size
|
||||||
### Version 0.5.1
|
- Fixed: ArrayGrowth for Queues was +1 instead of +50%
|
||||||
- Fixed: Reworked the NavigableSet/Map implementations of RBTree/AVLTree/Array Sets/Maps so they are now deemed stable.
|
- Added: Benchmarks with java and FastUtil
|
||||||
- Added: Another 150k Unit tests.
|
|
||||||
- Added: List and Set Unit tests for Integer (or Primitives in this case) to ensure basic stability there. (Now covering all sets and lists)
|
### Version 0.5.1
|
||||||
- Fixed: Bugs with null values for primitive collections.
|
- Fixed: Reworked the NavigableSet/Map implementations of RBTree/AVLTree/Array Sets/Maps so they are now deemed stable.
|
||||||
- Removed: ArraySet/Map subSet/subMap implementation was removed.
|
- Added: Another 150k Unit tests.
|
||||||
|
- Added: List and Set Unit tests for Integer (or Primitives in this case) to ensure basic stability there. (Now covering all sets and lists)
|
||||||
### Version 0.5.0
|
- Fixed: Bugs with null values for primitive collections.
|
||||||
- Added: 2 Helper functions to find out how many bits are required to store a Number.
|
- Removed: ArraySet/Map subSet/subMap implementation was removed.
|
||||||
- Added: pour function directly into Iterable which allows to collect all elements in the Iterable directly.
|
|
||||||
- Added: The new ToArray method from Java9 and newer into the library. Using a functional interface. (Just a backport)
|
### Version 0.5.0
|
||||||
- Changed: Reworked how the Map Builder functions are created. They are now in a SubClass that moves them out of the way. Less Clutter. (This might break things if that was used before)
|
- Added: 2 Helper functions to find out how many bits are required to store a Number.
|
||||||
- Added: Map Builder that allows now to Build Maps like Guava ImmutableMaps can be build. Note: This has a slight performance overhead.
|
- Added: pour function directly into Iterable which allows to collect all elements in the Iterable directly.
|
||||||
- Added: Unmodifiable and Synchronize wrapper functions direclty into Collection Interfaces. This is mostly a quality of life thing.
|
- Added: The new ToArray method from Java9 and newer into the library. Using a functional interface. (Just a backport)
|
||||||
- Added: Unmodifiable and Synchronized Wrapper Collections can now be cloned. They clone the underlying map which doesn't break functionality. (Had a usecase for it)
|
- Changed: Reworked how the Map Builder functions are created. They are now in a SubClass that moves them out of the way. Less Clutter. (This might break things if that was used before)
|
||||||
- Added: A boxed putAll array variant.
|
- Added: Map Builder that allows now to Build Maps like Guava ImmutableMaps can be build. Note: This has a slight performance overhead.
|
||||||
- Fixed: EnumMaps didn't keep track of their size and now got proper care and implementations as needed. There might be more work required but at least the core functionality is now up to date.
|
- Added: Unmodifiable and Synchronize wrapper functions direclty into Collection Interfaces. This is mostly a quality of life thing.
|
||||||
- Added: Tests for the new Stream replace functions to ensure no bugs are left.
|
- Added: Unmodifiable and Synchronized Wrapper Collections can now be cloned. They clone the underlying map which doesn't break functionality. (Had a usecase for it)
|
||||||
- Fixed: Custom HashSet reduce function with a default value was checking incorrectly for present keys.
|
- Added: A boxed putAll array variant.
|
||||||
- Added: Guava TestSuit
|
- Fixed: EnumMaps didn't keep track of their size and now got proper care and implementations as needed. There might be more work required but at least the core functionality is now up to date.
|
||||||
- Fixed: HashCode and toString method would crash if the Object Key/Value was null
|
- Added: Tests for the new Stream replace functions to ensure no bugs are left.
|
||||||
- Added: AbstractTypeCollection now delegates the contains check to type-specific Collections if it detects it.
|
- Fixed: Custom HashSet reduce function with a default value was checking incorrectly for present keys.
|
||||||
- Fixed: Map.Entry toString wasn't writing values not like it should do.
|
- Added: Guava TestSuit
|
||||||
- Fixed: Set.hashCode now is the sum of the elements instead of a Unique HashCode based on the elements.
|
- Fixed: HashCode and toString method would crash if the Object Key/Value was null
|
||||||
- Fixed: Added missing NonNull Checks.
|
- Added: AbstractTypeCollection now delegates the contains check to type-specific Collections if it detects it.
|
||||||
- Fixed: Custom/OpenHashMap.containsValue implementation was wrong.
|
- Fixed: Map.Entry toString wasn't writing values not like it should do.
|
||||||
- Fixed: Custom/OpenHashMap.compute/present/absent now works how it is specified in the Java Documentation
|
- Fixed: Set.hashCode now is the sum of the elements instead of a Unique HashCode based on the elements.
|
||||||
- Fixed: Custom/OpenHashMap.merge/BulkMerge now works how it is specified in the Java Documentation
|
- Fixed: Added missing NonNull Checks.
|
||||||
- Fixed: Custom/Linked/OpenHashMap.keySet.remove was causing a infinite loop.
|
- Fixed: Custom/OpenHashMap.containsValue implementation was wrong.
|
||||||
- Fixed: Custom/Linked/OpenHashMap.entrySet.contains was not correctly comparing the entry.
|
- Fixed: Custom/OpenHashMap.compute/present/absent now works how it is specified in the Java Documentation
|
||||||
- Fixed: Custom/OpenHashMap.mapIterator now no longer crashes in certain cases.
|
- Fixed: Custom/OpenHashMap.merge/BulkMerge now works how it is specified in the Java Documentation
|
||||||
- Added: Custom/LinkedOpenHashMap now takes use of the improved Iterator it has for containsValue
|
- Fixed: Custom/Linked/OpenHashMap.keySet.remove was causing a infinite loop.
|
||||||
- Fixed: CustomOpenHashMap.keySet.forEach was basically putting out keys even if they were present
|
- Fixed: Custom/Linked/OpenHashMap.entrySet.contains was not correctly comparing the entry.
|
||||||
- Fixed: ImmutableMaps issues thanks to the tests. Roughly the same as the rest of the maps
|
- Fixed: Custom/OpenHashMap.mapIterator now no longer crashes in certain cases.
|
||||||
- Fixed: RB/AVLTreeMaps issues. Roughly the same as the rest of the maps
|
- Added: Custom/LinkedOpenHashMap now takes use of the improved Iterator it has for containsValue
|
||||||
- Fixed: SubLists are now properly implemented.
|
- Fixed: CustomOpenHashMap.keySet.forEach was basically putting out keys even if they were present
|
||||||
- Fixed: HashSet Iterator bugs now fixed... That was Painful.
|
- Fixed: ImmutableMaps issues thanks to the tests. Roughly the same as the rest of the maps
|
||||||
- Added: Tests for Lists and Sets
|
- Fixed: RB/AVLTreeMaps issues. Roughly the same as the rest of the maps
|
||||||
|
- Fixed: SubLists are now properly implemented.
|
||||||
### Version 0.4.5
|
- Fixed: HashSet Iterator bugs now fixed... That was Painful.
|
||||||
- Added: removeAll/retainAll(Collection c, Consumer r) which receives all the elements that got deleted from the collection
|
- Added: Tests for Lists and Sets
|
||||||
- Fixed: Supplier get function wasn't referencing original function.
|
|
||||||
- Added: addIfPresent/Absent to lists
|
### Version 0.4.5
|
||||||
- Added: distinct, limit and peek iterators
|
- Added: removeAll/retainAll(Collection c, Consumer r) which receives all the elements that got deleted from the collection
|
||||||
- Added: Iterable's can now reduce its contents
|
- Fixed: Supplier get function wasn't referencing original function.
|
||||||
- Added: Better ForEach support for IterableWrappers so a Iterator chain is not created
|
- Added: addIfPresent/Absent to lists
|
||||||
- Added: SwapRemove to Lists which moves the last element into the desired space to be deleted
|
- Added: distinct, limit and peek iterators
|
||||||
- Added: More Test cases
|
- Added: Iterable's can now reduce its contents
|
||||||
|
- Added: Better ForEach support for IterableWrappers so a Iterator chain is not created
|
||||||
### Version 0.4.4
|
- Added: SwapRemove to Lists which moves the last element into the desired space to be deleted
|
||||||
- Fixed: ObjectArrayList.of was causing crashes because of a Poor implementation.
|
- Added: More Test cases
|
||||||
- Added: Unsorted HashMaps/Sets now throw Concurrent exceptions if they were modified during a rehash.
|
|
||||||
- Added: Array/Collection version of enqueue and enqueueFirst to PriorityQueues.
|
### Version 0.4.4
|
||||||
- Added: fillBuffer function into PrimitiveLists which allow to optimize JavaNio buffers if needed.
|
- Fixed: ObjectArrayList.of was causing crashes because of a Poor implementation.
|
||||||
|
- Added: Unsorted HashMaps/Sets now throw Concurrent exceptions if they were modified during a rehash.
|
||||||
### Version 0.4.3
|
- Added: Array/Collection version of enqueue and enqueueFirst to PriorityQueues.
|
||||||
- Added: Wrapper now support the Optimized Lambda replacer functions to improve performance.
|
- Added: fillBuffer function into PrimitiveLists which allow to optimize JavaNio buffers if needed.
|
||||||
- Added: FIFO Queue has now a minimum capacity and that is now checked more consistently.
|
|
||||||
|
### Version 0.4.3
|
||||||
### Version 0.4.2
|
- Added: Wrapper now support the Optimized Lambda replacer functions to improve performance.
|
||||||
- Added: Lists/Sets/Maps/PriorityQueues are now copy-able. with the new copy() function.
|
- Added: FIFO Queue has now a minimum capacity and that is now checked more consistently.
|
||||||
Note: subLists/subMaps/subSets or synchronize/unmodifyable wrappers do not support that function.
|
|
||||||
- Fixed: PriorityQueues didn't implement: hashCode/equals/toString
|
### Version 0.4.2
|
||||||
|
- Added: Lists/Sets/Maps/PriorityQueues are now copy-able. with the new copy() function.
|
||||||
### Version 0.4.1
|
Note: subLists/subMaps/subSets or synchronize/unmodifyable wrappers do not support that function.
|
||||||
- Changed: ForEach with input now provides input, value instead of value, input, this improves the usage of method references greatly
|
- Fixed: PriorityQueues didn't implement: hashCode/equals/toString
|
||||||
- Added: addAll with Array-types in collections.
|
|
||||||
- Added: Java Iterator/Iterable support for Stream replacing methods
|
### Version 0.4.1
|
||||||
- Added: Suppliers.
|
- Changed: ForEach with input now provides input, value instead of value, input, this improves the usage of method references greatly
|
||||||
- Added: SupplyIfAbsent. It is ComputeIfAbsent but using suppliers
|
- Added: addAll with Array-types in collections.
|
||||||
- Added: Count feature into Iterable
|
- Added: Java Iterator/Iterable support for Stream replacing methods
|
||||||
- Fixed: A couple bugs with the new StreamReplacing functions in LinkedCollections Iterating to Infinity
|
- Added: Suppliers.
|
||||||
|
- Added: SupplyIfAbsent. It is ComputeIfAbsent but using suppliers
|
||||||
### Version 0.4.0
|
- Added: Count feature into Iterable
|
||||||
- Changed: Iterable specific helper functions were moved out of Iterators and moved into Iterables
|
- Fixed: A couple bugs with the new StreamReplacing functions in LinkedCollections Iterating to Infinity
|
||||||
- Added: New Stream replacing functions: findFirst, matchesAny/All/None
|
|
||||||
- Fixed: Compute/ComputeIfAbsent/ComputeIfPresent/Merge/BulkMerge in maps now behave like they should.
|
### Version 0.4.0
|
||||||
- Added: Implementations for New Stream replacing functions.
|
- Changed: Iterable specific helper functions were moved out of Iterators and moved into Iterables
|
||||||
- Changed: Removed a lot of duplicated forEach implementations
|
- Added: New Stream replacing functions: findFirst, matchesAny/All/None
|
||||||
- Added: Flat/Mapping functions (to object) are now accessible to primitive maps.
|
- Fixed: Compute/ComputeIfAbsent/ComputeIfPresent/Merge/BulkMerge in maps now behave like they should.
|
||||||
- Added: Filter function to Iterators/Iterables (Iterable implements it by default)
|
- Added: Implementations for New Stream replacing functions.
|
||||||
- Changed: Cleanup of some variables/mappers
|
- Changed: Removed a lot of duplicated forEach implementations
|
||||||
- Added/Fixed: AVL/RBTreeMap got reworked and SubMaps work more properly now. Also forEach support got improved a lot
|
- Added: Flat/Mapping functions (to object) are now accessible to primitive maps.
|
||||||
- Added/Fixed: TreeSubSets (RB/AVL) got their functional implementations improved too.
|
- Added: Filter function to Iterators/Iterables (Iterable implements it by default)
|
||||||
- Added: Pairs are now a thing. In Mutable/Immutable Form
|
- Changed: Cleanup of some variables/mappers
|
||||||
|
- Added/Fixed: AVL/RBTreeMap got reworked and SubMaps work more properly now. Also forEach support got improved a lot
|
||||||
### Version 0.3.6
|
- Added/Fixed: TreeSubSets (RB/AVL) got their functional implementations improved too.
|
||||||
- Fixed: addAll non Type Specific Lists was causing crashes.
|
- Added: Pairs are now a thing. In Mutable/Immutable Form
|
||||||
- Fixed/Changed: clearAndTrim's implementation was all over the place. In some cases causing crash scenarios.
|
|
||||||
- Fixed: Wrappers didn't implement toString/equals/hashCode
|
### Version 0.3.6
|
||||||
- Added: Tests for addAll Bug
|
- Fixed: addAll non Type Specific Lists was causing crashes.
|
||||||
- Changed: Cleaned up CodeStyle as bugs were fixed.
|
- Fixed/Changed: clearAndTrim's implementation was all over the place. In some cases causing crash scenarios.
|
||||||
|
- Fixed: Wrappers didn't implement toString/equals/hashCode
|
||||||
### Version 0.3.5
|
- Added: Tests for addAll Bug
|
||||||
- Fixed: Simple Code Generator dependency was declared wrong. Its only needed for runtime. Not for Compilation.
|
- Changed: Cleaned up CodeStyle as bugs were fixed.
|
||||||
- Fixed: ObjectLists Crashed when a null was provided as a Comparator. (Unless the List was Initialized with the ClassType)
|
|
||||||
- Fixed: LinkedLists didn't implement add(Object)
|
### Version 0.3.5
|
||||||
- Fixed: Object Collections did have the JavaCollections deprecated as the Constructor. This should only be deprecated for Primitives
|
- Fixed: Simple Code Generator dependency was declared wrong. Its only needed for runtime. Not for Compilation.
|
||||||
- Added: Tests with 5k Random names for Object sorting.
|
- Fixed: ObjectLists Crashed when a null was provided as a Comparator. (Unless the List was Initialized with the ClassType)
|
||||||
- Changed: Object Arrays no longer require a Comparable[] it just assumes now that the elements in the Array are Comparable
|
- Fixed: LinkedLists didn't implement add(Object)
|
||||||
- Fixed: Dependency to SimpleCodeGenerator should be no longer a thing. Because the resulting library doesn't need it only the builder does.
|
- Fixed: Object Collections did have the JavaCollections deprecated as the Constructor. This should only be deprecated for Primitives
|
||||||
|
- Added: Tests with 5k Random names for Object sorting.
|
||||||
### Version 0.3.4
|
- Changed: Object Arrays no longer require a Comparable[] it just assumes now that the elements in the Array are Comparable
|
||||||
- Fixed: ArrayLists didn't resize properly if they were empty.
|
- Fixed: Dependency to SimpleCodeGenerator should be no longer a thing. Because the resulting library doesn't need it only the builder does.
|
||||||
|
|
||||||
|
### Version 0.3.4
|
||||||
### Version 0.3.3
|
- Fixed: ArrayLists didn't resize properly if they were empty.
|
||||||
- Added: Flat/Mapping function for Iterables/Iterators to help avoid streams for cleaner looking code
|
|
||||||
- Fixed: AVLTrees pollFirst/Last is now keeping orders and is fixed
|
|
||||||
- Fixed: AbstractCollection bulk adding methods now link to the specialized implementations.
|
### Version 0.3.3
|
||||||
- Fixed: A bug with getElements in ArrayList.
|
- Added: Flat/Mapping function for Iterables/Iterators to help avoid streams for cleaner looking code
|
||||||
- Fixed: PriorityQueue remove/toArray function were renamed so they fit better with other interfaces. (remove => removeFirst and toArray uses a different genericType)
|
- Fixed: AVLTrees pollFirst/Last is now keeping orders and is fixed
|
||||||
- Added: LinkedList which is a List/PriorityDequeue/Stack which allows for more optimized use-cases and reduced boxing/unboxing.
|
- Fixed: AbstractCollection bulk adding methods now link to the specialized implementations.
|
||||||
- Added: Tests for LinkedList
|
- Fixed: A bug with getElements in ArrayList.
|
||||||
|
- Fixed: PriorityQueue remove/toArray function were renamed so they fit better with other interfaces. (remove => removeFirst and toArray uses a different genericType)
|
||||||
### Version 0.3.2
|
- Added: LinkedList which is a List/PriorityDequeue/Stack which allows for more optimized use-cases and reduced boxing/unboxing.
|
||||||
- Fixed: Map.put wasn't referring to primitive variants.
|
- Added: Tests for LinkedList
|
||||||
- Added: ImmutableList.
|
|
||||||
- Added: Iterator pour function into a List or Array
|
### Version 0.3.2
|
||||||
- Changed: Arrays Wrap is now accessible to Objects and now is ? extends TYPE instead of TYPE.
|
- Fixed: Map.put wasn't referring to primitive variants.
|
||||||
- Added: OpenHashSets now implement foreach and have less overhead.
|
- Added: ImmutableList.
|
||||||
- Added: ImmutableOpenHashSet that is not editable (is linked by default for fast iteration)
|
- Added: Iterator pour function into a List or Array
|
||||||
- Added: CustomOpenHashSets now implement foreach and have less overhead.
|
- Changed: Arrays Wrap is now accessible to Objects and now is ? extends TYPE instead of TYPE.
|
||||||
- Added: ImmutableOpenHashMap that is not editable (is linked by default for fast iteration)
|
- Added: OpenHashSets now implement foreach and have less overhead.
|
||||||
- Added: Maps can now be created through the interface.
|
- Added: ImmutableOpenHashSet that is not editable (is linked by default for fast iteration)
|
||||||
- Fixed: Lists.addElements(T...elements) was adding elements at the beginning of a list instead of the end.
|
- Added: CustomOpenHashSets now implement foreach and have less overhead.
|
||||||
- Fixed: Bugs with the AVLTreeSet. And marked bugs with AVLTreeX that are still present.
|
- Added: ImmutableOpenHashMap that is not editable (is linked by default for fast iteration)
|
||||||
|
- Added: Maps can now be created through the interface.
|
||||||
### Version 0.3.1
|
- Fixed: Lists.addElements(T...elements) was adding elements at the beginning of a list instead of the end.
|
||||||
- Fixed: containsKey & containsValue in HashMaps were deprecated for Object Variants.
|
- Fixed: Bugs with the AVLTreeSet. And marked bugs with AVLTreeX that are still present.
|
||||||
- Fixed: HashMap wasn't deleting Keys & Values references when removing a Object
|
|
||||||
- Fixed: AVLTreeMap didn't balance properly.
|
### Version 0.3.1
|
||||||
- Changed: EnumMap no longer tries to access SharedSecrets since its gone in java11
|
- Fixed: containsKey & containsValue in HashMaps were deprecated for Object Variants.
|
||||||
- Added: HashMaps now implement ITrimmable
|
- Fixed: HashMap wasn't deleting Keys & Values references when removing a Object
|
||||||
- Added: AVLTreeSet didn't balance properly
|
- Fixed: AVLTreeMap didn't balance properly.
|
||||||
- Fixed: HashMaps & LinkedMaps weren't clearing references properly.
|
- Changed: EnumMap no longer tries to access SharedSecrets since its gone in java11
|
||||||
|
- Added: HashMaps now implement ITrimmable
|
||||||
### Version 0.3.0 (Breaking 0.2.0)
|
- Added: AVLTreeSet didn't balance properly
|
||||||
- Added: Stack.isEmpty was missing
|
- Fixed: HashMaps & LinkedMaps weren't clearing references properly.
|
||||||
- Changed: remove/removeLast/enqueue/enqueueFirst no longer use Type Suffixes
|
|
||||||
- Removed: Suffixes for unmodifiable & synchronize functions.
|
### Version 0.3.0 (Breaking 0.2.0)
|
||||||
- Changed: Primitive Stacks no longer depend on the base Stack class. Because seriously not needed.
|
- Added: Stack.isEmpty was missing
|
||||||
- Changed: PriorityQueues no longer extends Object Variant.
|
- Changed: remove/removeLast/enqueue/enqueueFirst no longer use Type Suffixes
|
||||||
- Changed: Maps.get function is no longer using Suffixes unless its absolutely necessary.
|
- Removed: Suffixes for unmodifiable & synchronize functions.
|
||||||
- Changed: Maps.remove function is no longer using Suffixes unless its absolutely necessary.
|
- Changed: Primitive Stacks no longer depend on the base Stack class. Because seriously not needed.
|
||||||
- Changed: ObjectList methods are no longer marked Deprecated even so it was for primitive ones.
|
- Changed: PriorityQueues no longer extends Object Variant.
|
||||||
- Added: Shuffle & Reverse Methods.
|
- Changed: Maps.get function is no longer using Suffixes unless its absolutely necessary.
|
||||||
- Added: Concat Iterators.
|
- Changed: Maps.remove function is no longer using Suffixes unless its absolutely necessary.
|
||||||
|
- Changed: ObjectList methods are no longer marked Deprecated even so it was for primitive ones.
|
||||||
|
- Added: Shuffle & Reverse Methods.
|
||||||
|
- Added: Concat Iterators.
|
||||||
- Added: PriorityQueues
|
- Added: PriorityQueues
|
|
@ -1,221 +1,221 @@
|
||||||
package speiger.src.builder.modules;
|
package speiger.src.builder.modules;
|
||||||
|
|
||||||
import speiger.src.builder.ClassType;
|
import speiger.src.builder.ClassType;
|
||||||
|
|
||||||
@SuppressWarnings("javadoc")
|
@SuppressWarnings("javadoc")
|
||||||
public class JavaModule extends BaseModule
|
public class JavaModule extends BaseModule
|
||||||
{
|
{
|
||||||
public static final BaseModule INSTANCE = new JavaModule();
|
public static final BaseModule INSTANCE = new JavaModule();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getModuleName() { return "Base"; }
|
public String getModuleName() { return "Base"; }
|
||||||
@Override
|
@Override
|
||||||
protected void loadVariables()
|
protected void loadVariables()
|
||||||
{
|
{
|
||||||
createHelperVars(keyType, false, "KEY");
|
createHelperVars(keyType, false, "KEY");
|
||||||
createHelperVars(valueType, true, "VALUE");
|
createHelperVars(valueType, true, "VALUE");
|
||||||
loadBaseVariables();
|
loadBaseVariables();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadFlags()
|
protected void loadFlags()
|
||||||
{
|
{
|
||||||
addFlag("TYPE_"+keyType.getCapType());
|
addFlag("TYPE_"+keyType.getCapType());
|
||||||
addFlag("VALUE_"+valueType.getCapType());
|
addFlag("VALUE_"+valueType.getCapType());
|
||||||
addValue("JAVA_VERSION", getVersion());
|
addValue("JAVA_VERSION", getVersion());
|
||||||
if(keyType == valueType) addFlag("SAME_TYPE");
|
if(keyType == valueType) addFlag("SAME_TYPE");
|
||||||
if(keyType.hasFunction(valueType)) addFlag("JDK_FUNCTION");
|
if(keyType.hasFunction(valueType)) addFlag("JDK_FUNCTION");
|
||||||
if(!keyType.needsCustomJDKType()) addFlag("JDK_TYPE");
|
if(!keyType.needsCustomJDKType()) addFlag("JDK_TYPE");
|
||||||
if(!keyType.isPrimitiveBlocking()) addFlag("PRIMITIVES");
|
if(!keyType.isPrimitiveBlocking()) addFlag("PRIMITIVES");
|
||||||
if(!valueType.isPrimitiveBlocking()) addFlag("VALUE_PRIMITIVES");
|
if(!valueType.isPrimitiveBlocking()) addFlag("VALUE_PRIMITIVES");
|
||||||
if(!valueType.needsCustomJDKType()) addFlag("JDK_VALUE");
|
if(!valueType.needsCustomJDKType()) addFlag("JDK_VALUE");
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getVersion() {
|
private int getVersion() {
|
||||||
String version = System.getProperty("java.version");
|
String version = System.getProperty("java.version");
|
||||||
if(version.startsWith("1.")) return Integer.parseInt(version.substring(2, 3));
|
if(version.startsWith("1.")) return Integer.parseInt(version.substring(2, 3));
|
||||||
int dot = version.indexOf(".");
|
int dot = version.indexOf(".");
|
||||||
return Integer.parseInt(dot != -1 ? version.substring(0, dot) : version);
|
return Integer.parseInt(dot != -1 ? version.substring(0, dot) : version);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadRemappers() {}
|
protected void loadRemappers() {}
|
||||||
@Override
|
@Override
|
||||||
protected void loadBlockades() {}
|
protected void loadBlockades() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadFunctions()
|
protected void loadFunctions()
|
||||||
{
|
{
|
||||||
addSimpleMapper("APPLY_KEY_VALUE", keyType.isObject() ? "apply" : "applyAs"+keyType.getNonFileType());
|
addSimpleMapper("APPLY_KEY_VALUE", keyType.isObject() ? "apply" : "applyAs"+keyType.getNonFileType());
|
||||||
addSimpleMapper("APPLY_VALUE", valueType.isObject() ? "apply" : "applyAs"+valueType.getNonFileType());
|
addSimpleMapper("APPLY_VALUE", valueType.isObject() ? "apply" : "applyAs"+valueType.getNonFileType());
|
||||||
addSimpleMapper("APPLY_CAST", "applyAs"+keyType.getCustomJDKType().getNonFileType());
|
addSimpleMapper("APPLY_CAST", "applyAs"+keyType.getCustomJDKType().getNonFileType());
|
||||||
|
|
||||||
//Shared by Maps and Pairs so moved to java.
|
//Shared by Maps and Pairs so moved to java.
|
||||||
addFunctionMappers("ENTRY_KEY", "get%sKey");
|
addFunctionMappers("ENTRY_KEY", "get%sKey");
|
||||||
addFunctionValueMappers("ENTRY_VALUE", "get%sValue");
|
addFunctionValueMappers("ENTRY_VALUE", "get%sValue");
|
||||||
addFunctionMappers("KEY_ENTRY", "set%sKey");
|
addFunctionMappers("KEY_ENTRY", "set%sKey");
|
||||||
addFunctionValueMappers("VALUE_ENTRY", "set%sValue");
|
addFunctionValueMappers("VALUE_ENTRY", "set%sValue");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadClasses()
|
protected void loadClasses()
|
||||||
{
|
{
|
||||||
if(getVersion() >= 17) addSimpleMapper("RANDOM", "RandomGenerator");
|
if(getVersion() >= 17) addSimpleMapper("RANDOM", "RandomGenerator");
|
||||||
else addSimpleMapper("RANDOM", "Random");
|
else addSimpleMapper("RANDOM", "Random");
|
||||||
addSimpleMapper("JAVA_PREDICATE", keyType.isPrimitiveBlocking() ? "" : keyType.getCustomJDKType().getFileType()+"Predicate");
|
addSimpleMapper("JAVA_PREDICATE", keyType.isPrimitiveBlocking() ? "" : keyType.getCustomJDKType().getFileType()+"Predicate");
|
||||||
addSimpleMapper("JAVA_CONSUMER", keyType.isPrimitiveBlocking() ? "" : "java.util.function."+keyType.getCustomJDKType().getFileType()+"Consumer");
|
addSimpleMapper("JAVA_CONSUMER", keyType.isPrimitiveBlocking() ? "" : "java.util.function."+keyType.getCustomJDKType().getFileType()+"Consumer");
|
||||||
addSimpleMapper("JAVA_SUPPLIER", keyType.isPrimitiveBlocking() ? "" : "java.util.function."+keyType.getCustomJDKType().getFileType()+"Supplier");
|
addSimpleMapper("JAVA_SUPPLIER", keyType.isPrimitiveBlocking() ? "" : "java.util.function."+keyType.getCustomJDKType().getFileType()+"Supplier");
|
||||||
addSimpleMapper("JAVA_FUNCTION", keyType.getFunctionClass(valueType));
|
addSimpleMapper("JAVA_FUNCTION", keyType.getFunctionClass(valueType));
|
||||||
addSimpleMapper("JAVA_BINARY_OPERATOR", keyType == ClassType.BOOLEAN ? "" : (keyType.isObject() ? "java.util.function.BinaryOperator" : "java.util.function."+keyType.getCustomJDKType().getFileType()+"BinaryOperator"));
|
addSimpleMapper("JAVA_BINARY_OPERATOR", keyType == ClassType.BOOLEAN ? "" : (keyType.isObject() ? "java.util.function.BinaryOperator" : "java.util.function."+keyType.getCustomJDKType().getFileType()+"BinaryOperator"));
|
||||||
addSimpleMapper("JAVA_UNARY_OPERATOR", keyType.isObject() ? "BinaryOperator" : keyType == ClassType.BOOLEAN ? "" : keyType.getCustomJDKType().getFileType()+"UnaryOperator");
|
addSimpleMapper("JAVA_UNARY_OPERATOR", keyType.isObject() ? "BinaryOperator" : keyType == ClassType.BOOLEAN ? "" : keyType.getCustomJDKType().getFileType()+"UnaryOperator");
|
||||||
addSimpleMapper("JAVA_SPLIT_ITERATOR", keyType.isPrimitiveBlocking() ? "Spliterator" : "Of"+keyType.getCustomJDKType().getFileType());
|
addSimpleMapper("JAVA_SPLIT_ITERATOR", keyType.isPrimitiveBlocking() ? "Spliterator" : "Of"+keyType.getCustomJDKType().getFileType());
|
||||||
addSimpleMapper("JAVA_STREAM", keyType.isPrimitiveBlocking() ? "" : keyType.getCustomJDKType().getFileType()+"Stream");
|
addSimpleMapper("JAVA_STREAM", keyType.isPrimitiveBlocking() ? "" : keyType.getCustomJDKType().getFileType()+"Stream");
|
||||||
addSimpleMapper("JAVA_BUFFER", keyType.getFileType()+"Buffer");
|
addSimpleMapper("JAVA_BUFFER", keyType.getFileType()+"Buffer");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadTestClasses()
|
protected void loadTestClasses()
|
||||||
{
|
{
|
||||||
addClassMapper("HELPERS", "Helpers");
|
addClassMapper("HELPERS", "Helpers");
|
||||||
addClassMapper("SAMPLE_ELEMENTS", "Samples");
|
addClassMapper("SAMPLE_ELEMENTS", "Samples");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadBaseVariables()
|
private void loadBaseVariables()
|
||||||
{
|
{
|
||||||
addSimpleMapper("VALUE_PACKAGE", valueType.getPathType());
|
addSimpleMapper("VALUE_PACKAGE", valueType.getPathType());
|
||||||
addSimpleMapper("PACKAGE", keyType.getPathType());
|
addSimpleMapper("PACKAGE", keyType.getPathType());
|
||||||
addSimpleMapper("CLASS_TYPE", keyType.getClassType());
|
addSimpleMapper("CLASS_TYPE", keyType.getClassType());
|
||||||
addSimpleMapper("CLASS_VALUE_TYPE", valueType.getClassValueType());
|
addSimpleMapper("CLASS_VALUE_TYPE", valueType.getClassValueType());
|
||||||
addSimpleMapper("KEY_TYPE", keyType.getKeyType());
|
addSimpleMapper("KEY_TYPE", keyType.getKeyType());
|
||||||
addSimpleMapper("KEY_OBJECT_TYPE", keyType.isObject() ? "Object" : keyType.getKeyType());
|
addSimpleMapper("KEY_OBJECT_TYPE", keyType.isObject() ? "Object" : keyType.getKeyType());
|
||||||
addSimpleMapper("KEY_STRING_TYPE", keyType.isObject() ? "String" : keyType.getKeyType());
|
addSimpleMapper("KEY_STRING_TYPE", keyType.isObject() ? "String" : keyType.getKeyType());
|
||||||
addSimpleMapper("KEY_SPECIAL_TYPE", keyType.isObject() ? "E" : keyType.getKeyType());
|
addSimpleMapper("KEY_SPECIAL_TYPE", keyType.isObject() ? "E" : keyType.getKeyType());
|
||||||
addSimpleMapper("CLASS_OBJECT_TYPE", keyType.getClassType());
|
addSimpleMapper("CLASS_OBJECT_TYPE", keyType.getClassType());
|
||||||
addSimpleMapper("CLASS_OBJECT_VALUE_TYPE", valueType.getClassValueType());
|
addSimpleMapper("CLASS_OBJECT_VALUE_TYPE", valueType.getClassValueType());
|
||||||
addSimpleMapper("CLASS_STRING_TYPE", keyType.isObject() ? "String" : keyType.getClassType());
|
addSimpleMapper("CLASS_STRING_TYPE", keyType.isObject() ? "String" : keyType.getClassType());
|
||||||
addSimpleMapper("CLASS_STRING_VALUE_TYPE", valueType.isObject() ? "String" : valueType.getClassValueType());
|
addSimpleMapper("CLASS_STRING_VALUE_TYPE", valueType.isObject() ? "String" : valueType.getClassValueType());
|
||||||
addSimpleMapper("VALUE_TYPE", valueType.getValueType());
|
addSimpleMapper("VALUE_TYPE", valueType.getValueType());
|
||||||
addSimpleMapper("VALUE_OBJECT_TYPE", valueType.isObject() ? "Object" : valueType.getValueType());
|
addSimpleMapper("VALUE_OBJECT_TYPE", valueType.isObject() ? "Object" : valueType.getValueType());
|
||||||
addSimpleMapper("VALUE_STRING_TYPE", valueType.isObject() ? "String" : valueType.getValueType());
|
addSimpleMapper("VALUE_STRING_TYPE", valueType.isObject() ? "String" : valueType.getValueType());
|
||||||
addSimpleMapper("VALUE_SPECIAL_TYPE", valueType.isObject() ? "E" : valueType.getKeyType());
|
addSimpleMapper("VALUE_SPECIAL_TYPE", valueType.isObject() ? "E" : valueType.getKeyType());
|
||||||
addSimpleMapper("KEY_JAVA_TYPE", keyType.getCustomJDKType().getKeyType());
|
addSimpleMapper("KEY_JAVA_TYPE", keyType.getCustomJDKType().getKeyType());
|
||||||
addSimpleMapper("VALUE_JAVA_TYPE", keyType.getCustomJDKType().getKeyType());
|
addSimpleMapper("VALUE_JAVA_TYPE", keyType.getCustomJDKType().getKeyType());
|
||||||
|
|
||||||
addSimpleMapper("EMPTY_KEY_VALUE", keyType.getEmptyValue());
|
addSimpleMapper("EMPTY_KEY_VALUE", keyType.getEmptyValue());
|
||||||
addSimpleMapper("EMPTY_VALUE", valueType.getEmptyValue());
|
addSimpleMapper("EMPTY_VALUE", valueType.getEmptyValue());
|
||||||
|
|
||||||
addSimpleMapper("INVALID_KEY_VALUE", keyType.getInvalidValue());
|
addSimpleMapper("INVALID_KEY_VALUE", keyType.getInvalidValue());
|
||||||
addSimpleMapper("INVALID_VALUE", valueType.getInvalidValue());
|
addSimpleMapper("INVALID_VALUE", valueType.getInvalidValue());
|
||||||
|
|
||||||
addSimpleMapper(" KEY_STRING_GENERIC_TYPE", keyType.isObject() ? "<String>" : "");
|
addSimpleMapper(" KEY_STRING_GENERIC_TYPE", keyType.isObject() ? "<String>" : "");
|
||||||
addSimpleMapper(" VALUE_STRING_GENERIC_TYPE", valueType.isObject() ? "<String>" : "");
|
addSimpleMapper(" VALUE_STRING_GENERIC_TYPE", valueType.isObject() ? "<String>" : "");
|
||||||
addSimpleMapper(" KEY_VALUE_STRING_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<String, String>" : "<String>") : (valueType.isObject() ? "<String>" : ""));
|
addSimpleMapper(" KEY_VALUE_STRING_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<String, String>" : "<String>") : (valueType.isObject() ? "<String>" : ""));
|
||||||
|
|
||||||
addSimpleMapper(" KEY_SAME_GENERIC_TYPE", keyType.isObject() ? "<T, T>" : "");
|
addSimpleMapper(" KEY_SAME_GENERIC_TYPE", keyType.isObject() ? "<T, T>" : "");
|
||||||
addSimpleMapper(" VALUE_SAME_GENERIC_TYPE", keyType.isObject() ? "<V, V>" : "");
|
addSimpleMapper(" VALUE_SAME_GENERIC_TYPE", keyType.isObject() ? "<V, V>" : "");
|
||||||
|
|
||||||
addSimpleMapper(" KEY_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+">" : "");
|
addSimpleMapper(" KEY_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+">" : "");
|
||||||
addSimpleMapper(" KEY_KEY_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+", "+keyType.getKeyType()+">" : "");
|
addSimpleMapper(" KEY_KEY_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+", "+keyType.getKeyType()+">" : "");
|
||||||
addSimpleMapper(" KEY_CLASS_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getClassType()+">" : "");
|
addSimpleMapper(" KEY_CLASS_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getClassType()+">" : "");
|
||||||
|
|
||||||
|
|
||||||
addSimpleMapper(" VALUE_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+">" : "");
|
addSimpleMapper(" VALUE_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+">" : "");
|
||||||
addSimpleMapper(" VALUE_VALUE_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+", "+valueType.getValueType()+">" : "");
|
addSimpleMapper(" VALUE_VALUE_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+", "+valueType.getValueType()+">" : "");
|
||||||
addSimpleMapper(" VALUE_CLASS_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getClassValueType()+">" : "");
|
addSimpleMapper(" VALUE_CLASS_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getClassValueType()+">" : "");
|
||||||
|
|
||||||
addSimpleMapper(" KEY_VALUE_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+">" : "<"+keyType.getKeyType()+">") : (valueType.isObject() ? "<"+valueType.getValueType()+">" : ""));
|
addSimpleMapper(" KEY_VALUE_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+">" : "<"+keyType.getKeyType()+">") : (valueType.isObject() ? "<"+valueType.getValueType()+">" : ""));
|
||||||
addSimpleMapper(" KEY_VALUE_VALUE_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+", "+valueType.getValueType()+">" : "<"+keyType.getKeyType()+">") : (valueType.isObject() ? "<"+valueType.getValueType()+", "+valueType.getValueType()+">" : ""));
|
addSimpleMapper(" KEY_VALUE_VALUE_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+", "+valueType.getValueType()+">" : "<"+keyType.getKeyType()+">") : (valueType.isObject() ? "<"+valueType.getValueType()+", "+valueType.getValueType()+">" : ""));
|
||||||
addInjectMapper(" KEY_VALUE_SPECIAL_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+", %s>" : "<"+keyType.getKeyType()+", %s>") : (valueType.isObject() ? "<"+valueType.getValueType()+", %s>" : "<%s>")).setBraceType("<>").removeBraces();
|
addInjectMapper(" KEY_VALUE_SPECIAL_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+", %s>" : "<"+keyType.getKeyType()+", %s>") : (valueType.isObject() ? "<"+valueType.getValueType()+", %s>" : "<%s>")).setBraceType("<>").removeBraces();
|
||||||
|
|
||||||
addSimpleMapper(" NO_GENERIC_TYPE", keyType.isObject() ? "<?>" : "");
|
addSimpleMapper(" NO_GENERIC_TYPE", keyType.isObject() ? "<?>" : "");
|
||||||
addSimpleMapper(" NO_KV_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<?, ?>" : "<?>") : valueType.isObject() ? "<?>" : "");
|
addSimpleMapper(" NO_KV_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<?, ?>" : "<?>") : valueType.isObject() ? "<?>" : "");
|
||||||
addSimpleMapper(" KEY_COMPAREABLE_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+" extends Comparable<T>>" : "");
|
addSimpleMapper(" KEY_COMPAREABLE_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+" extends Comparable<T>>" : "");
|
||||||
|
|
||||||
addSimpleMapper(" KEY_SUPER_GENERIC_TYPE", keyType.isObject() ? "<? super "+keyType.getKeyType()+">" : "");
|
addSimpleMapper(" KEY_SUPER_GENERIC_TYPE", keyType.isObject() ? "<? super "+keyType.getKeyType()+">" : "");
|
||||||
addSimpleMapper(" VALUE_SUPER_GENERIC_TYPE", valueType.isObject() ? "<? super "+valueType.getValueType()+">" : "");
|
addSimpleMapper(" VALUE_SUPER_GENERIC_TYPE", valueType.isObject() ? "<? super "+valueType.getValueType()+">" : "");
|
||||||
addSimpleMapper(" KEY_VALUE_SUPER_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<? super "+keyType.getKeyType()+", ? super "+valueType.getValueType()+">" : "<? super "+keyType.getKeyType()+">") : (valueType.isObject() ? "<? super "+valueType.getValueType()+">" : ""));
|
addSimpleMapper(" KEY_VALUE_SUPER_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<? super "+keyType.getKeyType()+", ? super "+valueType.getValueType()+">" : "<? super "+keyType.getKeyType()+">") : (valueType.isObject() ? "<? super "+valueType.getValueType()+">" : ""));
|
||||||
|
|
||||||
addSimpleMapper(" KEY_UNKNOWN_GENERIC_TYPE", keyType.isObject() ? "<? extends "+keyType.getKeyType()+">" : "");
|
addSimpleMapper(" KEY_UNKNOWN_GENERIC_TYPE", keyType.isObject() ? "<? extends "+keyType.getKeyType()+">" : "");
|
||||||
addSimpleMapper(" VALUE_UNKNOWN_GENERIC_TYPE", valueType.isObject() ? "<? extends "+valueType.getValueType()+">" : "");
|
addSimpleMapper(" VALUE_UNKNOWN_GENERIC_TYPE", valueType.isObject() ? "<? extends "+valueType.getValueType()+">" : "");
|
||||||
addSimpleMapper(" KEY_VALUE_UNKNOWN_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<? extends "+keyType.getKeyType()+", ? extends "+valueType.getValueType()+">" : "<? extends "+keyType.getKeyType()+">") : (valueType.isObject() ? "<? extends "+valueType.getValueType()+">" : ""));
|
addSimpleMapper(" KEY_VALUE_UNKNOWN_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<? extends "+keyType.getKeyType()+", ? extends "+valueType.getValueType()+">" : "<? extends "+keyType.getKeyType()+">") : (valueType.isObject() ? "<? extends "+valueType.getValueType()+">" : ""));
|
||||||
|
|
||||||
addSimpleMapper(" KEY_ENUM_VALUE_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">, "+valueType.getValueType()+">" : "<"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">>") : (valueType.isObject() ? "<"+valueType.getValueType()+">" : ""));
|
addSimpleMapper(" KEY_ENUM_VALUE_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">, "+valueType.getValueType()+">" : "<"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">>") : (valueType.isObject() ? "<"+valueType.getValueType()+">" : ""));
|
||||||
addSimpleMapper(" KEY_VALUE_ENUM_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+" extends Enum<"+valueType.getValueType()+">>" : "<"+keyType.getKeyType()+">") : (valueType.isObject() ? "<"+valueType.getValueType()+" extends Enum<"+valueType.getValueType()+">>" : ""));
|
addSimpleMapper(" KEY_VALUE_ENUM_GENERIC_TYPE", keyType.isObject() ? (valueType.isObject() ? "<"+keyType.getKeyType()+", "+valueType.getValueType()+" extends Enum<"+valueType.getValueType()+">>" : "<"+keyType.getKeyType()+">") : (valueType.isObject() ? "<"+valueType.getValueType()+" extends Enum<"+valueType.getValueType()+">>" : ""));
|
||||||
|
|
||||||
addInjectMapper(" KEY_SPECIAL_GENERIC_TYPE", keyType.isObject() ? "<%s>" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" KEY_SPECIAL_GENERIC_TYPE", keyType.isObject() ? "<%s>" : "").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" VALUE_SPECIAL_GENERIC_TYPE", valueType.isObject() ? "<%s>" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" VALUE_SPECIAL_GENERIC_TYPE", valueType.isObject() ? "<%s>" : "").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" KSK_GENERIC_TYPE", keyType.isObject() ? "<%s, "+keyType.getKeyType()+">" : "<%s>").removeBraces().setBraceType("<>");
|
addInjectMapper(" KSK_GENERIC_TYPE", keyType.isObject() ? "<%s, "+keyType.getKeyType()+">" : "<%s>").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" KKS_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+", %s>" : "<%s>").removeBraces().setBraceType("<>");
|
addInjectMapper(" KKS_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+", %s>" : "<%s>").removeBraces().setBraceType("<>");
|
||||||
addArgumentMapper(" KSS_GENERIC_TYPE", keyType.isObject() ? "<%1$s, %2$s>" : "<%2$s>").removeBraces().setBraceType("<>");
|
addArgumentMapper(" KSS_GENERIC_TYPE", keyType.isObject() ? "<%1$s, %2$s>" : "<%2$s>").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" SK_GENERIC_TYPE", keyType.isObject() ? "<%s, "+keyType.getKeyType()+">" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" SK_GENERIC_TYPE", keyType.isObject() ? "<%s, "+keyType.getKeyType()+">" : "").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" KS_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+", %s>" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" KS_GENERIC_TYPE", keyType.isObject() ? "<"+keyType.getKeyType()+", %s>" : "").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" VSV_GENERIC_TYPE", valueType.isObject() ? "<%s, "+valueType.getValueType()+">" : "<%s>").removeBraces().setBraceType("<>");
|
addInjectMapper(" VSV_GENERIC_TYPE", valueType.isObject() ? "<%s, "+valueType.getValueType()+">" : "<%s>").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" VVS_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+", %s>" : "<%s>").removeBraces().setBraceType("<>");
|
addInjectMapper(" VVS_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+", %s>" : "<%s>").removeBraces().setBraceType("<>");
|
||||||
addArgumentMapper(" VSS_GENERIC_TYPE", valueType.isObject() ? "<%1$s, %2$s>" : "<%2$s>").removeBraces().setBraceType("<>");
|
addArgumentMapper(" VSS_GENERIC_TYPE", valueType.isObject() ? "<%1$s, %2$s>" : "<%2$s>").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" SV_GENERIC_TYPE", valueType.isObject() ? "<%s, "+valueType.getValueType()+">" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" SV_GENERIC_TYPE", valueType.isObject() ? "<%s, "+valueType.getValueType()+">" : "").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" VS_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+", %s>" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" VS_GENERIC_TYPE", valueType.isObject() ? "<"+valueType.getValueType()+", %s>" : "").removeBraces().setBraceType("<>");
|
||||||
|
|
||||||
|
|
||||||
addSimpleMapper(" GENERIC_KEY_BRACES", keyType.isObject() ? " <"+keyType.getKeyType()+">" : "");
|
addSimpleMapper(" GENERIC_KEY_BRACES", keyType.isObject() ? " <"+keyType.getKeyType()+">" : "");
|
||||||
addSimpleMapper(" GENERIC_VALUE_BRACES", valueType.isObject() ? " <"+valueType.getValueType()+">" : "");
|
addSimpleMapper(" GENERIC_VALUE_BRACES", valueType.isObject() ? " <"+valueType.getValueType()+">" : "");
|
||||||
addInjectMapper(" GENERIC_SPECIAL_KEY_BRACES", keyType.isObject() ? " <%s>" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" GENERIC_SPECIAL_KEY_BRACES", keyType.isObject() ? " <%s>" : "").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" GENERIC_SPECIAL_VALUE_BRACES", valueType.isObject() ? " <%s>" : "").removeBraces().setBraceType("<>");
|
addInjectMapper(" GENERIC_SPECIAL_VALUE_BRACES", valueType.isObject() ? " <%s>" : "").removeBraces().setBraceType("<>");
|
||||||
addSimpleMapper(" GENERIC_KEY_ENUM_VALUE_BRACES", keyType.isObject() ? (valueType.isObject() ? " <"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">, "+valueType.getValueType()+">" : " <"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">>") : (valueType.isObject() ? " <"+valueType.getValueType()+">" : ""));
|
addSimpleMapper(" GENERIC_KEY_ENUM_VALUE_BRACES", keyType.isObject() ? (valueType.isObject() ? " <"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">, "+valueType.getValueType()+">" : " <"+keyType.getKeyType()+" extends Enum<"+keyType.getKeyType()+">>") : (valueType.isObject() ? " <"+valueType.getValueType()+">" : ""));
|
||||||
|
|
||||||
addInjectMapper(" GENERIC_KEY_SPECIAL_BRACES", keyType.isObject() ? " <"+keyType.getKeyType()+", %s>" : " <%s>").removeBraces().setBraceType("<>");
|
addInjectMapper(" GENERIC_KEY_SPECIAL_BRACES", keyType.isObject() ? " <"+keyType.getKeyType()+", %s>" : " <%s>").removeBraces().setBraceType("<>");
|
||||||
addInjectMapper(" GENERIC_VALUE_SPECIAL_BRACES", valueType.isObject() ? " <"+valueType.getKeyType()+", %s>" : " <%s>").removeBraces().setBraceType("<>");
|
addInjectMapper(" GENERIC_VALUE_SPECIAL_BRACES", valueType.isObject() ? " <"+valueType.getKeyType()+", %s>" : " <%s>").removeBraces().setBraceType("<>");
|
||||||
|
|
||||||
addSimpleMapper(" GENERIC_KEY_VALUE_BRACES", keyType.isObject() ? (valueType.isObject() ? " <"+keyType.getKeyType()+", "+valueType.getValueType()+">" : " <"+keyType.getKeyType()+">") : (valueType.isObject() ? " <"+valueType.getValueType()+">" : ""));
|
addSimpleMapper(" GENERIC_KEY_VALUE_BRACES", keyType.isObject() ? (valueType.isObject() ? " <"+keyType.getKeyType()+", "+valueType.getValueType()+">" : " <"+keyType.getKeyType()+">") : (valueType.isObject() ? " <"+valueType.getValueType()+">" : ""));
|
||||||
addSimpleMapper(" COMPAREABLE_KEY_BRACES", keyType.isObject() ? " <"+keyType.getKeyType()+" extends Comparable<T>>" : "");
|
addSimpleMapper(" COMPAREABLE_KEY_BRACES", keyType.isObject() ? " <"+keyType.getKeyType()+" extends Comparable<T>>" : "");
|
||||||
addSimpleMapper("KV_BRACES", keyType.isObject() || valueType.isObject() ? "<>" : "");
|
addSimpleMapper("KV_BRACES", keyType.isObject() || valueType.isObject() ? "<>" : "");
|
||||||
addSimpleMapper("VALUE_BRACES", valueType.isObject() ? "<>" : "");
|
addSimpleMapper("VALUE_BRACES", valueType.isObject() ? "<>" : "");
|
||||||
addSimpleMapper("BRACES", keyType.isObject() ? "<>" : "");
|
addSimpleMapper("BRACES", keyType.isObject() ? "<>" : "");
|
||||||
if(keyType.needsCustomJDKType())
|
if(keyType.needsCustomJDKType())
|
||||||
{
|
{
|
||||||
addSimpleMapper("JAVA_TYPE", keyType.getCustomJDKType().getKeyType());
|
addSimpleMapper("JAVA_TYPE", keyType.getCustomJDKType().getKeyType());
|
||||||
addSimpleMapper("SANITY_CAST", "castTo"+keyType.getFileType());
|
addSimpleMapper("SANITY_CAST", "castTo"+keyType.getFileType());
|
||||||
}
|
}
|
||||||
addSimpleMapper("JAVA_CLASS", keyType.getCustomJDKType().getClassType());
|
addSimpleMapper("JAVA_CLASS", keyType.getCustomJDKType().getClassType());
|
||||||
if(valueType.needsCustomJDKType())
|
if(valueType.needsCustomJDKType())
|
||||||
{
|
{
|
||||||
addSimpleMapper("SANITY_CAST_VALUE", "castTo"+valueType.getFileType());
|
addSimpleMapper("SANITY_CAST_VALUE", "castTo"+valueType.getFileType());
|
||||||
}
|
}
|
||||||
addSimpleMapper("[SPACE]", " ");
|
addSimpleMapper("[SPACE]", " ");
|
||||||
addComment("@ArrayType", "@param <%s> the keyType of array that the operation should be applied");
|
addComment("@ArrayType", "@param <%s> the keyType of array that the operation should be applied");
|
||||||
addComment("@Type", "@param <%s> the keyType of elements maintained by this Collection");
|
addComment("@Type", "@param <%s> the keyType of elements maintained by this Collection");
|
||||||
addValueComment("@ValueArrayType", "@param <%s> the keyType of array that the operation should be applied");
|
addValueComment("@ValueArrayType", "@param <%s> the keyType of array that the operation should be applied");
|
||||||
addValueComment("@ValueType", "@param <%s> the keyType of elements maintained by this Collection");
|
addValueComment("@ValueType", "@param <%s> the keyType of elements maintained by this Collection");
|
||||||
addAnnontion("@PrimitiveOverride", "@Override");
|
addAnnontion("@PrimitiveOverride", "@Override");
|
||||||
addSimpleMapper("@PrimitiveDoc", "");
|
addSimpleMapper("@PrimitiveDoc", "");
|
||||||
addAnnontion("@Primitive", "@Deprecated");
|
addAnnontion("@Primitive", "@Deprecated");
|
||||||
addValueAnnontion("@ValuePrimitiveOverride", "@Override");
|
addValueAnnontion("@ValuePrimitiveOverride", "@Override");
|
||||||
addValueAnnontion("@ValuePrimitive", "@Deprecated");
|
addValueAnnontion("@ValuePrimitive", "@Deprecated");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createHelperVars(ClassType type, boolean value, String fix)
|
private void createHelperVars(ClassType type, boolean value, String fix)
|
||||||
{
|
{
|
||||||
addArgumentMapper("EQUALS_"+fix+"_TYPE", "Objects.equals(%2$s, "+(type.isObject() ? "%1$s" : fix+"_TO_OBJ(%1$s)")+")").removeBraces();
|
addArgumentMapper("EQUALS_"+fix+"_TYPE", "Objects.equals(%2$s, "+(type.isObject() ? "%1$s" : fix+"_TO_OBJ(%1$s)")+")").removeBraces();
|
||||||
addInjectMapper(fix+"_EQUALS_NOT_NULL", type.getComparableValue()+" != "+(type.isPrimitiveBlocking() || type.needsCast() ? type.getEmptyValue() : "0")).removeBraces();
|
addInjectMapper(fix+"_EQUALS_NOT_NULL", type.getComparableValue()+" != "+(type.isPrimitiveBlocking() || type.needsCast() ? type.getEmptyValue() : "0")).removeBraces();
|
||||||
addInjectMapper(fix+"_EQUALS_NULL", type.getComparableValue()+" == "+(type.isPrimitiveBlocking() || type.needsCast() ? type.getEmptyValue() : "0")).removeBraces();
|
addInjectMapper(fix+"_EQUALS_NULL", type.getComparableValue()+" == "+(type.isPrimitiveBlocking() || type.needsCast() ? type.getEmptyValue() : "0")).removeBraces();
|
||||||
addArgumentMapper(fix+"_EQUALS_NOT", type.getEquals(true)).removeBraces();
|
addArgumentMapper(fix+"_EQUALS_NOT", type.getEquals(true)).removeBraces();
|
||||||
addArgumentMapper(fix+"_EQUALS", type.getEquals(false)).removeBraces();
|
addArgumentMapper(fix+"_EQUALS", type.getEquals(false)).removeBraces();
|
||||||
addSimpleMapper("FILE_"+fix+"_TYPE", type.getFileType());
|
addSimpleMapper("FILE_"+fix+"_TYPE", type.getFileType());
|
||||||
|
|
||||||
addArgumentMapper("COMPAREABLE_TO_"+fix, type.isObject() ? "((Comparable<"+type.getKeyType(value)+">)%1$s).compareTo(("+type.getKeyType(value)+")%2$s)" : type.getClassType(value)+".compare(%1$s, %2$s)").removeBraces();
|
addArgumentMapper("COMPAREABLE_TO_"+fix, type.isObject() ? "((Comparable<"+type.getKeyType(value)+">)%1$s).compareTo(("+type.getKeyType(value)+")%2$s)" : type.getClassType(value)+".compare(%1$s, %2$s)").removeBraces();
|
||||||
addArgumentMapper("COMPARE_TO_"+fix, type.isObject() ? "%1$s.compareTo(%2$s)" : type.getClassType(value)+".compare(%1$s, %2$s)").removeBraces();
|
addArgumentMapper("COMPARE_TO_"+fix, type.isObject() ? "%1$s.compareTo(%2$s)" : type.getClassType(value)+".compare(%1$s, %2$s)").removeBraces();
|
||||||
|
|
||||||
addInjectMapper(fix+"_TO_OBJ", type.isObject() ? "%s" : type.getClassType(value)+".valueOf(%s)").removeBraces();
|
addInjectMapper(fix+"_TO_OBJ", type.isObject() ? "%s" : type.getClassType(value)+".valueOf(%s)").removeBraces();
|
||||||
addInjectMapper("OBJ_TO_"+fix, type.isObject() ? "%s" : "%s."+type.getKeyType(value)+"Value()").removeBraces();
|
addInjectMapper("OBJ_TO_"+fix, type.isObject() ? "%s" : "%s."+type.getKeyType(value)+"Value()").removeBraces();
|
||||||
addInjectMapper("CLASS_TO_"+fix, type.isObject() ? "("+type.getKeyType(value)+")%s" : "(("+type.getClassType(value)+")%s)."+type.getKeyType(value)+"Value()").removeBraces();
|
addInjectMapper("CLASS_TO_"+fix, type.isObject() ? "("+type.getKeyType(value)+")%s" : "(("+type.getClassType(value)+")%s)."+type.getKeyType(value)+"Value()").removeBraces();
|
||||||
|
|
||||||
addInjectMapper(fix+"_TO_HASH", type.isObject() ? "Objects.hashCode(%s)" : type.getClassType(value)+".hashCode(%s)").removeBraces();
|
addInjectMapper(fix+"_TO_HASH", type.isObject() ? "Objects.hashCode(%s)" : type.getClassType(value)+".hashCode(%s)").removeBraces();
|
||||||
addInjectMapper(fix+"_TO_STRING", type.isObject() ? "Objects.toString(%s)" : type.getClassType(value)+".toString(%s)").removeBraces();
|
addInjectMapper(fix+"_TO_STRING", type.isObject() ? "Objects.toString(%s)" : type.getClassType(value)+".toString(%s)").removeBraces();
|
||||||
|
|
||||||
addSimpleMapper("CAST_"+fix+"_ARRAY ", type.isObject() ? "("+fix+"_TYPE[])" : "");
|
addSimpleMapper("CAST_"+fix+"_ARRAY ", type.isObject() ? "("+fix+"_TYPE[])" : "");
|
||||||
addSimpleMapper("EMPTY_"+fix+"_ARRAY", type.isObject() ? "("+fix+"_TYPE[])ARRAYS.EMPTY_ARRAY" : "ARRAYS.EMPTY_ARRAY");
|
addSimpleMapper("EMPTY_"+fix+"_ARRAY", type.isObject() ? "("+fix+"_TYPE[])ARRAYS.EMPTY_ARRAY" : "ARRAYS.EMPTY_ARRAY");
|
||||||
addInjectMapper("NEW_"+fix+"_ARRAY", type.isObject() ? "("+fix+"_TYPE[])new Object[%s]" : "new "+fix+"_TYPE[%s]").removeBraces();
|
addInjectMapper("NEW_"+fix+"_ARRAY", type.isObject() ? "("+fix+"_TYPE[])new Object[%s]" : "new "+fix+"_TYPE[%s]").removeBraces();
|
||||||
addInjectMapper("NEW_SPECIAL_"+fix+"_ARRAY", type.isObject() ? "(E[])new Object[%s]" : "new "+fix+"_TYPE[%s]").removeBraces();
|
addInjectMapper("NEW_SPECIAL_"+fix+"_ARRAY", type.isObject() ? "(E[])new Object[%s]" : "new "+fix+"_TYPE[%s]").removeBraces();
|
||||||
if(value) addInjectMapper("NEW_CLASS_VALUE_ARRAY", type.isObject() ? "(CLASS_VALUE_TYPE[])new Object[%s]" : "new CLASS_VALUE_TYPE[%s]").removeBraces();
|
if(value) addInjectMapper("NEW_CLASS_VALUE_ARRAY", type.isObject() ? "(CLASS_VALUE_TYPE[])new Object[%s]" : "new CLASS_VALUE_TYPE[%s]").removeBraces();
|
||||||
else addInjectMapper("NEW_CLASS_ARRAY", type.isObject() ? "(CLASS_TYPE[])new Object[%s]" : "new CLASS_TYPE[%s]").removeBraces();
|
else addInjectMapper("NEW_CLASS_ARRAY", type.isObject() ? "(CLASS_TYPE[])new Object[%s]" : "new CLASS_TYPE[%s]").removeBraces();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,10 @@ public class ListModule extends BaseModule
|
||||||
protected void loadFunctions()
|
protected void loadFunctions()
|
||||||
{
|
{
|
||||||
addFunctionMapper("GET_KEY", "get");
|
addFunctionMapper("GET_KEY", "get");
|
||||||
addFunctionMapper("REMOVE_LAST", "removeLast");
|
addFunctionMapper("GET_FIRST_KEY", "getFirst");
|
||||||
|
addFunctionMapper("GET_LAST_KEY", "getLast");
|
||||||
|
addFunctionMapper("REMOVE_FIRST_KEY", "removeFirst");
|
||||||
|
addFunctionMapper("REMOVE_LAST_KEY", "removeLast");
|
||||||
addFunctionMapper("REMOVE_SWAP", "swapRemove");
|
addFunctionMapper("REMOVE_SWAP", "swapRemove");
|
||||||
addFunctionMappers("REPLACE", keyType.isObject() ? "replaceObjects" : "replace%ss");
|
addFunctionMappers("REPLACE", keyType.isObject() ? "replaceObjects" : "replace%ss");
|
||||||
addFunctionMappers("SORT", "sort%ss");
|
addFunctionMappers("SORT", "sort%ss");
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class SetModule extends BaseModule
|
||||||
addFunctionMapper("POLL_FIRST_KEY", "pollFirst");
|
addFunctionMapper("POLL_FIRST_KEY", "pollFirst");
|
||||||
addFunctionMapper("POLL_LAST_KEY", "pollLast");
|
addFunctionMapper("POLL_LAST_KEY", "pollLast");
|
||||||
addFunctionMapper("FIRST_KEY", "first");
|
addFunctionMapper("FIRST_KEY", "first");
|
||||||
addFunctionMapper("LAST_KEY", "last");
|
addFunctionMapper("LAST_KEY", "last");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -314,21 +314,43 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
|
||||||
#if DEQUEUE_FEATURE
|
#if DEQUEUE_FEATURE
|
||||||
@Override
|
@Override
|
||||||
public KEY_TYPE first() {
|
public KEY_TYPE first() {
|
||||||
|
return GET_FIRST_KEY();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KEY_TYPE last() {
|
||||||
|
return GET_LAST_KEY();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@Override
|
||||||
|
public KEY_TYPE GET_FIRST_KEY() {
|
||||||
if(first == null) throw new NoSuchElementException();
|
if(first == null) throw new NoSuchElementException();
|
||||||
return first.value;
|
return first.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KEY_TYPE last() {
|
public KEY_TYPE GET_LAST_KEY() {
|
||||||
if(last == null) throw new NoSuchElementException();
|
if(last == null) throw new NoSuchElementException();
|
||||||
return last.value;
|
return last.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
@Override
|
||||||
|
public KEY_TYPE REMOVE_FIRST_KEY() {
|
||||||
|
if(first == null) throw new NoSuchElementException();
|
||||||
|
return unlinkFirst(first);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public KEY_TYPE REMOVE_LAST_KEY() {
|
||||||
|
return pop();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KEY_TYPE peek(int index) {
|
public KEY_TYPE peek(int index) {
|
||||||
return GET_KEY((size() - 1) - index);
|
return GET_KEY((size() - 1) - index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KEY_TYPE GET_KEY(int index) {
|
public KEY_TYPE GET_KEY(int index) {
|
||||||
checkRange(index);
|
checkRange(index);
|
||||||
|
@ -1146,8 +1168,7 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
|
||||||
Entry KEY_GENERIC_TYPE prev;
|
Entry KEY_GENERIC_TYPE prev;
|
||||||
Entry KEY_GENERIC_TYPE next;
|
Entry KEY_GENERIC_TYPE next;
|
||||||
|
|
||||||
public Entry(KEY_TYPE value, Entry KEY_GENERIC_TYPE prev, Entry KEY_GENERIC_TYPE next)
|
public Entry(KEY_TYPE value, Entry KEY_GENERIC_TYPE prev, Entry KEY_GENERIC_TYPE next) {
|
||||||
{
|
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.prev = prev;
|
this.prev = prev;
|
||||||
this.next = next;
|
this.next = next;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue