Interface IterableWithSize<E>

Type Parameters:
E - element type
All Superinterfaces:
Iterable<E>
All Known Subinterfaces:
ApprovalFields, ApprovalsField, AttachmentBaseFields, AttachmentBasesField, BaselineCollectionElementFields, BaselineCollectionElementsField, BaselineCollectionFields, BaselineFields, BuildFields, CategoriesField, CategoryFields, CommentBaseFields, CommentBasesField<C>, CommentBasesTreeField<C>, CommentFields, CommentsField, CommentsTreeField, DocumentFields, DocumentWorkflowSignatureFields, DocumentWorkflowSignaturesField, DocumentWorkItems, EnumOptionFields, EnumOptionsField, ExternallyLinkedWorkItemFields, FeatureSelectionItemFields, Fields, GlobalRolesField, HyperlinkFields, HyperlinksField, IterableField<E>, LinkedOslcResourceFields, LinkedOslcResourcesField, LinkedResourceFields, LinkedResourcesField, LinkedWorkItemFields, ModelObjectsReferenceField<E>, ModelObjectsSearch<T>, ModelObjectsSearchWithTemplates<T>, ModelObjectsSqlSearch, ParametersAndDefinitionsField, ParametersField, ParametersLibrary, PlanFields, PlanningConstraintFields, PlanningConstraintsField, PlansField, PlanWorkItems, ProjectFields, ProjectRolesField, ProjectsField, ReadOnlyStrictCollection<E>, ReadOnlyStrictList<E>, RevisionFields, RevisionsField, RichPageFields, SignatureFields, SignaturesField, StrictCollection<E>, StrictList<E>, TestRecordFields, TestRecordsField, TestRunFields, TestStepResultFields, TestStepResultsField, TimePointFields, UpdatableBaselineCollectionElementsField, UpdatableBaselineCollectionFields, UpdatableBaselineFields, UpdatableCategoriesField, UpdatableCategoryFields, UpdatableDocumentFields, UpdatableDocumentWorkItems, UpdatableEnumOptionsField, UpdatableGlobalRolesField, UpdatableLinkedOslcResourcesField, UpdatableLinkedWorkItemFields, UpdatablePlanFields, UpdatablePlanWorkItems, UpdatableProjectFields, UpdatableProjectRolesField, UpdatableRichPageFields, UpdatableTestRunFields, UpdatableTimePointFields, UpdatableUserFields, UpdatableUserGroupFields, UpdatableUsersField, UpdatableWorkItemFields, UpdatableWorkItemLinkedWorkItemsField, UserFields, UserGroupFields, UsersField, WikiPageFields, WorkflowSignatureFields, WorkflowSignaturesField<T>, WorkItemFields, WorkItemLinkedWorkItemsField, WorkRecordFields, WorkRecordsField
All Known Implementing Classes:
DelegatingIterableWithSize, ImmutableStrictList, IterableWithSizeCollectionAdapter, LazyIterableAggregator, LazyWrappingIterable, StrictHashSet, StrictListImpl

public interface IterableWithSize<E> extends Iterable<E>
Represents read only collection of semantical elements - it does not guarantee that next iteration will return the same instance of the object. Or in other words: the instance returned in next iteration can be different instance of object, but it has to represent the semantically same element from problem domain. So the condition (iterator().next() == iterator().next()) is not guaranteed to always evaluate to TRUE
Since:
3.9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAllTo(Collection<? super E> collection)
     
    boolean
     
    int
     
    E[]
    toArray(E[] a)
    Iterating over array is faster, when checking for concurrent modification is not needed.
    Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • size

      int size()
    • isEmpty

      boolean isEmpty()
    • addAllTo

      void addAllTo(@NotNull Collection<? super E> collection)
    • toArrayList

      @NotNull ArrayList<E> toArrayList()
      Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.
    • toArray

      @NotNull E[] toArray(@NotNull E[] a)
      Iterating over array is faster, when checking for concurrent modification is not needed.
      Parameters:
      a - - must have exactly the same size as the collection