Example usage for java.lang.ref WeakReference WeakReference

List of usage examples for java.lang.ref WeakReference WeakReference

Introduction

In this page you can find the example usage for java.lang.ref WeakReference WeakReference.

Prototype

public WeakReference(T referent) 

Source Link

Document

Creates a new weak reference that refers to the given object.

Usage

From source file:io.github.moosbusch.lumpi.gui.impl.SelectionAdapter.java

public SelectionAdapter(Component eventSource, T value, Expression expr) {
    this.eventSourceRef = new WeakReference<>(Objects.requireNonNull(eventSource));
    this.data = new Dictionary.Pair<>(expr, new WeakReference<>(Objects.requireNonNull(value)));
}

From source file:com.bubblegum.traceratops.app.ui.adapters.plugins.AbsAdapterPlugin.java

public AbsAdapterPlugin(BaseActivity activity) {
    activityRef = new WeakReference<>(activity);
}

From source file:com.shafiq.myfeedle.core.BitmapDownloadTask.java

public BitmapDownloadTask(ImageView imageView, HttpClient httpClient) {
    mImageViewReference = new WeakReference<ImageView>(imageView);
    mHttpClient = httpClient;
}

From source file:at.jclehner.rxdroid.RxDroid.java

public static void setContext(Context context) {
    sContextRef = new WeakReference<Context>(context);
    sHandler = new Handler(context.getMainLooper());
}

From source file:com.mi.xserv.XservBase.java

public void setOnEventListener(Xserv.OnXservEventListener onEventListener) {
    mDelegate = new WeakReference<>(onEventListener);
}

From source file:com.android.tabcarousel.CarouselPagerAdapter.java

/**
 * Constructor for <code>ViewPagerAdapter</code>
 * /* ww w  . j a va 2s. c om*/
 * @param ViewPager A reference the parent {@link ViewPager}
 */
public CarouselPagerAdapter(ViewPager viewPager, CarouselContainer carouselHeader) {
    if (viewPager == null || carouselHeader == null) {
        throw new IllegalStateException("The ViewPager and CarouselHeader must not be null");
    }
    mReference = new WeakReference<ViewPager>(viewPager);
    viewPager.setOnPageChangeListener(this);
    mCarousel = carouselHeader;
    mCarousel.setListener(this);
}

From source file:me.lehrner.newsgroupsndy.presenter.tasks.UpdateGroupListAsyncTask.java

public UpdateGroupListAsyncTask(GroupPresenter groupPresenter, GroupRepository groupRepository) {
    mGroupPresenterWeakReference = new WeakReference<>(groupPresenter);
    mGroupRepository = groupRepository;//from  w  w w . ja  v a2  s . c om
}

From source file:com.parse.ParseRelation.java

ParseRelation(ParseObject parent, String key) {
    this.parent = new WeakReference<>(parent);
    this.parentObjectId = parent.getObjectId();
    this.parentClassName = parent.getClassName();
    this.key = key;
    this.targetClass = null;
}

From source file:cc.osint.graphd.sim.ProcessGroup.java

public ProcessGroup(Graph graph, String name, ExecutorService executorService, PoolFiberFactory fiberFactory) {
    this.graphRef = new WeakReference<Graph>(graph);
    this.name = name;
    processMap = new ConcurrentHashMap<String, GraphProcess<T, M>>();
    this.executorService = executorService;
    this.fiberFactory = fiberFactory;
    scriptEngineMap = new ConcurrentHashMap<String, GScriptEngine>();
    log.info("process group instantiated: " + name);
}

From source file:my.home.lehome.asynctask.LoadLongMsgAsyncTask.java

public LoadLongMsgAsyncTask(FourStateHandler handler, Context context) {
    super();
    mHandler = handler;
    mContext = new WeakReference<>(context);
}