From 2442e05e638a61dd1bfbd6b95cb3544b6a327af9 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Tue, 27 Sep 2022 19:09:11 -0400 Subject: GPLize project Finally deciding to move things into a proper license; which I can do since I've never accepted (or had :( ) a pull request from another person --- src/main/java/bjc/data/ArrayIterator.java | 17 +++ src/main/java/bjc/data/BooleanToggle.java | 17 +++ src/main/java/bjc/data/CircularIterator.java | 17 +++ src/main/java/bjc/data/Context.java | 17 +++ src/main/java/bjc/data/Contexts.java | 17 +++ src/main/java/bjc/data/Either.java | 17 +++ src/main/java/bjc/data/GeneratingIterator.java | 17 +++ src/main/java/bjc/data/Holder.java | 17 +++ src/main/java/bjc/data/Identity.java | 17 +++ src/main/java/bjc/data/IntHolder.java | 17 +++ src/main/java/bjc/data/Lazy.java | 17 +++ src/main/java/bjc/data/LazyPair.java | 17 +++ src/main/java/bjc/data/ListHolder.java | 17 +++ src/main/java/bjc/data/MarkListIterator.java | 17 +++ src/main/java/bjc/data/NonCMEIterator.java | 17 +++ src/main/java/bjc/data/NonCMEListIterator.java | 17 +++ src/main/java/bjc/data/OneWayToggle.java | 17 +++ src/main/java/bjc/data/Option.java | 17 +++ src/main/java/bjc/data/Pair.java | 17 +++ src/main/java/bjc/data/PetriNet.java | 17 +++ src/main/java/bjc/data/PetriTransition.java | 17 +++ src/main/java/bjc/data/QueuedIterator.java | 17 +++ src/main/java/bjc/data/ResettableIterator.java | 17 +++ src/main/java/bjc/data/ReverseListIterator.java | 17 +++ src/main/java/bjc/data/SimplePair.java | 17 +++ src/main/java/bjc/data/SimpleTree.java | 17 +++ src/main/java/bjc/data/SingleIterator.java | 17 +++ src/main/java/bjc/data/SingleSupplier.java | 17 +++ src/main/java/bjc/data/Toggle.java | 17 +++ .../java/bjc/data/TopDownTransformIterator.java | 17 +++ src/main/java/bjc/data/TopDownTransformResult.java | 17 +++ src/main/java/bjc/data/TransformIterator.java | 17 +++ src/main/java/bjc/data/Tree.java | 17 +++ src/main/java/bjc/data/ValueToggle.java | 17 +++ src/main/java/bjc/data/internals/BoundLazy.java | 17 +++ .../java/bjc/data/internals/BoundLazyPair.java | 17 +++ .../java/bjc/data/internals/BoundListHolder.java | 17 +++ .../java/bjc/data/internals/HalfBoundLazyPair.java | 17 +++ src/main/java/bjc/data/internals/WrappedLazy.java | 17 +++ .../java/bjc/data/internals/WrappedOption.java | 17 +++ src/main/java/bjc/esodata/AbbrevMap2.java | 19 ++- src/main/java/bjc/esodata/AbbrevTree.java | 23 +++- src/main/java/bjc/esodata/DefaultList.java | 17 +++ src/main/java/bjc/esodata/Directory.java | 17 +++ src/main/java/bjc/esodata/DoubleSided.java | 17 +++ src/main/java/bjc/esodata/DoubleTape.java | 17 +++ src/main/java/bjc/esodata/FlatNestIterator.java | 17 +++ src/main/java/bjc/esodata/KeyedList.java | 123 +++++++++++++++++ src/main/java/bjc/esodata/MapSet.java | 17 +++ src/main/java/bjc/esodata/MinMaxList.java | 17 +++ src/main/java/bjc/esodata/Multimap.java | 149 +++++++-------------- src/main/java/bjc/esodata/NestList.java | 17 +++ src/main/java/bjc/esodata/PairMap.java | 25 +++- src/main/java/bjc/esodata/PushdownMap.java | 17 +++ src/main/java/bjc/esodata/QueueStack.java | 17 +++ src/main/java/bjc/esodata/SimpleDirectory.java | 17 +++ src/main/java/bjc/esodata/SimpleStack.java | 17 +++ src/main/java/bjc/esodata/SingleTape.java | 17 +++ src/main/java/bjc/esodata/SpaghettiStack.java | 17 +++ src/main/java/bjc/esodata/Stack.java | 17 +++ src/main/java/bjc/esodata/TSetMultimap.java | 124 +++++++++++++++++ src/main/java/bjc/esodata/Tape.java | 17 +++ src/main/java/bjc/esodata/TapeLibrary.java | 17 +++ src/main/java/bjc/esodata/TapeView.java | 17 +++ src/main/java/bjc/esodata/ThresholdSet.java | 17 +++ src/main/java/bjc/esodata/UnifiedDirectory.java | 17 +++ src/main/java/bjc/esodata/spool/Spool.java | 17 +++ src/main/java/bjc/esodata/spool/Spooler.java | 17 +++ src/main/java/bjc/funcdata/CList.java | 17 +++ src/main/java/bjc/funcdata/CListLike.java | 17 +++ src/main/java/bjc/funcdata/CListStructure.java | 17 +++ src/main/java/bjc/funcdata/ExtendedMap.java | 17 +++ src/main/java/bjc/funcdata/Freezable.java | 17 +++ src/main/java/bjc/funcdata/FunctionalList.java | 17 +++ src/main/java/bjc/funcdata/FunctionalMap.java | 17 +++ .../bjc/funcdata/FunctionalStringTokenizer.java | 17 +++ src/main/java/bjc/funcdata/ListEx.java | 17 +++ src/main/java/bjc/funcdata/MapEx.java | 17 +++ src/main/java/bjc/funcdata/ObjectFrozen.java | 17 +++ src/main/java/bjc/funcdata/SentryList.java | 17 +++ .../java/bjc/funcdata/TransformedValueMap.java | 17 +++ .../java/bjc/funcdata/bst/BinarySearchTree.java | 17 +++ .../bjc/funcdata/bst/BinarySearchTreeLeaf.java | 17 +++ .../bjc/funcdata/bst/BinarySearchTreeNode.java | 17 +++ .../bjc/funcdata/bst/DirectedWalkFunction.java | 17 +++ .../bjc/funcdata/bst/TreeLinearizationMethod.java | 17 +++ src/main/java/bjc/funcdata/bst/TreePart.java | 17 +++ src/main/java/bjc/funcdata/theory/Bifunctor.java | 17 +++ src/main/java/bjc/funcdata/theory/Category.java | 17 +++ src/main/java/bjc/funcdata/theory/Functor.java | 17 +++ src/main/java/bjc/functypes/ArrayChooser.java | 17 +++ src/main/java/bjc/functypes/BiContainer.java | 22 +++ src/main/java/bjc/functypes/CombinatorBirds.java | 17 +++ src/main/java/bjc/functypes/Combinators.java | 24 +++- src/main/java/bjc/functypes/Container.java | 22 +++ src/main/java/bjc/functypes/ElseFunction.java | 17 +++ src/main/java/bjc/functypes/Fixpoints.java | 17 +++ src/main/java/bjc/functypes/ForEach.java | 17 +++ .../java/bjc/functypes/FunctionalIsomorphism.java | 17 +++ src/main/java/bjc/functypes/ID.java | 17 +++ src/main/java/bjc/functypes/IntArrayChooser.java | 17 +++ src/main/java/bjc/functypes/Isomorphism.java | 17 +++ src/main/java/bjc/functypes/ListC.java | 32 +++++ src/main/java/bjc/functypes/ListFlattener.java | 17 +++ src/main/java/bjc/functypes/Natural.java | 34 +++++ src/main/java/bjc/functypes/ThrowFunction.java | 17 +++ src/main/java/bjc/functypes/Thrower.java | 17 +++ src/main/java/bjc/functypes/TriFunction.java | 17 +++ src/main/java/bjc/functypes/Unit.java | 17 +++ src/main/java/bjc/functypes/optics/Lens.java | 17 +++ src/main/java/bjc/functypes/optics/LensX.java | 17 +++ src/main/java/bjc/functypes/optics/Lenses.java | 17 +++ .../java/bjc/functypes/optics/MutableLens.java | 17 +++ src/main/java/bjc/functypes/optics/Optic.java | 17 +++ src/main/java/bjc/functypes/optics/PrismX.java | 17 +++ .../bjc/functypes/optics/impl/package-info.java | 17 +++ .../java/bjc/functypes/optics/package-info.java | 17 +++ src/main/java/module-info.java | 17 +++ 118 files changed, 2307 insertions(+), 109 deletions(-) create mode 100644 src/main/java/bjc/esodata/KeyedList.java create mode 100644 src/main/java/bjc/esodata/TSetMultimap.java create mode 100644 src/main/java/bjc/functypes/BiContainer.java create mode 100644 src/main/java/bjc/functypes/Container.java create mode 100644 src/main/java/bjc/functypes/ListC.java create mode 100644 src/main/java/bjc/functypes/Natural.java (limited to 'src/main') diff --git a/src/main/java/bjc/data/ArrayIterator.java b/src/main/java/bjc/data/ArrayIterator.java index c5f68cc..f89210f 100644 --- a/src/main/java/bjc/data/ArrayIterator.java +++ b/src/main/java/bjc/data/ArrayIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.Iterator; diff --git a/src/main/java/bjc/data/BooleanToggle.java b/src/main/java/bjc/data/BooleanToggle.java index e0286d4..56cbdf0 100644 --- a/src/main/java/bjc/data/BooleanToggle.java +++ b/src/main/java/bjc/data/BooleanToggle.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; /** diff --git a/src/main/java/bjc/data/CircularIterator.java b/src/main/java/bjc/data/CircularIterator.java index ce6b4c3..a718524 100644 --- a/src/main/java/bjc/data/CircularIterator.java +++ b/src/main/java/bjc/data/CircularIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.Iterator; diff --git a/src/main/java/bjc/data/Context.java b/src/main/java/bjc/data/Context.java index 7efdc4d..f52160d 100644 --- a/src/main/java/bjc/data/Context.java +++ b/src/main/java/bjc/data/Context.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; /** diff --git a/src/main/java/bjc/data/Contexts.java b/src/main/java/bjc/data/Contexts.java index f587fe6..699a450 100644 --- a/src/main/java/bjc/data/Contexts.java +++ b/src/main/java/bjc/data/Contexts.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/Either.java b/src/main/java/bjc/data/Either.java index 90efba7..42d2e99 100644 --- a/src/main/java/bjc/data/Either.java +++ b/src/main/java/bjc/data/Either.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/GeneratingIterator.java b/src/main/java/bjc/data/GeneratingIterator.java index 8900b94..5b46c4f 100644 --- a/src/main/java/bjc/data/GeneratingIterator.java +++ b/src/main/java/bjc/data/GeneratingIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.Iterator; diff --git a/src/main/java/bjc/data/Holder.java b/src/main/java/bjc/data/Holder.java index f01812e..4a1de75 100644 --- a/src/main/java/bjc/data/Holder.java +++ b/src/main/java/bjc/data/Holder.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.Consumer; diff --git a/src/main/java/bjc/data/Identity.java b/src/main/java/bjc/data/Identity.java index fc4798e..174e2c9 100644 --- a/src/main/java/bjc/data/Identity.java +++ b/src/main/java/bjc/data/Identity.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.Function; diff --git a/src/main/java/bjc/data/IntHolder.java b/src/main/java/bjc/data/IntHolder.java index 2783669..c5d088a 100644 --- a/src/main/java/bjc/data/IntHolder.java +++ b/src/main/java/bjc/data/IntHolder.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; /** diff --git a/src/main/java/bjc/data/Lazy.java b/src/main/java/bjc/data/Lazy.java index b237935..45293e2 100644 --- a/src/main/java/bjc/data/Lazy.java +++ b/src/main/java/bjc/data/Lazy.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.Function; diff --git a/src/main/java/bjc/data/LazyPair.java b/src/main/java/bjc/data/LazyPair.java index 048254a..b8297af 100644 --- a/src/main/java/bjc/data/LazyPair.java +++ b/src/main/java/bjc/data/LazyPair.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.BiFunction; diff --git a/src/main/java/bjc/data/ListHolder.java b/src/main/java/bjc/data/ListHolder.java index c8a75ff..4e2594c 100644 --- a/src/main/java/bjc/data/ListHolder.java +++ b/src/main/java/bjc/data/ListHolder.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.Function; diff --git a/src/main/java/bjc/data/MarkListIterator.java b/src/main/java/bjc/data/MarkListIterator.java index 35baa28..97f5641 100644 --- a/src/main/java/bjc/data/MarkListIterator.java +++ b/src/main/java/bjc/data/MarkListIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/NonCMEIterator.java b/src/main/java/bjc/data/NonCMEIterator.java index 88eaa6b..70cd2cf 100644 --- a/src/main/java/bjc/data/NonCMEIterator.java +++ b/src/main/java/bjc/data/NonCMEIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/NonCMEListIterator.java b/src/main/java/bjc/data/NonCMEListIterator.java index 6e74a24..bd22f6f 100644 --- a/src/main/java/bjc/data/NonCMEListIterator.java +++ b/src/main/java/bjc/data/NonCMEListIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/OneWayToggle.java b/src/main/java/bjc/data/OneWayToggle.java index b6074b0..0705344 100644 --- a/src/main/java/bjc/data/OneWayToggle.java +++ b/src/main/java/bjc/data/OneWayToggle.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; /** diff --git a/src/main/java/bjc/data/Option.java b/src/main/java/bjc/data/Option.java index 6ca8b13..4118cc8 100644 --- a/src/main/java/bjc/data/Option.java +++ b/src/main/java/bjc/data/Option.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.Function; diff --git a/src/main/java/bjc/data/Pair.java b/src/main/java/bjc/data/Pair.java index 1d4be5e..fe65936 100644 --- a/src/main/java/bjc/data/Pair.java +++ b/src/main/java/bjc/data/Pair.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.Formattable; diff --git a/src/main/java/bjc/data/PetriNet.java b/src/main/java/bjc/data/PetriNet.java index 5fced8e..b4c08e1 100644 --- a/src/main/java/bjc/data/PetriNet.java +++ b/src/main/java/bjc/data/PetriNet.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/PetriTransition.java b/src/main/java/bjc/data/PetriTransition.java index d1d20f9..79f879d 100644 --- a/src/main/java/bjc/data/PetriTransition.java +++ b/src/main/java/bjc/data/PetriTransition.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/QueuedIterator.java b/src/main/java/bjc/data/QueuedIterator.java index 805fc5e..044bd65 100644 --- a/src/main/java/bjc/data/QueuedIterator.java +++ b/src/main/java/bjc/data/QueuedIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.ArrayDeque; diff --git a/src/main/java/bjc/data/ResettableIterator.java b/src/main/java/bjc/data/ResettableIterator.java index 8c1c4aa..29c56df 100644 --- a/src/main/java/bjc/data/ResettableIterator.java +++ b/src/main/java/bjc/data/ResettableIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/ReverseListIterator.java b/src/main/java/bjc/data/ReverseListIterator.java index 0b6ec84..273d4c7 100644 --- a/src/main/java/bjc/data/ReverseListIterator.java +++ b/src/main/java/bjc/data/ReverseListIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.*; diff --git a/src/main/java/bjc/data/SimplePair.java b/src/main/java/bjc/data/SimplePair.java index 48f5ca3..e5de68f 100644 --- a/src/main/java/bjc/data/SimplePair.java +++ b/src/main/java/bjc/data/SimplePair.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.BiFunction; diff --git a/src/main/java/bjc/data/SimpleTree.java b/src/main/java/bjc/data/SimpleTree.java index 7d9fb6d..826b1b3 100644 --- a/src/main/java/bjc/data/SimpleTree.java +++ b/src/main/java/bjc/data/SimpleTree.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.BiFunction; diff --git a/src/main/java/bjc/data/SingleIterator.java b/src/main/java/bjc/data/SingleIterator.java index 1598774..19b9d90 100644 --- a/src/main/java/bjc/data/SingleIterator.java +++ b/src/main/java/bjc/data/SingleIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.Iterator; diff --git a/src/main/java/bjc/data/SingleSupplier.java b/src/main/java/bjc/data/SingleSupplier.java index 010b06e..1b020a4 100644 --- a/src/main/java/bjc/data/SingleSupplier.java +++ b/src/main/java/bjc/data/SingleSupplier.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.Supplier; diff --git a/src/main/java/bjc/data/Toggle.java b/src/main/java/bjc/data/Toggle.java index 17c5a8e..6351858 100644 --- a/src/main/java/bjc/data/Toggle.java +++ b/src/main/java/bjc/data/Toggle.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; /** diff --git a/src/main/java/bjc/data/TopDownTransformIterator.java b/src/main/java/bjc/data/TopDownTransformIterator.java index 28df590..33d4718 100644 --- a/src/main/java/bjc/data/TopDownTransformIterator.java +++ b/src/main/java/bjc/data/TopDownTransformIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import static bjc.data.TopDownTransformResult.RTRANSFORM; diff --git a/src/main/java/bjc/data/TopDownTransformResult.java b/src/main/java/bjc/data/TopDownTransformResult.java index 0633cec..61f1a4d 100644 --- a/src/main/java/bjc/data/TopDownTransformResult.java +++ b/src/main/java/bjc/data/TopDownTransformResult.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; /** diff --git a/src/main/java/bjc/data/TransformIterator.java b/src/main/java/bjc/data/TransformIterator.java index 29f91e2..35b448f 100644 --- a/src/main/java/bjc/data/TransformIterator.java +++ b/src/main/java/bjc/data/TransformIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.Iterator; diff --git a/src/main/java/bjc/data/Tree.java b/src/main/java/bjc/data/Tree.java index 784bf0e..039a813 100644 --- a/src/main/java/bjc/data/Tree.java +++ b/src/main/java/bjc/data/Tree.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; import java.util.function.BiFunction; diff --git a/src/main/java/bjc/data/ValueToggle.java b/src/main/java/bjc/data/ValueToggle.java index 9e4b83b..4e9f7c0 100644 --- a/src/main/java/bjc/data/ValueToggle.java +++ b/src/main/java/bjc/data/ValueToggle.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data; /** diff --git a/src/main/java/bjc/data/internals/BoundLazy.java b/src/main/java/bjc/data/internals/BoundLazy.java index 0e0e95c..115abd8 100644 --- a/src/main/java/bjc/data/internals/BoundLazy.java +++ b/src/main/java/bjc/data/internals/BoundLazy.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data.internals; import java.util.function.Function; diff --git a/src/main/java/bjc/data/internals/BoundLazyPair.java b/src/main/java/bjc/data/internals/BoundLazyPair.java index 91981de..432ebdc 100644 --- a/src/main/java/bjc/data/internals/BoundLazyPair.java +++ b/src/main/java/bjc/data/internals/BoundLazyPair.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data.internals; import java.util.function.BiFunction; diff --git a/src/main/java/bjc/data/internals/BoundListHolder.java b/src/main/java/bjc/data/internals/BoundListHolder.java index c944252..3af5720 100644 --- a/src/main/java/bjc/data/internals/BoundListHolder.java +++ b/src/main/java/bjc/data/internals/BoundListHolder.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data.internals; import java.util.function.Function; diff --git a/src/main/java/bjc/data/internals/HalfBoundLazyPair.java b/src/main/java/bjc/data/internals/HalfBoundLazyPair.java index 849b973..b59ac68 100644 --- a/src/main/java/bjc/data/internals/HalfBoundLazyPair.java +++ b/src/main/java/bjc/data/internals/HalfBoundLazyPair.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data.internals; import java.util.function.BiFunction; diff --git a/src/main/java/bjc/data/internals/WrappedLazy.java b/src/main/java/bjc/data/internals/WrappedLazy.java index 624fb1b..138991a 100644 --- a/src/main/java/bjc/data/internals/WrappedLazy.java +++ b/src/main/java/bjc/data/internals/WrappedLazy.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data.internals; import java.util.function.Function; diff --git a/src/main/java/bjc/data/internals/WrappedOption.java b/src/main/java/bjc/data/internals/WrappedOption.java index f46d501..b71e150 100644 --- a/src/main/java/bjc/data/internals/WrappedOption.java +++ b/src/main/java/bjc/data/internals/WrappedOption.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.data.internals; import java.util.function.Function; diff --git a/src/main/java/bjc/esodata/AbbrevMap2.java b/src/main/java/bjc/esodata/AbbrevMap2.java index 341a28d..72bd4c8 100644 --- a/src/main/java/bjc/esodata/AbbrevMap2.java +++ b/src/main/java/bjc/esodata/AbbrevMap2.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; @@ -25,7 +42,7 @@ public class AbbrevMap2 { * Create a new abbreviation map. */ public AbbrevMap2() { - backing = new Multimap<>(); + backing = new TSetMultimap<>(); } /** diff --git a/src/main/java/bjc/esodata/AbbrevTree.java b/src/main/java/bjc/esodata/AbbrevTree.java index 35c44f0..c2ad8db 100644 --- a/src/main/java/bjc/esodata/AbbrevTree.java +++ b/src/main/java/bjc/esodata/AbbrevTree.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; @@ -22,7 +39,7 @@ import bjc.funcdata.ListEx; * @param The type of data contained in the nodes. */ public class AbbrevTree implements Iterable> { - private Multimap> labelledNodes; + private TSetMultimap> labelledNodes; private Map> children; private AbbrevTree parent; @@ -34,7 +51,7 @@ public class AbbrevTree implements Iterable(); + labelledNodes = new TSetMultimap<>(); children = new HashMap<>(); } @@ -57,7 +74,7 @@ public class AbbrevTree implements Iterable parent) { - labelledNodes = new Multimap<>(); + labelledNodes = new TSetMultimap<>(); children = new HashMap<>(); this.parent = parent; diff --git a/src/main/java/bjc/esodata/DefaultList.java b/src/main/java/bjc/esodata/DefaultList.java index e622301..727eafd 100644 --- a/src/main/java/bjc/esodata/DefaultList.java +++ b/src/main/java/bjc/esodata/DefaultList.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.AbstractList; diff --git a/src/main/java/bjc/esodata/Directory.java b/src/main/java/bjc/esodata/Directory.java index fa47b6f..feeb25c 100644 --- a/src/main/java/bjc/esodata/Directory.java +++ b/src/main/java/bjc/esodata/Directory.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; /** diff --git a/src/main/java/bjc/esodata/DoubleSided.java b/src/main/java/bjc/esodata/DoubleSided.java index 8ac6684..0ec417a 100644 --- a/src/main/java/bjc/esodata/DoubleSided.java +++ b/src/main/java/bjc/esodata/DoubleSided.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; /** diff --git a/src/main/java/bjc/esodata/DoubleTape.java b/src/main/java/bjc/esodata/DoubleTape.java index 30d94a1..e7ba98c 100644 --- a/src/main/java/bjc/esodata/DoubleTape.java +++ b/src/main/java/bjc/esodata/DoubleTape.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; /** diff --git a/src/main/java/bjc/esodata/FlatNestIterator.java b/src/main/java/bjc/esodata/FlatNestIterator.java index 42981f5..60463d8 100644 --- a/src/main/java/bjc/esodata/FlatNestIterator.java +++ b/src/main/java/bjc/esodata/FlatNestIterator.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; diff --git a/src/main/java/bjc/esodata/KeyedList.java b/src/main/java/bjc/esodata/KeyedList.java new file mode 100644 index 0000000..5b0d6cc --- /dev/null +++ b/src/main/java/bjc/esodata/KeyedList.java @@ -0,0 +1,123 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bjc.esodata; + +import java.util.*; + +public class KeyedList implements Iterable { + private List backing; + private Map indices; + + private int currIdx = 0; + + public KeyedList() { + backing = new ArrayList<>(); + indices = new HashMap<>(); + } + + /** + * Add a item to this list. + * + * If an item already exists with the given key, the current one will not be + * added. Use set to handle that. + * + * @param key The key for this item. + * @param val The value for this item + * + * @return Whether or not this item was added to the list + */ + public boolean add(Key key, Val val) { + // TODO: Determine if this is the desired behavior + if (indices.containsKey(key)) + return false; + + backing.add(val); + indices.put(key, currIdx++); + return true; + } + + /** + * Set the item associated with a given key. + * + * @param key The key to set + * @param newVal The new value for the key + * + * @return The previous value for the key, if there was one + */ + public Val set(Key key, Val newVal) { + if (indices.containsKey(key)) { + return backing.set(indices.get(key), newVal); + } + + add(key, newVal); + return null; + } + + /** + * Retrieve all of the keys for this list. + * + * @return An immutable set of the keys for this list + */ + public Set keys() { + // TODO: write mutable wrapper which will update the list appropriately + return Collections.unmodifiableSet(indices.keySet()); + } + + /** + * Retrieve the value associated with the given key. + * + * @param key The key to look up. + * + * @return The value for the given key. + */ + public Val get(Key key) { + return backing.get(indices.get(key)); + } + + /** + * Check if this list contains a value for a given key. + * + * @param key The key to look up. + * + * @return Whether this list contains a value for the given key. + */ + public boolean containsKey(Key key) { + return indices.containsKey(key); + } + + @Override + public Iterator iterator() { + return backing.iterator(); + } + + /** + * Return an iterator that starts at the value for the given key.' + * + * @param key The key to start at. + * + * @return An iterator starting at the given key, or null if the key isn't + * present. + */ + public ListIterator iteratorFrom(Key key) { + if (indices.containsKey(key)) { + return backing.listIterator(indices.get(key)); + } + + return null; + } +} diff --git a/src/main/java/bjc/esodata/MapSet.java b/src/main/java/bjc/esodata/MapSet.java index 7d77ad6..ade6219 100644 --- a/src/main/java/bjc/esodata/MapSet.java +++ b/src/main/java/bjc/esodata/MapSet.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.AbstractMap; diff --git a/src/main/java/bjc/esodata/MinMaxList.java b/src/main/java/bjc/esodata/MinMaxList.java index 6747831..50b0ea0 100644 --- a/src/main/java/bjc/esodata/MinMaxList.java +++ b/src/main/java/bjc/esodata/MinMaxList.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; diff --git a/src/main/java/bjc/esodata/Multimap.java b/src/main/java/bjc/esodata/Multimap.java index e18ed49..d0c0b4b 100644 --- a/src/main/java/bjc/esodata/Multimap.java +++ b/src/main/java/bjc/esodata/Multimap.java @@ -1,153 +1,102 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; -import java.util.Map.Entry; import bjc.data.Pair; /** - * A map that has support for multiple values for a given key. - * - * Whenever you give another value for a key, that is then returned for that - * key. About the only somewhat complex thing, is that, if you add the same - * key-value pair multiple times, it will only show up once. However, you will - * have to remove that pair as many times as you added it. + * A map that supports multiple values for a given key. + * + * The thing that will tend to vary with the implementation is what they do with + * duplicate values for the same key. + * + * @author bjcul * - * @author Ben Culkin - * @param The type of keys in the map. - * @param The type of values in the map. + * @param The key type of the map + * @param The value type of the map. */ -public class Multimap implements Iterable> { - private Map> backing; - - /** - * Create a new empty multimap. - */ - public Multimap() { - backing = new HashMap<>(); - } - +public interface Multimap { /** * Add a key-value mapping to the map. * - * @param key - * The key to store the value under. + * @param key The key to store the value under. * - * @param value - * The value to store. + * @param value The value to store. */ - public void add(KeyType key, ValueType value) { - ThresholdSet container - = backing.computeIfAbsent(key, k -> new ThresholdSet<>()); - - container.add(value); - } + void add(KeyType key, ValueType value); /** * Delete a particular key-value mapping from the map. * - * @param key - * The key of the mapping to remove. + * @param key The key of the mapping to remove. * - * @param value - * The value of the mapping to remove. + * @param value The value of the mapping to remove. */ - public void remove(KeyType key, ValueType value) { - // We have no values for that key; bail. - if (!backing.containsKey(key)) return; - - backing.get(key).remove(value); - } + void remove(KeyType key, ValueType value); /** * Delete all of the values associated with a particular key. * - * @param key - * The key to remove values for. + * @param key The key to remove values for. */ - public void remove(KeyType key) { - backing.remove(key); - } + void remove(KeyType key); /** * Get a set containing all of the values that are recorded for that key. * - * @param key - * The key to look up values for. + * @param key The key to look up values for. * * @return A set containing all of the values that have been mapped to that key. */ - public Set get(KeyType key) { - if (!backing.containsKey(key)) return new HashSet<>(); - else return backing.get(key).values(); - } + Set get(KeyType key); /** * Get the single value in the map, if there is one. + * * @param key The key to look up - * @return An optional containing the key if it is there once, or empty if it is there either no or more than one times + * @return An optional containing the key if it is there once, or empty if it is + * there either no or more than one times */ - public Optional getSingle(KeyType key) { - Set set = get(key); - - if (set.size() == 1) return Optional.of(set.iterator().next()); - return Optional.empty(); - } + Optional getSingle(KeyType key); + /** * Check if there is at least one value mapped to the given key. * - * @param key - * The key to check for mappings for. + * @param key The key to check for mappings for. * * @return Whether or not there is at least one value mapped to the key. */ - public boolean contains(KeyType key) { - return backing.containsKey(key); - } + boolean contains(KeyType key); /** * Check if there is at least one instance of a particular key-value mapping. * - * @param key - * The key to check for mappings for. + * @param key The key to check for mappings for. * - * @param value - * The value to check for mappings for. + * @param value The value to check for mappings for. * * @return Whether or not there is at least one instance of the given key-value * mapping. */ - public boolean contains(KeyType key, ValueType value) { - if (!backing.containsKey(key)) return false; + boolean contains(KeyType key, ValueType value); + + Iterator> iterator(); - return backing.get(key).contains(value) > 0; - } - - @Override - public Iterator> iterator() { - return new Iterator<>() { - private Iterator>> mapIter = backing.entrySet().iterator(); - private KeyType currKey; - private Iterator setIter; - - @Override - public boolean hasNext() { - while (setIter == null || !setIter.hasNext()) { - if (!mapIter.hasNext()) return false; - Entry> entry = mapIter.next(); - - currKey = entry.getKey(); - setIter = entry.getValue().setView().iterator(); - } - - return setIter.hasNext(); - } - - @Override - public Pair next() { - if (setIter == null || !setIter.hasNext()) throw new NoSuchElementException(); - return Pair.pair(currKey, setIter.next()) ; - } - }; - } -} +} \ No newline at end of file diff --git a/src/main/java/bjc/esodata/NestList.java b/src/main/java/bjc/esodata/NestList.java index 9d9149c..c1544ca 100644 --- a/src/main/java/bjc/esodata/NestList.java +++ b/src/main/java/bjc/esodata/NestList.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import static bjc.functypes.Combinators.*; diff --git a/src/main/java/bjc/esodata/PairMap.java b/src/main/java/bjc/esodata/PairMap.java index ba13a2f..0e01bd3 100644 --- a/src/main/java/bjc/esodata/PairMap.java +++ b/src/main/java/bjc/esodata/PairMap.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; @@ -29,8 +46,8 @@ public class PairMap implements Map, Value public PairMap() { this.backing = new HashMap<>(); - this.leftTracker = new Multimap<>(); - this.rightTracker = new Multimap<>(); + this.leftTracker = new TSetMultimap<>(); + this.rightTracker = new TSetMultimap<>(); } /** @@ -122,8 +139,8 @@ public class PairMap implements Map, Value public void clear() { backing.clear(); - leftTracker = new Multimap<>(); - rightTracker = new Multimap<>(); + leftTracker = new TSetMultimap<>(); + rightTracker = new TSetMultimap<>(); } // TODO: Update these to not break the tracking invariants diff --git a/src/main/java/bjc/esodata/PushdownMap.java b/src/main/java/bjc/esodata/PushdownMap.java index 76dd2db..a6e153c 100644 --- a/src/main/java/bjc/esodata/PushdownMap.java +++ b/src/main/java/bjc/esodata/PushdownMap.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; diff --git a/src/main/java/bjc/esodata/QueueStack.java b/src/main/java/bjc/esodata/QueueStack.java index e310f16..22b849a 100644 --- a/src/main/java/bjc/esodata/QueueStack.java +++ b/src/main/java/bjc/esodata/QueueStack.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.Deque; diff --git a/src/main/java/bjc/esodata/SimpleDirectory.java b/src/main/java/bjc/esodata/SimpleDirectory.java index 13a9f3e..4cc6f35 100644 --- a/src/main/java/bjc/esodata/SimpleDirectory.java +++ b/src/main/java/bjc/esodata/SimpleDirectory.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import bjc.funcdata.FunctionalMap; diff --git a/src/main/java/bjc/esodata/SimpleStack.java b/src/main/java/bjc/esodata/SimpleStack.java index 9c016c3..55d4000 100644 --- a/src/main/java/bjc/esodata/SimpleStack.java +++ b/src/main/java/bjc/esodata/SimpleStack.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.Deque; diff --git a/src/main/java/bjc/esodata/SingleTape.java b/src/main/java/bjc/esodata/SingleTape.java index 7c3a34f..ff34178 100644 --- a/src/main/java/bjc/esodata/SingleTape.java +++ b/src/main/java/bjc/esodata/SingleTape.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.ArrayList; diff --git a/src/main/java/bjc/esodata/SpaghettiStack.java b/src/main/java/bjc/esodata/SpaghettiStack.java index 4bd77d3..ab57646 100644 --- a/src/main/java/bjc/esodata/SpaghettiStack.java +++ b/src/main/java/bjc/esodata/SpaghettiStack.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.Arrays; diff --git a/src/main/java/bjc/esodata/Stack.java b/src/main/java/bjc/esodata/Stack.java index 9dfee17..6027a23 100644 --- a/src/main/java/bjc/esodata/Stack.java +++ b/src/main/java/bjc/esodata/Stack.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; diff --git a/src/main/java/bjc/esodata/TSetMultimap.java b/src/main/java/bjc/esodata/TSetMultimap.java new file mode 100644 index 0000000..1a04a41 --- /dev/null +++ b/src/main/java/bjc/esodata/TSetMultimap.java @@ -0,0 +1,124 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bjc.esodata; + +import java.util.*; +import java.util.Map.Entry; + +import bjc.data.Pair; + +/** + * A map that has support for multiple values for a given key. + * + * Whenever you give another value for a key, that is then returned for that + * key. About the only somewhat complex thing, is that, if you add the same + * key-value pair multiple times, it will only show up once. However, you will + * have to remove that pair as many times as you added it. + * + * @author Ben Culkin + * + * @param The type of keys in the map. + * @param The type of values in the map. + */ +public class TSetMultimap implements Iterable>, Multimap { + private final class SetMultimapIterator implements Iterator> { + private Iterator>> mapIter = backing.entrySet().iterator(); + private KeyType currKey; + private Iterator setIter; + + @Override + public boolean hasNext() { + while (setIter == null || !setIter.hasNext()) { + if (!mapIter.hasNext()) return false; + Entry> entry = mapIter.next(); + + currKey = entry.getKey(); + setIter = entry.getValue().setView().iterator(); + } + + return setIter.hasNext(); + } + + @Override + public Pair next() { + if (setIter == null || !setIter.hasNext()) throw new NoSuchElementException(); + return Pair.pair(currKey, setIter.next()) ; + } + } + + private Map> backing; + + /** + * Create a new empty multimap. + */ + public TSetMultimap() { + backing = new HashMap<>(); + } + + @Override + public void add(KeyType key, ValueType value) { + ThresholdSet container + = backing.computeIfAbsent(key, k -> new ThresholdSet<>()); + + container.add(value); + } + + @Override + public void remove(KeyType key, ValueType value) { + // We have no values for that key; bail. + if (!backing.containsKey(key)) return; + + backing.get(key).remove(value); + } + + @Override + public void remove(KeyType key) { + backing.remove(key); + } + + @Override + public Set get(KeyType key) { + if (!backing.containsKey(key)) return new HashSet<>(); + else return backing.get(key).values(); + } + + @Override + public Optional getSingle(KeyType key) { + Set set = get(key); + + if (set.size() == 1) return Optional.of(set.iterator().next()); + return Optional.empty(); + } + + @Override + public boolean contains(KeyType key) { + return backing.containsKey(key); + } + + @Override + public boolean contains(KeyType key, ValueType value) { + if (!backing.containsKey(key)) return false; + + return backing.get(key).contains(value) > 0; + } + + @Override + public Iterator> iterator() { + return new SetMultimapIterator(); + } +} diff --git a/src/main/java/bjc/esodata/Tape.java b/src/main/java/bjc/esodata/Tape.java index 134ba62..efc3df7 100644 --- a/src/main/java/bjc/esodata/Tape.java +++ b/src/main/java/bjc/esodata/Tape.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; /** diff --git a/src/main/java/bjc/esodata/TapeLibrary.java b/src/main/java/bjc/esodata/TapeLibrary.java index 922833f..5fec28a 100644 --- a/src/main/java/bjc/esodata/TapeLibrary.java +++ b/src/main/java/bjc/esodata/TapeLibrary.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; diff --git a/src/main/java/bjc/esodata/TapeView.java b/src/main/java/bjc/esodata/TapeView.java index bfc33a9..94192d8 100644 --- a/src/main/java/bjc/esodata/TapeView.java +++ b/src/main/java/bjc/esodata/TapeView.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; /** diff --git a/src/main/java/bjc/esodata/ThresholdSet.java b/src/main/java/bjc/esodata/ThresholdSet.java index c13bad3..645d4d3 100644 --- a/src/main/java/bjc/esodata/ThresholdSet.java +++ b/src/main/java/bjc/esodata/ThresholdSet.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import java.util.*; diff --git a/src/main/java/bjc/esodata/UnifiedDirectory.java b/src/main/java/bjc/esodata/UnifiedDirectory.java index 1b630eb..3b521c0 100644 --- a/src/main/java/bjc/esodata/UnifiedDirectory.java +++ b/src/main/java/bjc/esodata/UnifiedDirectory.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata; import bjc.funcdata.FunctionalMap; diff --git a/src/main/java/bjc/esodata/spool/Spool.java b/src/main/java/bjc/esodata/spool/Spool.java index dbd2ce8..80e8a8c 100644 --- a/src/main/java/bjc/esodata/spool/Spool.java +++ b/src/main/java/bjc/esodata/spool/Spool.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata.spool; public interface Spool { diff --git a/src/main/java/bjc/esodata/spool/Spooler.java b/src/main/java/bjc/esodata/spool/Spooler.java index a222a25..133df2e 100644 --- a/src/main/java/bjc/esodata/spool/Spooler.java +++ b/src/main/java/bjc/esodata/spool/Spooler.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.esodata.spool; public interface Spooler { diff --git a/src/main/java/bjc/funcdata/CList.java b/src/main/java/bjc/funcdata/CList.java index b9ee10e..4995b61 100644 --- a/src/main/java/bjc/funcdata/CList.java +++ b/src/main/java/bjc/funcdata/CList.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.function.UnaryOperator; diff --git a/src/main/java/bjc/funcdata/CListLike.java b/src/main/java/bjc/funcdata/CListLike.java index ba17456..9742fc5 100644 --- a/src/main/java/bjc/funcdata/CListLike.java +++ b/src/main/java/bjc/funcdata/CListLike.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; public interface CListLike { diff --git a/src/main/java/bjc/funcdata/CListStructure.java b/src/main/java/bjc/funcdata/CListStructure.java index 1809273..390a47e 100644 --- a/src/main/java/bjc/funcdata/CListStructure.java +++ b/src/main/java/bjc/funcdata/CListStructure.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import bjc.data.Either; diff --git a/src/main/java/bjc/funcdata/ExtendedMap.java b/src/main/java/bjc/funcdata/ExtendedMap.java index 379ff65..4bee343 100644 --- a/src/main/java/bjc/funcdata/ExtendedMap.java +++ b/src/main/java/bjc/funcdata/ExtendedMap.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.*; diff --git a/src/main/java/bjc/funcdata/Freezable.java b/src/main/java/bjc/funcdata/Freezable.java index 8bb037c..c337509 100644 --- a/src/main/java/bjc/funcdata/Freezable.java +++ b/src/main/java/bjc/funcdata/Freezable.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; /** diff --git a/src/main/java/bjc/funcdata/FunctionalList.java b/src/main/java/bjc/funcdata/FunctionalList.java index c9c3a9f..ae7ae3a 100644 --- a/src/main/java/bjc/funcdata/FunctionalList.java +++ b/src/main/java/bjc/funcdata/FunctionalList.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.ArrayList; diff --git a/src/main/java/bjc/funcdata/FunctionalMap.java b/src/main/java/bjc/funcdata/FunctionalMap.java index 3427a91..33a97e6 100644 --- a/src/main/java/bjc/funcdata/FunctionalMap.java +++ b/src/main/java/bjc/funcdata/FunctionalMap.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.*; diff --git a/src/main/java/bjc/funcdata/FunctionalStringTokenizer.java b/src/main/java/bjc/funcdata/FunctionalStringTokenizer.java index 3344e05..211be85 100644 --- a/src/main/java/bjc/funcdata/FunctionalStringTokenizer.java +++ b/src/main/java/bjc/funcdata/FunctionalStringTokenizer.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.StringTokenizer; diff --git a/src/main/java/bjc/funcdata/ListEx.java b/src/main/java/bjc/funcdata/ListEx.java index 164a71d..fd947cf 100644 --- a/src/main/java/bjc/funcdata/ListEx.java +++ b/src/main/java/bjc/funcdata/ListEx.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.Comparator; diff --git a/src/main/java/bjc/funcdata/MapEx.java b/src/main/java/bjc/funcdata/MapEx.java index a7af4c5..1dad1dc 100644 --- a/src/main/java/bjc/funcdata/MapEx.java +++ b/src/main/java/bjc/funcdata/MapEx.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.*; diff --git a/src/main/java/bjc/funcdata/ObjectFrozen.java b/src/main/java/bjc/funcdata/ObjectFrozen.java index a9f58b8..2951ec3 100644 --- a/src/main/java/bjc/funcdata/ObjectFrozen.java +++ b/src/main/java/bjc/funcdata/ObjectFrozen.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; /** diff --git a/src/main/java/bjc/funcdata/SentryList.java b/src/main/java/bjc/funcdata/SentryList.java index b0554f5..e890370 100644 --- a/src/main/java/bjc/funcdata/SentryList.java +++ b/src/main/java/bjc/funcdata/SentryList.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.List; diff --git a/src/main/java/bjc/funcdata/TransformedValueMap.java b/src/main/java/bjc/funcdata/TransformedValueMap.java index 643f610..57fe155 100644 --- a/src/main/java/bjc/funcdata/TransformedValueMap.java +++ b/src/main/java/bjc/funcdata/TransformedValueMap.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata; import java.util.*; diff --git a/src/main/java/bjc/funcdata/bst/BinarySearchTree.java b/src/main/java/bjc/funcdata/bst/BinarySearchTree.java index 99b67cd..7cec49a 100644 --- a/src/main/java/bjc/funcdata/bst/BinarySearchTree.java +++ b/src/main/java/bjc/funcdata/bst/BinarySearchTree.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.bst; import java.util.ArrayList; diff --git a/src/main/java/bjc/funcdata/bst/BinarySearchTreeLeaf.java b/src/main/java/bjc/funcdata/bst/BinarySearchTreeLeaf.java index 9532555..fe9ad00 100644 --- a/src/main/java/bjc/funcdata/bst/BinarySearchTreeLeaf.java +++ b/src/main/java/bjc/funcdata/bst/BinarySearchTreeLeaf.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.bst; import java.util.Comparator; diff --git a/src/main/java/bjc/funcdata/bst/BinarySearchTreeNode.java b/src/main/java/bjc/funcdata/bst/BinarySearchTreeNode.java index 0eef92a..12ed209 100644 --- a/src/main/java/bjc/funcdata/bst/BinarySearchTreeNode.java +++ b/src/main/java/bjc/funcdata/bst/BinarySearchTreeNode.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.bst; import static bjc.funcdata.bst.DirectedWalkFunction.DirectedWalkResult.FAILURE; diff --git a/src/main/java/bjc/funcdata/bst/DirectedWalkFunction.java b/src/main/java/bjc/funcdata/bst/DirectedWalkFunction.java index 4f64339..b0cb76f 100644 --- a/src/main/java/bjc/funcdata/bst/DirectedWalkFunction.java +++ b/src/main/java/bjc/funcdata/bst/DirectedWalkFunction.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.bst; /** diff --git a/src/main/java/bjc/funcdata/bst/TreeLinearizationMethod.java b/src/main/java/bjc/funcdata/bst/TreeLinearizationMethod.java index 666834f..973a8dd 100644 --- a/src/main/java/bjc/funcdata/bst/TreeLinearizationMethod.java +++ b/src/main/java/bjc/funcdata/bst/TreeLinearizationMethod.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.bst; /** diff --git a/src/main/java/bjc/funcdata/bst/TreePart.java b/src/main/java/bjc/funcdata/bst/TreePart.java index b451463..999b5ca 100644 --- a/src/main/java/bjc/funcdata/bst/TreePart.java +++ b/src/main/java/bjc/funcdata/bst/TreePart.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.bst; import java.util.Comparator; diff --git a/src/main/java/bjc/funcdata/theory/Bifunctor.java b/src/main/java/bjc/funcdata/theory/Bifunctor.java index 72fccff..164a832 100644 --- a/src/main/java/bjc/funcdata/theory/Bifunctor.java +++ b/src/main/java/bjc/funcdata/theory/Bifunctor.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.theory; import java.util.function.Function; diff --git a/src/main/java/bjc/funcdata/theory/Category.java b/src/main/java/bjc/funcdata/theory/Category.java index 730465d..b5d8ee4 100644 --- a/src/main/java/bjc/funcdata/theory/Category.java +++ b/src/main/java/bjc/funcdata/theory/Category.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.theory; import java.util.Set; diff --git a/src/main/java/bjc/funcdata/theory/Functor.java b/src/main/java/bjc/funcdata/theory/Functor.java index 85a1ec7..7007325 100644 --- a/src/main/java/bjc/funcdata/theory/Functor.java +++ b/src/main/java/bjc/funcdata/theory/Functor.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.funcdata.theory; import java.util.function.Function; diff --git a/src/main/java/bjc/functypes/ArrayChooser.java b/src/main/java/bjc/functypes/ArrayChooser.java index 3baa00c..d8619c5 100644 --- a/src/main/java/bjc/functypes/ArrayChooser.java +++ b/src/main/java/bjc/functypes/ArrayChooser.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; /** diff --git a/src/main/java/bjc/functypes/BiContainer.java b/src/main/java/bjc/functypes/BiContainer.java new file mode 100644 index 0000000..db822ba --- /dev/null +++ b/src/main/java/bjc/functypes/BiContainer.java @@ -0,0 +1,22 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bjc.functypes; + +public interface BiContainer> { + // marker +} diff --git a/src/main/java/bjc/functypes/CombinatorBirds.java b/src/main/java/bjc/functypes/CombinatorBirds.java index d939a5b..55a53dd 100644 --- a/src/main/java/bjc/functypes/CombinatorBirds.java +++ b/src/main/java/bjc/functypes/CombinatorBirds.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.function.*; diff --git a/src/main/java/bjc/functypes/Combinators.java b/src/main/java/bjc/functypes/Combinators.java index 416230b..0b157bb 100644 --- a/src/main/java/bjc/functypes/Combinators.java +++ b/src/main/java/bjc/functypes/Combinators.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import static java.util.stream.Collectors.*; @@ -281,11 +298,16 @@ public class Combinators { public static Consumer ignore(Function func) { return (inp) -> func.apply(inp); } + + // TODO: write a switch-like combinator that uses a KeyedList to get the desired + // fallthrough semantics + + // TODO: non-shortcircuiting boolean combinators public static Function, Output> lazify(Function f) { return (supp) -> f.apply(supp.get()); } - + public static Function strictify(Function, Output> f) { return (val) -> f.apply(() -> val); } diff --git a/src/main/java/bjc/functypes/Container.java b/src/main/java/bjc/functypes/Container.java new file mode 100644 index 0000000..f000705 --- /dev/null +++ b/src/main/java/bjc/functypes/Container.java @@ -0,0 +1,22 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bjc.functypes; + +public interface Container> { + // Marker +} diff --git a/src/main/java/bjc/functypes/ElseFunction.java b/src/main/java/bjc/functypes/ElseFunction.java index b37fba8..930e167 100644 --- a/src/main/java/bjc/functypes/ElseFunction.java +++ b/src/main/java/bjc/functypes/ElseFunction.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.Optional; diff --git a/src/main/java/bjc/functypes/Fixpoints.java b/src/main/java/bjc/functypes/Fixpoints.java index 6d5a250..132d06c 100644 --- a/src/main/java/bjc/functypes/Fixpoints.java +++ b/src/main/java/bjc/functypes/Fixpoints.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.*; diff --git a/src/main/java/bjc/functypes/ForEach.java b/src/main/java/bjc/functypes/ForEach.java index 5c39298..964163f 100644 --- a/src/main/java/bjc/functypes/ForEach.java +++ b/src/main/java/bjc/functypes/ForEach.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.LinkedHashMap; diff --git a/src/main/java/bjc/functypes/FunctionalIsomorphism.java b/src/main/java/bjc/functypes/FunctionalIsomorphism.java index 8518338..43520e3 100644 --- a/src/main/java/bjc/functypes/FunctionalIsomorphism.java +++ b/src/main/java/bjc/functypes/FunctionalIsomorphism.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.function.Function; diff --git a/src/main/java/bjc/functypes/ID.java b/src/main/java/bjc/functypes/ID.java index 53a4c84..b9ef240 100644 --- a/src/main/java/bjc/functypes/ID.java +++ b/src/main/java/bjc/functypes/ID.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.function.UnaryOperator; diff --git a/src/main/java/bjc/functypes/IntArrayChooser.java b/src/main/java/bjc/functypes/IntArrayChooser.java index 416487e..1a62f41 100644 --- a/src/main/java/bjc/functypes/IntArrayChooser.java +++ b/src/main/java/bjc/functypes/IntArrayChooser.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; /** diff --git a/src/main/java/bjc/functypes/Isomorphism.java b/src/main/java/bjc/functypes/Isomorphism.java index db633e6..3393ed6 100644 --- a/src/main/java/bjc/functypes/Isomorphism.java +++ b/src/main/java/bjc/functypes/Isomorphism.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.function.*; diff --git a/src/main/java/bjc/functypes/ListC.java b/src/main/java/bjc/functypes/ListC.java new file mode 100644 index 0000000..78fbb7a --- /dev/null +++ b/src/main/java/bjc/functypes/ListC.java @@ -0,0 +1,32 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bjc.functypes; + +import java.util.List; + +public class ListC implements Container> { + private List contained; + + public ListC(List contained) { + this.contained = contained; + } + + public List list() { + return contained; + } +} diff --git a/src/main/java/bjc/functypes/ListFlattener.java b/src/main/java/bjc/functypes/ListFlattener.java index 91abe9d..fd3f22a 100644 --- a/src/main/java/bjc/functypes/ListFlattener.java +++ b/src/main/java/bjc/functypes/ListFlattener.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.function.Function; diff --git a/src/main/java/bjc/functypes/Natural.java b/src/main/java/bjc/functypes/Natural.java new file mode 100644 index 0000000..ecf12c4 --- /dev/null +++ b/src/main/java/bjc/functypes/Natural.java @@ -0,0 +1,34 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package bjc.functypes; + +@FunctionalInterface +public interface Natural, G extends Container> extends BiContainer> { + Container apply(Container val); + + public static Natural, ListC> listID() { + return new Natural<>() { + @Override + public ListC apply(Container> val) { + ListC lst = (ListC) val; + + return lst; + } + }; + } +} diff --git a/src/main/java/bjc/functypes/ThrowFunction.java b/src/main/java/bjc/functypes/ThrowFunction.java index 3714cad..2ec5bea 100644 --- a/src/main/java/bjc/functypes/ThrowFunction.java +++ b/src/main/java/bjc/functypes/ThrowFunction.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.*; diff --git a/src/main/java/bjc/functypes/Thrower.java b/src/main/java/bjc/functypes/Thrower.java index eb03eaf..b0fb770 100644 --- a/src/main/java/bjc/functypes/Thrower.java +++ b/src/main/java/bjc/functypes/Thrower.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.*; diff --git a/src/main/java/bjc/functypes/TriFunction.java b/src/main/java/bjc/functypes/TriFunction.java index e93e32d..988b311 100644 --- a/src/main/java/bjc/functypes/TriFunction.java +++ b/src/main/java/bjc/functypes/TriFunction.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; import java.util.function.BiFunction; diff --git a/src/main/java/bjc/functypes/Unit.java b/src/main/java/bjc/functypes/Unit.java index 75bdf62..9c2bca0 100644 --- a/src/main/java/bjc/functypes/Unit.java +++ b/src/main/java/bjc/functypes/Unit.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes; /** diff --git a/src/main/java/bjc/functypes/optics/Lens.java b/src/main/java/bjc/functypes/optics/Lens.java index 0a7d4cd..c56a016 100644 --- a/src/main/java/bjc/functypes/optics/Lens.java +++ b/src/main/java/bjc/functypes/optics/Lens.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes.optics; /** diff --git a/src/main/java/bjc/functypes/optics/LensX.java b/src/main/java/bjc/functypes/optics/LensX.java index d2e9c30..0c78370 100644 --- a/src/main/java/bjc/functypes/optics/LensX.java +++ b/src/main/java/bjc/functypes/optics/LensX.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes.optics; import static bjc.functypes.optics.Lenses.immutable; diff --git a/src/main/java/bjc/functypes/optics/Lenses.java b/src/main/java/bjc/functypes/optics/Lenses.java index 05a64e7..3c4c688 100644 --- a/src/main/java/bjc/functypes/optics/Lenses.java +++ b/src/main/java/bjc/functypes/optics/Lenses.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes.optics; import java.util.function.BiConsumer; diff --git a/src/main/java/bjc/functypes/optics/MutableLens.java b/src/main/java/bjc/functypes/optics/MutableLens.java index b6fca5d..9c2e635 100644 --- a/src/main/java/bjc/functypes/optics/MutableLens.java +++ b/src/main/java/bjc/functypes/optics/MutableLens.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes.optics; /** diff --git a/src/main/java/bjc/functypes/optics/Optic.java b/src/main/java/bjc/functypes/optics/Optic.java index 949eeca..513e110 100644 --- a/src/main/java/bjc/functypes/optics/Optic.java +++ b/src/main/java/bjc/functypes/optics/Optic.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes.optics; /** diff --git a/src/main/java/bjc/functypes/optics/PrismX.java b/src/main/java/bjc/functypes/optics/PrismX.java index a9c0dd2..b62bce3 100644 --- a/src/main/java/bjc/functypes/optics/PrismX.java +++ b/src/main/java/bjc/functypes/optics/PrismX.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes.optics; public interface PrismX extends Optic { diff --git a/src/main/java/bjc/functypes/optics/impl/package-info.java b/src/main/java/bjc/functypes/optics/impl/package-info.java index f309401..8ca00cf 100644 --- a/src/main/java/bjc/functypes/optics/impl/package-info.java +++ b/src/main/java/bjc/functypes/optics/impl/package-info.java @@ -1 +1,18 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package bjc.functypes.optics.impl; \ No newline at end of file diff --git a/src/main/java/bjc/functypes/optics/package-info.java b/src/main/java/bjc/functypes/optics/package-info.java index c187df9..a3f656c 100644 --- a/src/main/java/bjc/functypes/optics/package-info.java +++ b/src/main/java/bjc/functypes/optics/package-info.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /** * */ diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index fdbf1b6..edae185 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -1,3 +1,20 @@ +/* + * esodata - data structures and other things, of varying utility + * Copyright 2022, Ben Culkin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /** * Contains various more esoteric data structures. * -- cgit v1.2.3