Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## swarm.collections
Interface CollectionC

All Known Subinterfaces:
  ActionGroupC, ActivationOrderC, ArrayC, CompoundActionC, ConcurrentGroupC, ConcurrentScheduleC, KeyedCollectionC, ListC, MapC, PermutationC, ScheduleC

All Known Implementing Classes:
  ArrayCImpl, PermutationCImpl, ListCImpl

public interface CollectionC
extends CreateC, CreateS, SetInitialValueC, SetInitialValueS, CopyC, CopyS, DropC, DropS, OffsetsC, OffsetsS, ForEachC, ForEachS

A generic collection interface.. A collection is a grouping of object references or other data values which are assigned explicitly as members of the collection. Depending on the subtype, collection members may also be maintained in various associations with each other, such as an ordering of members or an association of members with identifying key values. Major Collection subtypes include Array, List, Set and Map. The Collection supertype establishes common conventions (and associated messages) supported by all types of collections. All collections support traversal over their members using a separate object called an Index. All collections also follow common rules regarding the types of data values which may be added as members. The next two subsections summarize these basic features of all collections. An index is a special type of object that references a current position in an enumeration sequence over a collection. An enumeration sequence contains every member of a collection exactly once. Every collection defines an associated type of object for its index. The index type of a collection defines additional ways in which the members of a collection may be processed beyond any messages available directly on the collection. Often the operations of an index provide the most basic and flexible means for manipulating individual members of a collection. An index object into a collection may be created at any time. An index is the basic means to traverse through all members of a collection. Multiple indexes on the same collection may all exist at the same time and may reference the same or different positions. Depending on the collection type, it may be possible to modify a collection through its indexes. Once an index is created, the sequence of members in its enumeration sequence is guaranteed to remain the same, provided that no new members are added to the underlying collection, or existing members removed. If a member is located once at a particular position, it is guaranteed to remain at that position as long as the index itself remains. Many collection types define an explicit ordering over their members. For such collections, the sequence of members referred to by an index will always be consistent with this ordering. An explicit, total ordering also guarantees that all indexes of the same collection have the same member sequence. If no such ordering is defined, however, some particular sequence of all the collection still becomes associated with each created index. All collection members are guaranteed to be contained somewhere in the enumeration sequence for any particular index, but two indexes on the same collection are not guaranteed to have the same sequence. The Index type corresponds to the iterator types defined as part of many other object-oriented libraries. The name Index is shorter and emphasizes the more abstract and multi-function role of these basic support objects for any collection. For more background on design of indexes and iterators, see the Interface Design Notes for the collections library.

Method Summary
`void` | `setIndexFromMemberLoc(int byteOffset)`
`void` | `setReplaceOnly(boolean replaceOnly)` This boolean-valued option restricts valid usage of a collection by excluding all operations which add or remove members.

Methods inherited from interface swarm.defobj.CreateC
`create, createBegin, createEnd`

Methods inherited from interface swarm.defobj.SetInitialValueC
`setInitialValue`

Methods inherited from interface swarm.defobj.CustomizeC
`customizeBegin, customizeCopy, customizeEnd`

Method Detail

### setReplaceOnly

    public void setReplaceOnly(boolean replaceOnly)

  This boolean-valued option restricts valid usage of a collection by excluding all operations which add or remove members. For some collection subtypes, a replace-only restriction can obtain many of the same performance advantages as a read-only collection, but without disabling replace operations as well. Just like the ReadOnly option, the ReplaceOnly option may be reset after a collection is created, provided it was not originally set to true.

### setIndexFromMemberLoc

    public void setIndexFromMemberLoc(int byteOffset)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD