Class UnmodifiableSequence<T>

  • Type Parameters:
    T - the element type
    All Implemented Interfaces:
    java.lang.Iterable<T>, Collection<T>, IStringValueProvider, IVilGenericType, IVilType, Sequence<T>

    public class UnmodifiableSequence<T>
    extends java.lang.Object
    implements Sequence<T>
    Implements an unmodifiable wrapper for sequences. This is just a runtime type.
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Sequence<T> sequence  
      • Fields inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.Sequence

        DEFAULT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T add​(T element)
      Adds an element to the end of this sequence.
      boolean allowSequenceAdjustment()
      Returns whether a IStringValueProvider may reorder the sequence of this collection for (test) output.
      T any​(ExpressionEvaluator evaluator)
      Returns any element complying with the evaluator.
      Sequence<T> append​(Collection<T> set)
      Append the elements in set.
      Sequence<T> append​(T object)
      Returns the combined sequence of seq and objectappended.
      java.lang.Object apply​(ExpressionEvaluator evaluator)
      Processes elements in this set by applying to given expression.
      Sequence<T> asSequence()
      Turns this collection into a sequence.
      Set<T> asSet()
      Turns this collection into a set.
      T at​(int index)
      Returns a specific element from the collection.
      java.lang.Object avg()
      Returns the average of all elements.
      void clear()
      Clears this collection.
      Sequence<T> cloneCollection()
      Clones this collection.
      Set<?> closure​(ExpressionEvaluator evaluator)
      Calculates a transitive closure over elements provided by this collection and evaluator.
      Sequence<?> collect​(ExpressionEvaluator evaluator)
      Collects the application of evaluator to each individual element and flattens nested structures.
      Sequence<?> collectNested​(ExpressionEvaluator evaluator)
      Collects the application of evaluator to each individual element and keeps nested structures.
      int count​(T element)
      Returns the number of elements in this collection which are equal to element.
      boolean equals​(java.lang.Object object)  
      boolean excludes​(T element)
      Returns whether this collection does not contain a certain element.
      boolean excludesAll​(Collection<?> elements)
      Returns whether this collection contains no elements from elements.
      Sequence<T> excluding​(Collection<T> sequence)
      Exclude the elements in sequence.
      java.lang.Boolean exists​(ExpressionEvaluator evaluator)
      Returns whether there exists on element in the collection for which the evaluator returns true.
      T first()
      Returns the first element.
      Sequence<?> flatten()
      Flattens this collection if needed, i.e., flatten sub-collections.
      java.lang.Boolean forAll​(ExpressionEvaluator evaluator)
      Returns whether all elements in the collection for which the evaluator returns true.
      T get​(int index)
      Returns a specific element from the collection.
      int getGenericParameterCount()
      Returns the number of generic parameters of T.
      TypeDescriptor<?> getGenericParameterType​(int index)
      Returns the type of the specified generic parameter of T.
      java.lang.String getStringValue​(IStringValueProvider.StringComparator comparator)
      Returns the string value of this object.
      TypeDescriptor<?> getType()
      Returns the actual type including generics.
      boolean hasDuplicates()
      Returns whether at least one of the elements in operand has a duplicate.
      int hashCode()  
      boolean includes​(T element)
      Returns whether this collection contains a certain element.
      boolean includesAll​(Collection<?> elements)
      Returns whether this collection contains all elements in elements.
      int indexOf​(T element)
      Returns the index of element in this sequence.
      Sequence<T> insertAt​(int index, T object)
      Returns the sequence having object inserted at position index.
      boolean isAcyclic​(ExpressionEvaluator evaluator)
      Returns whether the transitive closure over elements provided by this collection and evaluator does not contain a cycle.
      boolean isEmpty()
      Returns whether the collection is empty.
      boolean isEquals​(Collection<?> elements)
      Returns whether this collection is equal to elements.
      boolean isNotEmpty()
      Returns whether the collection is not empty (inverse of Collection.isEmpty().
      boolean isSubsequenceOf​(Sequence<T> other)
      Returns whether operand is a subsequence (considering the sequence and including equality) of other.
      java.lang.Boolean isUnique​(ExpressionEvaluator evaluator)
      Returns whether the evaluator returns a different result for all elements in the collection.
      java.util.Iterator<T> iterator()
      Returns an iterator on the individual elements of this collection.
      java.lang.String joinfields​(java.lang.String separator, java.lang.String begin, java.lang.String end)
      Returns a concatenation of the string representation of elements, with begin as lead in, sep as separator between the elements and end as lead out.
      T last()
      Returns the last element.
      Map<T,​T> mapAny​(Sequence<T> other)
      Maps the elements of this sequence to the elements of other and returns the mapping pairs (based on the equals operation) regardless of the sequence.
      Map<T,​T> mapSequence​(Sequence<T> other)
      Maps the elements of this sequence to the elements of other and returns the mapping pairs (based on the equals operation) in the given sequence.
      T max()
      Returns the maximum of all elements.
      T min()
      Returns the minimum of all elements.
      T one​(ExpressionEvaluator evaluator)
      Returns the element complying with the evaluator if there is exactly one.
      boolean overlaps​(Sequence<T> other)
      Returns the sequence in that this sequence and other have in common.
      Sequence<T> prepend​(T object)
      Returns the combined sequence of object prepended before this sequence.
      T product()
      Returns the product of all elements.
      Sequence<T> reject​(ExpressionEvaluator evaluator)
      Rejects elements in this collection according to the given expression.
      boolean remove​(T element)
      Removes the first occurrence of the given element from this sequence.
      void removeAll​(T element)
      Removes all elements equal to element.
      T removeAt​(int index)
      Removes the element at index.
      T removeFirst()
      Removes the first element.
      T removeLast()
      Removes the last element.
      Sequence<T> revert()
      Reverts this sequence.
      Sequence<T> select​(ExpressionEvaluator evaluator)
      Selects elements in this collection according to the given expression.
      Sequence<T> selectByKind​(TypeDescriptor<?> type)
      Does type selection of elements (including subtypes).
      Sequence<T> selectByType​(TypeDescriptor<?> type)
      Does type selection of elements (only the same type).
      int size()
      Returns the number of elements in the underlying collection.
      Sequence<T> sortAlpha()
      Returns an alphabetically sorted sequence.
      Sequence<T> sortedBy​(ExpressionEvaluator evaluator)
      Sorts the elements in this sequence according to the given expression in ascending order.
      Sequence<T> subSequence​(int lower, int upper)
      Returns the sub-sequence of this sequence.
      T sum()
      Returns the sum of all elements.
      java.util.List<T> toMappedList()
      Converts back to a list for utilizing this with external classes.
      Set<T> toSet()
      Turns this sequence into a set.
      java.lang.String toString()  
      Sequence<T> typeReject​(TypeDescriptor<?> type)
      Does type selection of elements not having the same type (including subtypes).
      Sequence<T> union​(Sequence<T> seq)
      Append the elements in seq.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • UnmodifiableSequence

        public UnmodifiableSequence​(Sequence<T> sequence)
        Creates a new unmodifiable sequence.
        Parameters:
        sequence - the sequence to be wrapped
    • Method Detail

      • getGenericParameterCount

        public int getGenericParameterCount()
        Description copied from interface: Collection
        Returns the number of generic parameters of T.
        Specified by:
        getGenericParameterCount in interface Collection<T>
        Returns:
        the number of generic parameter
      • getGenericParameterType

        public TypeDescriptor<?> getGenericParameterType​(int index)
        Description copied from interface: Collection
        Returns the type of the specified generic parameter of T.
        Specified by:
        getGenericParameterType in interface Collection<T>
        Parameters:
        index - the 0-based index of the generic parameter
        Returns:
        the actual type of the generic parameter
      • size

        public int size()
        Description copied from interface: Collection
        Returns the number of elements in the underlying collection.
        Specified by:
        size in interface Collection<T>
        Returns:
        the number of elements
      • allowSequenceAdjustment

        public boolean allowSequenceAdjustment()
        Description copied from interface: Collection
        Returns whether a IStringValueProvider may reorder the sequence of this collection for (test) output.
        Specified by:
        allowSequenceAdjustment in interface Collection<T>
        Returns:
        true if a value provider may reorder the sequence, false else
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: Collection
        Returns whether the collection is empty.
        Specified by:
        isEmpty in interface Collection<T>
        Returns:
        true if it is empty, false else
      • isNotEmpty

        public boolean isNotEmpty()
        Description copied from interface: Collection
        Returns whether the collection is not empty (inverse of Collection.isEmpty().
        Specified by:
        isNotEmpty in interface Collection<T>
        Returns:
        false if it is empty, true else
      • includes

        public boolean includes​(T element)
        Description copied from interface: Collection
        Returns whether this collection contains a certain element.
        Specified by:
        includes in interface Collection<T>
        Parameters:
        element - the element to look for
        Returns:
        true if this collection contains element, false else
      • excludes

        public boolean excludes​(T element)
        Description copied from interface: Collection
        Returns whether this collection does not contain a certain element.
        Specified by:
        excludes in interface Collection<T>
        Parameters:
        element - the element to look for
        Returns:
        true if this collection does not contain element, true else
      • count

        public int count​(T element)
        Description copied from interface: Collection
        Returns the number of elements in this collection which are equal to element.
        Specified by:
        count in interface Collection<T>
        Parameters:
        element - the element to look for
        Returns:
        the number of equal elements in this collection
      • iterator

        public java.util.Iterator<T> iterator()
        Description copied from interface: Collection
        Returns an iterator on the individual elements of this collection.
        Specified by:
        iterator in interface Collection<T>
        Specified by:
        iterator in interface java.lang.Iterable<T>
        Returns:
        the iterator
      • isEquals

        public boolean isEquals​(Collection<?> elements)
        Description copied from interface: Collection
        Returns whether this collection is equal to elements. Please note that the actual semantics, i.e., whether the elements must also be in the same sequence, depends on the actual semantics of the collection.
        Specified by:
        isEquals in interface Collection<T>
        Parameters:
        elements - the collection to be tested
        Returns:
        true if both collections are considered to be equal, false else
      • getStringValue

        public java.lang.String getStringValue​(IStringValueProvider.StringComparator comparator)
        Description copied from interface: IStringValueProvider
        Returns the string value of this object.
        Specified by:
        getStringValue in interface IStringValueProvider
        Parameters:
        comparator - if the sequence of elements, e.g., in case of collections, shall be ordered according to the comparator, null if the original sequence shall be returned
        Returns:
        the string value
      • at

        public T at​(int index)
        Description copied from interface: Sequence
        Returns a specific element from the collection.
        Specified by:
        at in interface Sequence<T>
        Parameters:
        index - the index of the element to be returned
        Returns:
        the element or null in case of non-existing data or if index < 0 || index >= Collection.size()
      • get

        public T get​(int index)
        Description copied from interface: Sequence
        Returns a specific element from the collection.
        Specified by:
        get in interface Sequence<T>
        Parameters:
        index - the index of the element to be returned
        Returns:
        the element or null in case of non-existing data or if index < 0 || index >= Collection.size()
      • selectByType

        public Sequence<T> selectByType​(TypeDescriptor<?> type)
        Description copied from interface: Collection
        Does type selection of elements (only the same type).
        Specified by:
        selectByType in interface Collection<T>
        Specified by:
        selectByType in interface Sequence<T>
        Parameters:
        type - the target type
        Returns:
        the selected elements (the type will be adjusted to the actual type for type)
      • selectByKind

        public Sequence<T> selectByKind​(TypeDescriptor<?> type)
        Description copied from interface: Collection
        Does type selection of elements (including subtypes).
        Specified by:
        selectByKind in interface Collection<T>
        Specified by:
        selectByKind in interface Sequence<T>
        Parameters:
        type - the target type
        Returns:
        the selected elements (the type will be adjusted to the actual type for type)
      • typeReject

        public Sequence<T> typeReject​(TypeDescriptor<?> type)
        Description copied from interface: Collection
        Does type selection of elements not having the same type (including subtypes).
        Specified by:
        typeReject in interface Collection<T>
        Specified by:
        typeReject in interface Sequence<T>
        Parameters:
        type - the target type
        Returns:
        the selected elements (the type will be adjusted to the actual type for type)
      • excluding

        public Sequence<T> excluding​(Collection<T> sequence)
        Description copied from interface: Sequence
        Exclude the elements in sequence.
        Specified by:
        excluding in interface Sequence<T>
        Parameters:
        sequence - the elements to be excluded
        Returns:
        this set without the elements in set
      • append

        public Sequence<T> append​(Collection<T> set)
        Description copied from interface: Sequence
        Append the elements in set.
        Specified by:
        append in interface Sequence<T>
        Parameters:
        set - the elements to be appended
        Returns:
        this set including the elements in set
      • add

        public T add​(T element)
        Description copied from interface: Sequence
        Adds an element to the end of this sequence.
        Specified by:
        add in interface Sequence<T>
        Parameters:
        element - the element to be added
        Returns:
        element
      • remove

        public boolean remove​(T element)
        Description copied from interface: Sequence
        Removes the first occurrence of the given element from this sequence.
        Specified by:
        remove in interface Sequence<T>
        Parameters:
        element - the element to be removed
        Returns:
        true of the element was removed, false else
      • collect

        public Sequence<?> collect​(ExpressionEvaluator evaluator)
                            throws VilException
        Description copied from interface: Collection
        Collects the application of evaluator to each individual element and flattens nested structures.
        Specified by:
        collect in interface Collection<T>
        Specified by:
        collect in interface Sequence<T>
        Parameters:
        evaluator - the evaluator (results must evaluate to Boolean)
        Returns:
        the application results
        Throws:
        VilException - in case that evaluation fails
      • apply

        public java.lang.Object apply​(ExpressionEvaluator evaluator)
                               throws VilException
        Description copied from interface: Collection
        Processes elements in this set by applying to given expression.
        Specified by:
        apply in interface Collection<T>
        Parameters:
        evaluator - the evaluator holding the iterator / expression to apply
        Returns:
        the aggregated value, null in case of no aggregation
        Throws:
        VilException - in case that selection fails
      • toSet

        public Set<T> toSet()
        Description copied from interface: Sequence
        Turns this sequence into a set.
        Specified by:
        toSet in interface Sequence<T>
        Returns:
        the set containing the elements of this sequence (excluding duplicates)
      • asSet

        public Set<T> asSet()
        Description copied from interface: Collection
        Turns this collection into a set.
        Specified by:
        asSet in interface Collection<T>
        Returns:
        the set containing the elements of this collection (excluding duplicates)
      • asSequence

        public Sequence<T> asSequence()
        Description copied from interface: Collection
        Turns this collection into a sequence.
        Specified by:
        asSequence in interface Collection<T>
        Returns:
        the set containing the elements of this collection
      • sortAlpha

        public Sequence<T> sortAlpha()
        Description copied from interface: Sequence
        Returns an alphabetically sorted sequence. Elements are considered using their (internal) string representations and sorted.
        Specified by:
        sortAlpha in interface Sequence<T>
        Returns:
        the sorted sequence
      • first

        public T first()
        Description copied from interface: Sequence
        Returns the first element.
        Specified by:
        first in interface Sequence<T>
        Returns:
        the first element
      • last

        public T last()
        Description copied from interface: Sequence
        Returns the last element.
        Specified by:
        last in interface Sequence<T>
        Returns:
        the last element
      • indexOf

        public int indexOf​(T element)
        Description copied from interface: Sequence
        Returns the index of element in this sequence.
        Specified by:
        indexOf in interface Sequence<T>
        Parameters:
        element - the element to return the index for
        Returns:
        the 0-based index of element in this sequence, -1 if not found
      • mapSequence

        public Map<T,​T> mapSequence​(Sequence<T> other)
        Description copied from interface: Sequence
        Maps the elements of this sequence to the elements of other and returns the mapping pairs (based on the equals operation) in the given sequence. Please note that both sequences must have exactly one type parameter.
        Specified by:
        mapSequence in interface Sequence<T>
        Parameters:
        other - the second sequence to map against
        Returns:
        the mapping (key is taken from this sequence, value from other)
      • mapAny

        public Map<T,​T> mapAny​(Sequence<T> other)
        Description copied from interface: Sequence
        Maps the elements of this sequence to the elements of other and returns the mapping pairs (based on the equals operation) regardless of the sequence. Please note that both sequences must have exactly one type parameter.
        Specified by:
        mapAny in interface Sequence<T>
        Parameters:
        other - the second sequence to map against
        Returns:
        the mapping (key is taken from this sequence, value from other)
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toMappedList

        public java.util.List<T> toMappedList()
        Description copied from interface: Sequence
        Converts back to a list for utilizing this with external classes.
        Specified by:
        toMappedList in interface Sequence<T>
        Returns:
        the internal map
      • revert

        public Sequence<T> revert()
        Description copied from interface: Sequence
        Reverts this sequence.
        Specified by:
        revert in interface Sequence<T>
        Returns:
        the reverted sequence
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clear

        public void clear()
        Description copied from interface: Collection
        Clears this collection.
        Specified by:
        clear in interface Collection<T>
      • sum

        public T sum()
        Description copied from interface: Collection
        Returns the sum of all elements.
        Specified by:
        sum in interface Collection<T>
        Returns:
        the sum of all elements or null if the elements do not define addition
      • avg

        public java.lang.Object avg()
        Description copied from interface: Collection
        Returns the average of all elements.
        Specified by:
        avg in interface Collection<T>
        Returns:
        the average of all elements or null if the elements do not define addition or division
      • product

        public T product()
        Description copied from interface: Collection
        Returns the product of all elements.
        Specified by:
        product in interface Collection<T>
        Returns:
        the product of all elements or null if the elements do not define multiplication
      • min

        public T min()
        Description copied from interface: Collection
        Returns the minimum of all elements.
        Specified by:
        min in interface Collection<T>
        Returns:
        the minimum of all elements or null if the elements do not define the minimum operation
      • max

        public T max()
        Description copied from interface: Collection
        Returns the maximum of all elements.
        Specified by:
        max in interface Collection<T>
        Returns:
        the maximum of all elements or null if the elements do not define the maximum operation
      • includesAll

        public boolean includesAll​(Collection<?> elements)
        Description copied from interface: Collection
        Returns whether this collection contains all elements in elements.
        Specified by:
        includesAll in interface Collection<T>
        Parameters:
        elements - the elements to look for
        Returns:
        true if this collection contains all elements, false else
      • excludesAll

        public boolean excludesAll​(Collection<?> elements)
        Description copied from interface: Collection
        Returns whether this collection contains no elements from elements.
        Specified by:
        excludesAll in interface Collection<T>
        Parameters:
        elements - the elements to look for
        Returns:
        true if this collection contains none from elements, false else
      • any

        public T any​(ExpressionEvaluator evaluator)
              throws VilException
        Description copied from interface: Collection
        Returns any element complying with the evaluator.
        Specified by:
        any in interface Collection<T>
        Parameters:
        evaluator - the evaluator (results must evaluate to Boolean)
        Returns:
        one element complying with evaluator
        Throws:
        VilException - in case that application fails
      • one

        public T one​(ExpressionEvaluator evaluator)
              throws VilException
        Description copied from interface: Collection
        Returns the element complying with the evaluator if there is exactly one.
        Specified by:
        one in interface Collection<T>
        Parameters:
        evaluator - the evaluator (results must evaluate to Boolean)
        Returns:
        the element complying with evaluator
        Throws:
        VilException - in case that evaluation fails
      • exists

        public java.lang.Boolean exists​(ExpressionEvaluator evaluator)
                                 throws VilException
        Description copied from interface: Collection
        Returns whether there exists on element in the collection for which the evaluator returns true.
        Specified by:
        exists in interface Collection<T>
        Parameters:
        evaluator - the evaluator
        Returns:
        true for the exists one, false else
        Throws:
        VilException - in case that evaluation fails
      • forAll

        public java.lang.Boolean forAll​(ExpressionEvaluator evaluator)
                                 throws VilException
        Description copied from interface: Collection
        Returns whether all elements in the collection for which the evaluator returns true.
        Specified by:
        forAll in interface Collection<T>
        Parameters:
        evaluator - the evaluator
        Returns:
        true for the exists one, false else
        Throws:
        VilException - in case that evaluation fails
      • isUnique

        public java.lang.Boolean isUnique​(ExpressionEvaluator evaluator)
                                   throws VilException
        Description copied from interface: Collection
        Returns whether the evaluator returns a different result for all elements in the collection.
        Specified by:
        isUnique in interface Collection<T>
        Parameters:
        evaluator - the evaluator
        Returns:
        true if all results are different, false else
        Throws:
        VilException - in case that evaluation fails
      • append

        public Sequence<T> append​(T object)
        Description copied from interface: Sequence
        Returns the combined sequence of seq and objectappended.
        Specified by:
        append in interface Sequence<T>
        Parameters:
        object - the object to append
        Returns:
        the combined sequence
      • prepend

        public Sequence<T> prepend​(T object)
        Description copied from interface: Sequence
        Returns the combined sequence of object prepended before this sequence.
        Specified by:
        prepend in interface Sequence<T>
        Parameters:
        object - the object to prepend
        Returns:
        the combined sequence
      • insertAt

        public Sequence<T> insertAt​(int index,
                                    T object)
        Description copied from interface: Sequence
        Returns the sequence having object inserted at position index.
        Specified by:
        insertAt in interface Sequence<T>
        Parameters:
        index - the index to insert at
        object - the object to insert
        Returns:
        the combined sequence
      • subSequence

        public Sequence<T> subSequence​(int lower,
                                       int upper)
        Description copied from interface: Sequence
        Returns the sub-sequence of this sequence.
        Specified by:
        subSequence in interface Sequence<T>
        Parameters:
        lower - the lower index where the sub-sequence shall start
        upper - the end index where the sub-sequence shall end
        Returns:
        the sub-sequence
      • union

        public Sequence<T> union​(Sequence<T> seq)
        Description copied from interface: Sequence
        Append the elements in seq.
        Specified by:
        union in interface Sequence<T>
        Parameters:
        seq - the elements to be appended
        Returns:
        this set including the elements in seq
      • hasDuplicates

        public boolean hasDuplicates()
        Description copied from interface: Sequence
        Returns whether at least one of the elements in operand has a duplicate.
        Specified by:
        hasDuplicates in interface Sequence<T>
        Returns:
        true for duplicates, false else
      • overlaps

        public boolean overlaps​(Sequence<T> other)
        Description copied from interface: Sequence
        Returns the sequence in that this sequence and other have in common.
        Specified by:
        overlaps in interface Sequence<T>
        Parameters:
        other - the other sequence
        Returns:
        true for overlaps, false else
      • isSubsequenceOf

        public boolean isSubsequenceOf​(Sequence<T> other)
        Description copied from interface: Sequence
        Returns whether operand is a subsequence (considering the sequence and including equality) of other.
        Specified by:
        isSubsequenceOf in interface Sequence<T>
        Parameters:
        other - the other sequence
        Returns:
        true for subsequence, false else
      • closure

        public Set<?> closure​(ExpressionEvaluator evaluator)
                       throws VilException
        Description copied from interface: Collection
        Calculates a transitive closure over elements provided by this collection and evaluator.
        Specified by:
        closure in interface Collection<T>
        Specified by:
        closure in interface Sequence<T>
        Parameters:
        evaluator - the evaluator providing the links/collections to follow
        Returns:
        the closure
        Throws:
        VilException - in case that evaluation fails
      • isAcyclic

        public boolean isAcyclic​(ExpressionEvaluator evaluator)
                          throws VilException
        Description copied from interface: Collection
        Returns whether the transitive closure over elements provided by this collection and evaluator does not contain a cycle.
        Specified by:
        isAcyclic in interface Collection<T>
        Parameters:
        evaluator - the evaluator providing the links/collections to follow
        Returns:
        true for cycle, false else
        Throws:
        VilException - in case that evaluation fails
      • joinfields

        public java.lang.String joinfields​(java.lang.String separator,
                                           java.lang.String begin,
                                           java.lang.String end)
        Description copied from interface: Sequence
        Returns a concatenation of the string representation of elements, with begin as lead in, sep as separator between the elements and end as lead out. (QVT)
        Specified by:
        joinfields in interface Sequence<T>
        Parameters:
        separator - the separator
        begin - the lead in
        end - the lead out
        Returns:
        the concatenated result
      • removeAll

        public void removeAll​(T element)
        Description copied from interface: Sequence
        Removes all elements equal to element. (QVT)
        Specified by:
        removeAll in interface Sequence<T>
        Parameters:
        element - the element to remove all copies for
      • removeAt

        public T removeAt​(int index)
        Description copied from interface: Sequence
        Removes the element at index. (QVT)
        Specified by:
        removeAt in interface Sequence<T>
        Parameters:
        index - the index of the element to remove
        Returns:
        the removed index, undefined if index is not valid
      • removeFirst

        public T removeFirst()
        Description copied from interface: Sequence
        Removes the first element. (QVT)
        Specified by:
        removeFirst in interface Sequence<T>
        Returns:
        the removed element, undefined if there is no first element
      • removeLast

        public T removeLast()
        Description copied from interface: Sequence
        Removes the last element. (QVT)
        Specified by:
        removeLast in interface Sequence<T>
        Returns:
        the removed element, undefined if there is no last element