Can a sequence that does not store terms report Spliterator.ORDERED?

32 Views Asked by At

I'm creating a class designed to study Collatz sequences that have arbitrarily large initial terms. Because of the size of the terms and the length of the resulting sequences, the terms of a given sequence are not stored in its corresponding instance, but can be iterated over.

Of course, the generating function returns the same terms in the same order for each traversal of a sequence, so it is technically ordered. However, I saw this in the documentation for Spliterator.ORDERED:

"Encounter order is guaranteed to be ascending index order for any List."

I have no way of defining the encounter order for a sequence explicitly in that fashion, only that it exists. Can I still report Spliterator.ORDERED?

NOTE: I am not implementing List. I just used the above quote as an example of the sort of explicit ordering definition I cannot provide.

0

There are 0 best solutions below