-
Construct a new list with
length
of zero and optional initialcapacity
. A list can expand in length beyond its initial capacity, but best performance will be obtained if the initial capacity is close to the list’s maximum length.Declaration
Swift
override public init(capacity: Int = (4 as Int))
Parameters
capacity
Optional initial capacity.
-
Add all the items of
list
to the end of this list.Declaration
Swift
open func append(contentsOf list: StringMap.EntryList) -> Void
Parameters
list
Items to be added.
-
Declaration
Swift
open func copy() -> StringMap.EntryList
Return Value
A shallow copy of this list.
-
Parameters
item
Item for comparison. Comparison uses the
equality
property, which would usually be expected to match the==
operator for item typeStringMap$Entry
.start
Zero-based starting index (search moves forwards from this index).
Return Value
First index in this list of
item
, or-1
if not found. -
Insert all items of
list
into this list, before the item (if any) atindex
.Throws
ListIndexException
ifindex
is out of range (0 tolength
).Declaration
Swift
open func insert(at index: Int, contentsOf list: StringMap.EntryList) -> Void
Parameters
index
Zero-based index.
list
List of items to be inserted.
-
Declaration
Parameters
item
Item for comparison. Comparison uses the
equality
property, which would usually be expected to match the==
operator for item typeStringMap$Entry
.start
Zero-based starting index (search moves backwards from this index).
Return Value
Last index in this list of
item
, or-1
if not found. -
Return a new
StringMap$EntryList
that shares theListBase.untypedList
as thelist
parameter. To ensure type safety, items inlist
that do not have the item typeStringMap$Entry
will be removed.Parameters
list
List whose items will be shared by the resulting list.
Return Value
A new list of item type
StringMap$Entry
, sharing the same items aslist
. -
Declaration
Swift
open func slice(start: Int, end: Int = (2147483647 as Int)) -> StringMap.EntryList
Parameters
start
Zero-based starting index (inclusive), or negative for starting index relative to the end of this list.
end
Zero-based ending index (exclusive), or negative for ending index relative to the end of this list.
Return Value
A slice of this list from index
start
(inclusive) to indexend
(exclusive).