|
| 1 | +/* |
| 2 | + * JavaPermutationTools: A Java library for computation on permutations and sequences |
| 3 | + * Copyright 2005-2022 Vincent A. Cicirello, <https://www.cicirello.org/>. |
| 4 | + * |
| 5 | + * This file is part of JavaPermutationTools (https://jpt.cicirello.org/). |
| 6 | + * |
| 7 | + * JavaPermutationTools is free software: you can |
| 8 | + * redistribute it and/or modify it under the terms of the GNU |
| 9 | + * General Public License as published by the Free Software |
| 10 | + * Foundation, either version 3 of the License, or (at your |
| 11 | + * option) any later version. |
| 12 | + * |
| 13 | + * JavaPermutationTools is distributed in the hope |
| 14 | + * that it will be useful, but WITHOUT ANY WARRANTY; without even |
| 15 | + * the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 16 | + * PARTICULAR PURPOSE. See the GNU General Public License for more |
| 17 | + * details. |
| 18 | + * |
| 19 | + * You should have received a copy of the GNU General Public License |
| 20 | + * along with JavaPermutationTools. If not, see <http://www.gnu.org/licenses/>. |
| 21 | + */ |
| 22 | +package org.cicirello.permutations; |
| 23 | + |
| 24 | +/** |
| 25 | + * A functional interface for defining custom binary operators on Permutations. |
| 26 | + * See the {@link Permutation#apply(PermutationBinaryOperator,Permutation)} method. |
| 27 | + * |
| 28 | + * @author <a href=https://www.cicirello.org/ target=_top>Vincent A. Cicirello</a>, |
| 29 | + * <a href=https://www.cicirello.org/ target=_top>https://www.cicirello.org/</a> |
| 30 | + */ |
| 31 | +@FunctionalInterface |
| 32 | +public interface PermutationBinaryOperator { |
| 33 | + |
| 34 | + /** |
| 35 | + * Applies an operator on the raw representations of |
| 36 | + * a pair of Permutations. Implementers of this interface are responsible |
| 37 | + * for ensuring that the apply method maintains valid |
| 38 | + * permutations of the integers in {0, 1, ..., rawPermutation1.length - 1 }, |
| 39 | + * and likewise for rawPermutation2. |
| 40 | + * |
| 41 | + * @param rawPermutation1 A reference to the raw array of ints underlying a |
| 42 | + * Permutation object. Changes to this array will directly change the Permutation |
| 43 | + * object that encapsulates it. |
| 44 | + * |
| 45 | + * @param rawPermutation2 A reference to the raw array of ints underlying a |
| 46 | + * Permutation object. Changes to this array will directly change the Permutation |
| 47 | + * object that encapsulates it. |
| 48 | + */ |
| 49 | + void apply(int[] rawPermutation1, int[] rawPermutation2); |
| 50 | +} |
0 commit comments