The Map class
(No version information available, might only be in Git)
소개
A Map is a sequential collection of key-value pairs, almost identical to an
array used in a similar context. Keys can be any type, but must be unique.
Values are replaced if added to the map using the same key.
Strengths
- Keys and values can be any type, including objects.
- Supports array syntax (square brackets).
- Insertion order is preserved.
- Performance and memory efficiency is very similar to an array.
- Automatically frees allocated memory when its size drops low enough.
Weaknesses
- Can’t be converted to an array when objects are used as keys.
클래스 개요
Ds\Map
implements
Ds\Collection
{
public void clear
(
void
)
public Ds\Map copy
(
void
)
public Ds\Map diff
(
Ds\Map $map
)
public Ds\Pair first
(
void
)
public Ds\Set keys
(
void
)
public Ds\Pair last
(
void
)
public Ds\Sequence pairs
(
void
)
public Ds\Pair skip
(
int $position
)
public Ds\Map slice
(
int $index
[,
int $length
] )
public number sum
(
void
)
public Ds\Map union
(
Ds\Map $map
)
public Ds\Sequence values
(
void
)
public Ds\Map xor
(
Ds\Map $map
)
}
예약 상수
Ds\Map::MIN_CAPACITY
-
Table of Contents
There are no user contributed notes for this page.