N
N
Nikita072021-08-03 15:16:32
Java
Nikita07, 2021-08-03 15:16:32

What is written here?

Hello everyone, help me figure out what the line means setAllField.confidence?

MutableAgentField setAllField = allFields.get(SET_ALL_FIELDS);
long confidence = setAllField.confidence;


I do not work with JAVA, I mainly program in NET and now I need to rewrite one element from JAVA to NET

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ArchmageFil, 2021-08-12
@ArchmageFil

If the search engine is not mistaken, then we are talking about yauaa .
In this case, allFields is a map where the key is a string and the value is an object:

557 Map<String, MutableAgentField> allFields = new HashMap<>();

132 SET_ALL_FIELDS is just a constant key for a hash map.
615 MutableAgentField setAllField - declaration of a new nested class object declared in:
import nl.basjes.parse.useragent.AgentField.MutableAgentField;

setAllField.confidence is a direct access to the object variable
70 long confidence ; Since both classes are in the same package, the variable with default access is visible without calling methods.
Thus, in these two lines: First, an object is obtained from the map using a constant key, and then the value of its field is assigned to the variable.
I hope it helped.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question