Questions tagged [keyset]

76 questions
3
votes
3 answers

Stream map in order to find value of latest key

I have a Map consisting of instances of the following (example) class and enum, where I want to get the value of the most recent key via stream(). The most recent key can be determined by the property creationTime of the class…
deHaar
  • 17,687
  • 10
  • 38
  • 51
3
votes
3 answers

Map.keySet() read sequence?

I have Map> map now, putting two values inside Map, now when read keyset from map gives in different sequence in different device. private Map> map = new HashMap<>(); map.put("First", new…
Vishal Patoliya ツ
  • 3,170
  • 4
  • 24
  • 45
3
votes
2 answers

Why do we need LinkedHashMap if keySet() maintains order for a HashMap?

public class HashMapKeySet { public static void main(String[] args) { Map map=new HashMap(); map.put(new HashCodeSame(10),true); map.put(new HashCodeSame(2),false); for(HashCodeSame i:map.keySet()) …
dgupta3091
  • 1,067
  • 1
  • 7
  • 18
3
votes
4 answers

Why Java HashMap get(key) works faster when keys are read using same HashMap's Iterator than when keys are read using a Set's Iterator?

For HashMap, after inserting it with 10000000 unique random values. I perform get(), using the hashmap's keySet(), like in the following code snippet: HashMap hashmap = new HashMap
Dheeraj
  • 45
  • 8
2
votes
1 answer

Creating an B2C Identity Experience Framework Policy Key with Key Secret in a single Graph API call

I'm developing a console app that uploads a custom policy (that part is working) and the related policy key using the Graph API following this documentation…
Marlyn
  • 41
  • 3
2
votes
3 answers

How to sort the keySet() of a TreeMap with keys containing number?

I'll briefly describe what I did and then show how the result I got, differs from my desired result. Thanks in advance for any suggestions. Java code was created in a java online compiler and is executable there without error message in any…
Dorian Feyerer
  • 258
  • 5
  • 14
2
votes
0 answers

Compare builtin `setOf` with Android's `keySet`?

Trying to ensure consistency concisely across my application. How do I check the bundle has the same keys as a set? - Or how do I construct a keySet succinctly for comparison? import android.os.Bundle fun main() { val expect = setOf("alpha",…
A T
  • 13,008
  • 21
  • 97
  • 158
2
votes
1 answer

Ruby - Hash not storing keys

I have executed the following in irb: irb(main):068:0* map = Hash.new(Array.new) => {} irb(main):069:0> map["a"] => [] irb(main):070:0> map["a"].push("hello") => ["hello"] irb(main):071:0> map["a"].push(1) => ["hello", 1] irb(main):072:0>…
Aly
  • 15,865
  • 47
  • 119
  • 191
2
votes
5 answers

HashMap function keyset() in java

HashMap h=new HashMap<>(); for(int i=0; i keys=h.keySet(); Character [] arr=new Character[keys.size()]; keys.toArray(arr); String ans=""; for(int…
2
votes
1 answer

Why Java 6 overrides keySet(), entrySet() and values() interface in SortedMap

Java 5 http://docs.oracle.com/javase/1.5.0/docs/api/java/util/SortedMap.html Java 6 https://docs.oracle.com/javase/6/docs/api/java/util/SortedMap.html As you can see that since Java 6, these three apis are overridden. Can anyone tell me what's the…
Jiaguo Fang
  • 333
  • 1
  • 2
  • 11
2
votes
1 answer

How to define element to create a shortcut key for firefox extension command

I need to define shortcut keys Ctrl+. and Ctrl+/ to my extension's functions. Here is what I have in my browser.xul overlay:
Kashif
  • 1,238
  • 10
  • 15
2
votes
1 answer

Get value from hashmap/keyset in java?

I have code where I am placing two values into a Hashmap, and then accessing them from within another method. I am iterating through one value "dog", but at the end of the method, I need to print out the "race" relating to that "dog" value... Here's…
re0603
  • 387
  • 1
  • 4
  • 19
2
votes
1 answer

Python 3 installation failed 'Keyset as registered is invalid'

I have been trying to get Python 3 installed, but this error occurs: I am running it on Windows 8 64-bit. I will keep trying. Thanks for the help. I didn't find any articles on the matter, so I came here.
user3864563
  • 365
  • 1
  • 7
  • 22
2
votes
0 answers

"System.Security.Cryptography.CryptographicException: Keyset does not exist" when reading private key from remote machine

I am trying to access the private key of an X509 certificate intalled in a certificate store on a remote machine. Whilst I can access the cert store and the certificate on the remote server, I get the error…
Hamid Shahid
  • 4,486
  • 3
  • 32
  • 41
2
votes
1 answer

HashMap as an ArrayList of Strings

first off this is an assignment so I'm more looking for help then coded answers (don't want to cheat!). My assignment is to create a program that processes a train/railway network of stations. The section i'm stuck on adds the stations, their…
JavaStarta
  • 67
  • 1
  • 11