/** * Returns whether this program is a permutation of its inputs. */ public boolean isPermutation() { if (projects.size() != inputRowType.getFieldList().size()) { return false; } for (int i = 0; i < projects.size(); ++i) { if (getSourceField(i) < 0) { return false; } } return true; }
/** * Returns whether this program is a permutation of its inputs. */ public boolean isPermutation() { if (projects.size() != inputRowType.getFieldList().size()) { return false; } for (int i = 0; i < projects.size(); ++i) { if (getSourceField(i) < 0) { return false; } } return true; }
/** * Returns a permutation, if this program is a permutation, otherwise null. */ public Permutation getPermutation() { Permutation permutation = new Permutation(projects.size()); if (projects.size() != inputRowType.getFieldList().size()) { return null; } for (int i = 0; i < projects.size(); ++i) { int sourceField = getSourceField(i); if (sourceField < 0) { return null; } permutation.set(i, sourceField); } return permutation; }
/** * Returns a permutation, if this program is a permutation, otherwise null. */ public Permutation getPermutation() { Permutation permutation = new Permutation(projects.size()); if (projects.size() != inputRowType.getFieldList().size()) { return null; } for (int i = 0; i < projects.size(); ++i) { int sourceField = getSourceField(i); if (sourceField < 0) { return null; } permutation.set(i, sourceField); } return permutation; }
final int source = program.getSourceField( name.i );