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

public Interface ObjectByteMap<K>

extends ByteIterable
Known Direct Subinterfaces
org.eclipse.collections.api.map.primitive.ImmutableObjectByteMap, org.eclipse.collections.api.map.primitive.MutableObjectByteMap
Imports
java.util.Set, org.eclipse.collections.api.ByteIterable, .LazyIterable, .RichIterable, org.eclipse.collections.api.block.predicate.primitive.ObjectBytePredicate, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.block.procedure.primitive.ObjectByteProcedure, .ByteProcedure, org.eclipse.collections.api.block.function.primitive.ObjectObjectByteToObjectFunction, org.eclipse.collections.api.collection.primitive.MutableByteCollection, org.eclipse.collections.api.tuple.primitive.ObjectBytePair

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

Method Summary

Modifier and TypeMethod and Description
public default boolean
public boolean

Returns:

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

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

public boolean

Returns:

if this collection contains the value
containsValue
(byte
the value to test
value
)

Returns whether or not this map contains the value.

public ByteObjectMap<K>
flipUniqueValues()

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

public void
forEachKey(Procedure<? super K>
the procedure to invoke for each key
procedure
)

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

public void
forEachKeyValue(ObjectByteProcedure<? super K>
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 void
forEachValue(ByteProcedure
the procedure to invoke for each value in this map.
procedure
)

Iterates through each value in this map.

public byte

Returns:

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

Retrieves the value associated with the key.

public byte

Returns:

the value associated with the key, or ifAbsent if no such mapping exists.
getIfAbsent
(Object
the key
key
,
byte
the default value to return if no mapping exists for key
ifAbsent
)

Retrieves the value associated with the key, returning the specified default value if no such mapping exists.

public byte

Returns:

the value associated with the key
getOrThrow
(Object
the key
key
)

Retrieves the value associated with the key, throwing an IllegalStateException if no such mapping exists.

public default <IV> IV

Returns:

result of injecting the injectedValue into the map
injectIntoKeyValue
(IV
value to be injected into the map
injectedValue
,
ObjectObjectByteToObjectFunction<? super IV, ? super K, ? 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 Set<K>

Returns:

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

Returns a set containing all the keys in this map.

public LazyIterable<K>

Returns:

a view of the keys in this map
keysView
()

Returns a view of the keys in this map.

public RichIterable<ObjectBytePair<K>>

Returns:

a view of the keys in this map
keyValuesView
()

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

public ObjectByteMap<K>

Returns:

a copy of this map without the matching key/value pairs
reject
(ObjectBytePredicate<? super K>
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 ObjectByteMap<K>

Returns:

a copy of this map with the matching key/value pairs
select
(ObjectBytePredicate<? super K>
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 default ObjectByteMap<K>
public ImmutableObjectByteMap<K>

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.

public String

Returns:

a string representation of this ObjectByteMap
toString
()

Redeclares org.eclipse.collections.api.PrimitiveIterable.toString.

Follows the same general contract as java.util.AbstractMap#toString()

public MutableByteCollection

Returns:

the values as a collection backed by this map
values
()

Returns the values in this map as a separate collection.

Inherited from org.eclipse.collections.api.ByteIterable:
allSatisfyanySatisfyasLazyaverageaverageIfEmptybyteIteratorchunkcollectcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIntcollectLongcollectShortcontainscontainsAllcontainsAllcontainsAnycontainsAnycontainsNonecontainsNonecountdetectIfNoneeachflatCollectforEachinjectIntoinjectIntoBooleaninjectIntoByteinjectIntoCharinjectIntoDoubleinjectIntoFloatinjectIntoIntinjectIntoLonginjectIntoShortmaxmaxIfEmptymedianmedianIfEmptyminminIfEmptynoneSatisfyreducereduceIfEmptyrejectrejectselectselectsumsummaryStatisticstoArraytoArraytoBagtoListtoSettoSortedArraytoSortedListtoSortedListtoSortedListBytoSortedListBy

Method Detail

allSatisfyKeyValueback to summary
public default boolean allSatisfyKeyValue(ObjectBytePredicate<K> predicate)
Since
12.0
containsKeyback to summary
public boolean containsKey(Object key)

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

Parameters
key:Object

the key

Returns:boolean

if a mapping exists in this map for the key

containsValueback to summary
public boolean containsValue(byte value)

Returns whether or not this map contains the value.

Parameters
value:byte

the value to test

Returns:boolean

if this collection contains the value

flipUniqueValuesback to summary
public ByteObjectMap<K> flipUniqueValues()

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

Exceptions
IllegalStateException:
if the ByteObjectMap contains duplicate values.
Since
9.0
forEachKeyback to summary
public void forEachKey(Procedure<? super K> procedure)

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

Parameters
procedure:Procedure<? super K>

the procedure to invoke for each key

forEachKeyValueback to summary
public void forEachKeyValue(ObjectByteProcedure<? super K> procedure)

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

Parameters
procedure:ObjectByteProcedure<? super K>

the procedure to invoke for each key/value pair

forEachValueback to summary
public void forEachValue(ByteProcedure procedure)

Iterates through each value in this map.

Parameters
procedure:ByteProcedure

the procedure to invoke for each value in this map.

getback to summary
public byte get(Object key)

Retrieves the value associated with the key. If no mapping exists for the key, the default value (usually 0) is returned.

Parameters
key:Object

the key

Returns:byte

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

getIfAbsentback to summary
public byte getIfAbsent(Object key, byte ifAbsent)

Retrieves the value associated with the key, returning the specified default value if no such mapping exists.

Parameters
key:Object

the key

ifAbsent:byte

the default value to return if no mapping exists for key

Returns:byte

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

getOrThrowback to summary
public byte getOrThrow(Object key)

Retrieves the value associated with the key, throwing an IllegalStateException if no such mapping exists.

Parameters
key:Object

the key

Returns:byte

the value associated with the key

Exceptions
IllegalStateException:
if no mapping exists for the key
injectIntoKeyValueback to summary
public default <IV> IV injectIntoKeyValue(IV injectedValue, ObjectObjectByteToObjectFunction<? super IV, ? super K, ? 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:ObjectObjectByteToObjectFunction<? super IV, ? super K, ? 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 Set<K> 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:Set<K>

a mutable set containing the keys in this map

keysViewback to summary
public LazyIterable<K> 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:LazyIterable<K>

a view of the keys in this map

Since
5.0
keyValuesViewback to summary
public RichIterable<ObjectBytePair<K>> 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<ObjectBytePair<K>>

a view of the keys in this map

Since
5.0
rejectback to summary
public ObjectByteMap<K> reject(ObjectBytePredicate<? super K> predicate)

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

Parameters
predicate:ObjectBytePredicate<? super K>

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

Returns:ObjectByteMap<K>

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

selectback to summary
public ObjectByteMap<K> select(ObjectBytePredicate<? super K> predicate)

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

Parameters
predicate:ObjectBytePredicate<? super K>

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

Returns:ObjectByteMap<K>

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

tapback to summary
public default ObjectByteMap<K> tap(ByteProcedure procedure)

Overrides default org.eclipse.collections.api.ByteIterable.tap.

Annotations
@Override
Since
9.0.
toImmutableback to summary
public ImmutableObjectByteMap<K> toImmutable()

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

Returns:ImmutableObjectByteMap<K>

an immutable map that is equivalent to this one

toStringback to summary
public String toString()

Redeclares org.eclipse.collections.api.PrimitiveIterable.toString.

Follows the same general contract as java.util.AbstractMap#toString()

Returns:String

a string representation of this ObjectByteMap

Annotations
@Override
valuesback to summary
public MutableByteCollection values()

Returns the values in this map as a separate collection. The returned collection is backed by the map, so any changes made to the returned collection will affect the state of this map.

Returns:MutableByteCollection

the values as a collection backed by this map