Questions tagged as 'collection'

1
answer

When to use Collections.emptyList ()?

I thought about using List<Object> lista = Collections.emptyList(); to initialize a list. But when I try to lista.add(element) I get a UnsupportedOperationException . After searching a bit, I saw that this occurs...
asked by 17.10.2017 / 19:26
1
answer

Save IEnumerableT inside a parent entity with LINQ

Dear, I have the following classes: public class Foto { [Key] public int Id { get; set; } [StringLength(500)] [Required(ErrorMessage = "Obrigatório")] public string Nome { get; set; } public int Item...
asked by 14.01.2016 / 14:36
1
answer

Mapk Collection, v Methods

Doubts about methods replace : compute : computeIfAbsent : computeIfPresent : forEach (briefly all that use function or biFuntion within input parameter) Is replace really necessary? this...
asked by 22.08.2014 / 15:21
1
answer

NamedQuery with Collection as Parameter

I'm using JPA NamedQuery to create a DTO. And in my Query I have as condition an IN and as parameter IN has values with white spaces in the middle. (Ex: 9292-929). and these values with whitespace, returns nothing. Only values with no...
asked by 05.01.2015 / 17:50
2
answers

I do not understand what is happening with this class controller, explain? [closed]

I do not really understand, if anyone can draw for me, thank you. class DisciplinaController extends GenericController<Disciplina>{ DisciplinaController() { super(Disciplina.class) } }     
asked by 21.12.2015 / 04:08
1
answer

reverseOrder () In java not reversing

I have a method in java to sort a vector in descending method, but when I run the test it returns the unordered vector. Follow Method: public void sort() { int vet[] = this.vetor; inverter(vet); } private void inverter(int[] vet) {...
asked by 20.06.2018 / 00:05
2
answers

How to assign the callback variable "cursor.toArray (err, doc)" to an external variable?

var result = []; var user = db.collection('user'); var cursor = user.find(); cursor.toArray(function (err, doc) { result = doc; }); console.log(result); // console -> []     
asked by 10.12.2017 / 16:31
1
answer

How can I move an element of an ArrayList to the last element?

I wonder if there is any method to perform the operation, without being manually concatenated. Example of what you intended: [1,2,3,4] - > [1,3,4,2]     
asked by 14.04.2017 / 11:31
1
answer

How to sort a table using Collections?

I am developing a similar application to the Olympic medals table. I have already done the classes and the table with the countries and their respective medals. Now I am hooked on the part that I need to organize the table by the greater amount...
asked by 23.08.2016 / 13:33
1
answer

Use the laravel diff in two collections

I'm trying to fetch items that are not in a particular product. I have, therefore, a model Produto , each product has several items, and another model Item . I'm trying to use Laravel's collections , more specifically the d...
asked by 11.12.2017 / 01:56