Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.github.kubatatami.judonetworking.observers;
 
 import  android.util.Pair;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;

Created by Kuba on 24/05/14.
public class ObservableTransaction {
    protected List<Pair<ObservableWrapperObject>> wrapperObjectList =
            new ArrayList<>();
    <T> void add(ObservableWrapper<T> observableWrapper, T value){
        .add(new Pair<ObservableWrapperObject>(observableWrappervalue));
    }
    public void commit(){
        for(int i=.size()-1;i>=0;i--){
            Pair<ObservableWrapper,Objectpair = .get(i);
            if(!pair.first.set(pair.second,false)){
                .remove(i);
            }
        }
        for(Pair<ObservableWrapperObjectpair : ){
            pair.first.notifyObservers();
        }
    }
New to GrepCode? Check out our FAQ X