Top Description Methods
org.eclipse.collections.api.map.primitive

public Interface ByteObjectMap<V>

extends PrimitiveObjectMap<V>
Known Direct Subinterfaces
org.eclipse.collections.api.map.primitive.ImmutableByteObjectMap, org.eclipse.collections.api.map.primitive.MutableByteObjectMap
Imports
org.eclipse.collections.api.LazyByteIterable, .RichIterable, org.eclipse.collections.api.block.function.Function0, org.eclipse.collections.api.block.predicate.primitive.ByteObjectPredicate, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.block.procedure.primitive.ByteObjectProcedure, .ByteProcedure, org.eclipse.collections.api.block.function.primitive.ObjectByteObjectToObjectFunction, org.eclipse.collections.api.set.primitive.MutableByteSet, org.eclipse.collections.api.tuple.primitive.ByteObjectPair

This file was automatically generated from template file primitiveObjectMap.stg.
Since
3.0.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

if a mapping exists in this map for the key
containsKey
(byte
the key
key
)

Returns whether or not the key is present in the map.

public ObjectByteMap<V>
flipUniqueValues()

Return the ObjectByteMap that is obtained by flipping the direction of this map and making the associations from value to key.

public void
forEachKey(ByteProcedure
the procedure to invoke for each key
procedure
)

Iterates through each key in the map, invoking the procedure for each.

public void
forEachKeyValue(ByteObjectProcedure<? super V>
the procedure to invoke for each key/value pair
procedure
)

Iterates through each key/value pair in the map, invoking the procedure for each.

public V

Returns:

the value associated with the key, or the default value if no such mapping exists
get
(byte
the key
key
)

Retrieves the value associated with the key.

public V

Returns:

the value associated with the key, if one exists, or the result of invoking ifAbsent if not
getIfAbsent
(byte
the key
key
,
Function0<? extends V> ifAbsent)

Retrieves the value associated with the key if one exists; if it does not, returns the result of invoking the value supplier.

public default <IV> IV

Returns:

result of injecting the injectedValue into the map
injectIntoKeyValue
(IV
value to be injected into the map
injectedValue
,
ObjectByteObjectToObjectFunction<? super IV, ? super V, ? extends IV>
to apply to the injected value and key/value pairs
function
)

Implements the injectInto pattern with each key/value pair of the map.

public MutableByteSet

Returns:

a mutable set containing the keys in this map
keySet
()

Returns a set containing all the keys in this map.

public LazyByteIterable

Returns:

a view of the keys in this map
keysView
()

Returns a view of the keys in this map.

public RichIterable<ByteObjectPair<V>>

Returns:

a view of the keys in this map
keyValuesView
()

Returns a view of the key/value pairs in this map.

public ByteObjectMap<V>

Returns:

a copy of this map without the matching key/value pairs
reject
(ByteObjectPredicate<? super V>
the predicate to determine which key/value pairs in this map should be excluded from the returned map
predicate
)

Return a copy of this map containing only the key/value pairs that do not match the predicate.

public ByteObjectMap<V>

Returns:

a copy of this map with the matching key/value pairs
select
(ByteObjectPredicate<? super V>
the predicate to determine which key/value pairs in this map should be included in the returned map
predicate
)

Return a copy of this map containing only the key/value pairs that match the predicate.

public ByteObjectMap<V>
tap(Procedure<? super V> procedure)

Redeclares org.eclipse.collections.api.RichIterable.tap.

Executes the Procedure for each element in the iterable and returns this.

public ImmutableByteObjectMap<V>

Returns:

an immutable map that is equivalent to this one
toImmutable
()

Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.

Inherited from org.eclipse.collections.api.map.primitive.PrimitiveObjectMap:
collectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcontainsValueequalsflatCollectflatCollectWithforEachValuegroupBygroupByEachgroupByUniqueKeyhashCodeparallelStreampartitionpartitionWithrejectrejectWithselectselectInstancesOfselectWithspliteratorstreamtoStringvalueszipzipWithIndex

Method Detail

containsKeyback to summary
public boolean containsKey(byte key)

