var last: T?
Returns the last object in the set, or nil
if the set is empty.
func append(T)
Appends an object to the end of the ordered set.
func append<S>(contentsOf: S)
Appends a sequence of objects to the end of the ordered set.
func index(of: T) -> Index?
Locate the index of an object in the ordered set. It is preferable to use this method over the global find() for performance reasons.
func insert<S>(S, at: Index)
Inserts objects at a given index, shifting all objects above it up one. This method will cause a fatal error if you attempt to insert the objects out of bounds. If an object in objects already exists in the OrderedSet it will not be added. Objects that occur twice in the sequence will only be added once.
func insert(T, at: Index)
Inserts an object at a given index, shifting all objects above it up one. This method will cause a fatal error if you attempt to insert the object out of bounds. If the object already exists in the OrderedSet, this operation is a no-op.
func intersects<S>(S) -> Bool
Tests if the ordered set contains any objects within a sequence.
func isSubset<S>(of: S) -> Bool
Tests if a the ordered set is a subset of another sequence.
func moveObject(T, toIndex: Index)
Moves an object to a different index, shifting all objects in between the movement. This method is a no-op if the object doesn’t exist in the set or the index is the same that the object is currently at. This method will cause a fatal error if you attempt to move an object to an index that is out of bounds.
func moveObject(at: Index, to: Index)
Moves an object from one index to a different index, shifting all objects in between the movement. This method is a no-op if the index is the same that the object is currently at. This method will cause a fatal error if you attempt to move an object fro man index that is out of bounds or to an index that is out of bounds.
func remove<S>(S)
Removes the given objects from the ordered set.
func remove(T)
Removes an object from the ordered set. If the object exists in the ordered set, it will be removed. If it is not the last object in the ordered set, subsequent objects will be shifted down one position.
func removeAllObjects()
Removes all objects in the ordered set.
func removeObject(at: Index)
Removes an object at a given index. This method will cause a fatal error if you attempt to move an object to an index that is out of bounds.
func swapObject(T, with: T)
Swaps two objects contained within the ordered set. Both objects must exist within the set, or the swap will not occur.