Type Sequence

All Supertypes:
Collection

Predefined type Sequence
extends Collection

A sequence is a collection where the elements are ordered. An element may be part of a sequence more than once.


Operation Summary
 Boolean =(Sequence rhs)
          True if this sequence contains the same elements as rhs in the same order.
 Boolean <>(Sequence rhs)
          True if this sequence does not contain the same elements as rhs in the same order.
 Sequence append(OclAny object)
          A sequence of elements, consisting of all elements of this sequence, followed by object.
 Bag asBag
          A bag that contains all the elements from this sequence.
 Set asSet
          A set that contains all the elements from this sequence, with duplicates removed.
 OclAny at(Integer rank)
          The element number rank in the sequence.
 Sequence collect(OclAny_Expression expr)
          The sequence of elements which results from applying the expr expression to every member of this set.
 Integer count(OclAny object)
          The number of occurences of object in this sequence.
 Sequence excluding(OclAny object)
          A sequence containing all elements of this sequence apart from all occurences of object.
 OclAny first
          The first element of this sequence.
 Sequence including(OclAny object)
          The sequence containing all elements of this sequence plus object added as the last element.
 OclAny last
          The last element of this sequence.
 Sequence prepend(OclAny object)
          A sequence consisting of object, followed by all elements in this sequence.
 Sequence reject(Boolean_Expression expr)
          The sub-sequence of all elements for which applying the epr expression evaluates to false.
 Sequence select(Boolean_Expression expr)
          The sub-sequence of all elements for which applying the expr expression evaluates to true.
 Sequence subSequence(Integer from, Integer to)
          A sub-sequence of this sequence, starting at number from, up to and including element number to.
 Sequence union(Sequence rhs)
          A sequence consisting of all elements of this sequence, followed by all elements in rhs.
 
Operations inherited from type Collection
excludes, excludesAll, exists, forAll, getOne, includes, includesAll, isEmpty, isUnique, notEmpty, size, sortedBy, sortedBy, sum
 

Operations Detail

count

 public Integer count(OclAny object)
The number of occurences of object in this sequence.
Overloads:
count in type Collection

=

 public Boolean =(Sequence rhs)
True if this sequence contains the same elements as rhs in the same order.

<>

 public Boolean <>(Sequence rhs)
True if this sequence does not contain the same elements as rhs in the same order.

union

 public Sequence union(Sequence rhs)
A sequence consisting of all elements of this sequence, followed by all elements in rhs.

append

 public Sequence append(OclAny object)
A sequence of elements, consisting of all elements of this sequence, followed by object.

prepend

 public Sequence prepend(OclAny object)
A sequence consisting of object, followed by all elements in this sequence.

subSequence

 public Sequence subSequence(Integer from, Integer to)
A sub-sequence of this sequence, starting at number from, up to and including element number to. The first element has number 0.

at

 public OclAny at(Integer rank)
The element number rank in the sequence. The first element has number 0.

first

 public OclAny first
The first element of this sequence. null if this sequence is empty.

last

 public OclAny last
The last element of this sequence. null if this sequence is empty.

including

 public Sequence including(OclAny object)
The sequence containing all elements of this sequence plus object added as the last element.

excluding

 public Sequence excluding(OclAny object)
A sequence containing all elements of this sequence apart from all occurences of object. The order of the result is not changed.

select

 public Sequence select(Boolean_Expression expr)
The sub-sequence of all elements for which applying the expr expression evaluates to true.

reject

 public Sequence reject(Boolean_Expression expr)
The sub-sequence of all elements for which applying the expr expression evaluates to false.

collect

 public Sequence collect(OclAny_Expression expr)
The sequence of elements which results from applying the expr expression to every member of this set.

asBag

 public Bag asBag
A bag that contains all the elements from this sequence.

asSet

 public Set asSet
A set that contains all the elements from this sequence, with duplicates removed.


Copyright 1999-2002 ObjeXion Software SA. All rights reserved.