Returns whether or not the key is present in the map.

Parameters
key:byte

the key

Returns:boolean

if a mapping exists in this map for the key

flipUniqueValuesback to summary
public ObjectByteMap<V> flipUniqueValues()

Return the ObjectByteMap that is obtained by flipping the direction of this map and making the associations from value to key.

Exceptions
IllegalStateException:
if the ObjectByteMap contains duplicate values.
Since
9.0
forEachKeyback to summary
public void forEachKey(ByteProcedure procedure)

Iterates through each key in the map, invoking the procedure for each.

Parameters
procedure:ByteProcedure

the procedure to invoke for each key

forEachKeyValueback to summary
public void forEachKeyValue(ByteObjectProcedure<? super V> procedure)

Iterates through each key/value pair in the map, invoking the procedure for each.

Parameters
procedure:ByteObjectProcedure<? super V>

the procedure to invoke for each key/value pair

getback to summary
public V get(byte key)

Retrieves the value associated with the key. If no mapping exists for the key, null is returned.

Parameters
key:byte

the key

Returns:V

the value associated with the key, or the default value if no such mapping exists

getIfAbsentback to summary
public V getIfAbsent(byte key, Function0<? extends V> ifAbsent)

Retrieves the value associated with the key if one exists; if it does not, returns the result of invoking the value supplier.

Parameters
key:byte

the key

Returns:V

the value associated with the key, if one exists, or the result of invoking ifAbsent if not

injectIntoKeyValueback to summary
public default <IV> IV injectIntoKeyValue(IV injectedValue, ObjectByteObjectToObjectFunction<? super IV, ? super V, ? extends IV> function)

Implements the injectInto pattern with each key/value pair of the map.

Parameters
injectedValue:IV

value to be injected into the map

function:ObjectByteObjectToObjectFunction<? super IV, ? super V, ? extends IV>

to apply to the injected value and key/value pairs

Returns:IV

result of injecting the injectedValue into the map

Since
11.1
keySetback to summary
public MutableByteSet keySet()

Returns a set containing all the keys in this map. The set is backed by the map, so any modifications to the returned set will affect this map.

Returns:MutableByteSet

a mutable set containing the keys in this map

keysViewback to summary
public LazyByteIterable keysView()

Returns a view of the keys in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the keys returned by the iterable.

Returns:LazyByteIterable

a view of the keys in this map

Since
5.0
keyValuesViewback to summary
public RichIterable<ByteObjectPair<V>> keyValuesView()

Returns a view of the key/value pairs in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the pairs returned by the iterable.

Returns:RichIterable<ByteObjectPair<V>>

a view of the keys in this map

Since
5.0
rejectback to summary
public ByteObjectMap<V> reject(ByteObjectPredicate<? super V> predicate)

Return a copy of this map containing only the key/value pairs that do not match the predicate.

Parameters
predicate:ByteObjectPredicate<? super V>

the predicate to determine which key/value pairs in this map should be excluded from the returned map

Returns:ByteObjectMap<V>

a copy of this map without the matching key/value pairs

selectback to summary
public ByteObjectMap<V> select(ByteObjectPredicate<? super V> predicate)

Return a copy of this map containing only the key/value pairs that match the predicate.

Parameters
predicate:ByteObjectPredicate<? super V>

the predicate to determine which key/value pairs in this map should be included in the returned map

Returns:ByteObjectMap<V>

a copy of this map with the matching key/value pairs

tapback to summary
public ByteObjectMap<V> tap(Procedure<? super V> procedure)

Redeclares org.eclipse.collections.api.RichIterable.tap.

Doc from org.eclipse.collections.api.RichIterable.tap.

Executes the Procedure for each element in the iterable and returns this.

Example using a Java 8 lambda expression:

RichIterable<Person> tapped =
    people.tap(person -> LOGGER.info(person.getName()));
Annotations
@Override
toImmutableback to summary
public ImmutableByteObjectMap<V> toImmutable()

Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.

Returns:ImmutableByteObjectMap<V>

an immutable map that is equivalent to this one