protected static List<Component[]> getPossibleSequences(Mode mode, int length, DateStyle dateStyle) {
        List<Component[]> sequences = new ArrayList<>();
        Component[][] dateSequences = dateStyle.equals(DateStyle.DAY_FIRST) ? DATE_SEQUENCES_DAY_FIRST : DATE_SEQUENCES_MONTH_FIRST;

        if (mode == Mode.DATE || mode == Mode.AUTO) {
            for (Component[] seq : dateSequences) {
                if (seq.length == length) {
                    sequences.add(seq);
                }
            }

        } else if (mode == Mode.TIME) {
            for (Component[] seq : TIME_SEQUENCES) {
                if (seq.length == length) {
                    sequences.add(seq);
                }
            }
        }

        if (mode == Mode.DATETIME || mode == Mode.AUTO) {
            for (Component[] dateSeq : dateSequences) {
                for (Component[] timeSeq : TIME_SEQUENCES) {
                    if (dateSeq.length + timeSeq.length == length) {
                        sequences.add(ArrayUtils.addAll(dateSeq, timeSeq));
                    }
                }
            }
        }

        return sequences;
    }
protected static List < Component [ ] > getPossibleSequences ( Mode mode , int length , DateStyle dateStyle ) { List < Component [ ] > sequences = new ArrayList < > ( ) ; Component [ ] [ ] dateSequences = dateStyle . equals ( DateStyle . DAY_FIRST ) ? DATE_SEQUENCES_DAY_FIRST : DATE_SEQUENCES_MONTH_FIRST ; if ( mode == Mode . DATE || mode == Mode . AUTO ) { for ( Component [ ] seq : dateSequences ) { if ( seq . length == length ) { sequences . add ( seq ) ; } } } else if ( mode == Mode . TIME ) { for ( Component [ ] seq : TIME_SEQUENCES ) { if ( seq . length == length ) { sequences . add ( seq ) ; } } } if ( mode == Mode . DATETIME || mode == Mode . AUTO ) { for ( Component [ ] dateSeq : dateSequences ) { for ( Component [ ] timeSeq : TIME_SEQUENCES ) { if ( dateSeq . length + timeSeq . length == length ) { sequences . add ( ArrayUtils . addAll ( dateSeq , timeSeq ) ) ; } } } } return sequences ; }
Gets possible component sequences in the given mode
@param mode the mode
@param length the length (only returns sequences of this length)
@param dateStyle whether dates are usually entered day first or month first
@return the list of sequences