Guest User

Untitled

a guest
Feb 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. List<Pair<Integer, Pair<Integer, Integer>>> listPairOfPair = null;
  2.  
  3. listPairOfPair.add(new Pair<Integer, Pair<Integer, Integer>>(1, (2,3));
  4.  
  5. listPairOfPair.add(new Pair<Integer, Pair<Integer, Integer>>(1, Pair.create(2,3)));
  6.  
  7. Pair<Integer, Integer> onePair = new Pair<>(1, 2); // assuming that you are using that android class that has this ctor
  8.  
  9. Pair<Integer, Pair<Integer, Integer>> pairOfPairs = new Pair<>(3, onePair);
  10.  
  11. List<Pair<Integer, Pair<Integer, Integer>>> listOfPairedPairs = new ArrayList<>();
  12. listOfPairedPairs.add(pairOfPairs);
  13.  
  14. listdOfPairedPairs = Arrays.asList(pairOfPairs, someOtherPair, ...);
  15.  
  16. public Pair<Integer, Pair<Integer, Integer>> of(Integer i1, Integer i2, Integer i3) {
  17. ... check that uses such code and returns such a paired pair
  18.  
  19. listdOfPairedPairs = Arrays.asList(of(1,2,3) , of(4,5,6));
  20.  
  21. listPairOfPair.add(new Pair<>(1, new Pair<>(2, 3)));
  22.  
  23. listPairOfPair.add(Pair.create(1, Pair.create(2, 3)));
Add Comment
Please, Sign In to add comment