Java 8 Reference - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Reference class.

This code example shows how to use the following methods:get
        this.loader = new WeakReference<>(loader);
    } 
 
    @Override 
    public ClassLoader getClassLoader() {
        return this.loader.get();
    } 
 
    @Override 
    public int getCurrentVersion() { 
        return this.configuration.getCurrentMarshallingVersion();
    } 
 
    @Override 
    public Unmarshaller createUnmarshaller(int version) throws IOException {
        return this.factory.createUnmarshaller(this.getMarshallingConfiguration(version));
    } 
 
    @Override 
    public Marshaller createMarshaller(int version) throws IOException {
8
CodeRank
This code example shows how to use the following methods:get
    private final ImageView mImageView;
 
    private WeakReference<Bitmap> bitmapReference;
 
    public BitmapFromURL(ImageView iv) {
        imageViewReference = new WeakReference<ImageView>(iv);
        mImageView = imageViewReference.get();
    } 
 
    @Override 
    protected Bitmap doInBackground(String... params) {
        bitmapReference = new WeakReference<Bitmap>(ApolloUtils.getBitmapFromURL(params[0]));
        return bitmapReference.get();
    } 
 
    @Override 
    protected void onPostExecute(Bitmap result) {
        if (result != null && mImageView != null)
            ApolloUtils.runnableBackground(mImageView, result);
        super.onPostExecute(result);
8
CodeRank
This code example shows how to use the following methods:get
    @Override 
    public ClassLoader getServerIntegrationClassLoader() {
        if (integrationClassLoader == null || integrationClassLoader.get() == null) {
            try { 
                Module module = Module.getBootModuleLoader().loadModule(ASIL);
                integrationClassLoader = new WeakReference<ClassLoader>(module.getClassLoader());
            } catch (ModuleLoadException e) {
                throw new RuntimeException(e);
            } 
        } 
        return integrationClassLoader.get();
    } 
 
    @Override 
    public ClassLoader getServerJAXRPCIntegrationClassLoader() {
        throw new UnsupportedOperationException();
    } 
 
    public static void register() { 
        ClassLoaderProvider.setDefaultProvider(new ModuleClassLoaderProvider()); 
7
CodeRank
This code example shows how to use the following methods:get
    private final AQuery aq;
 
    private final WeakReference<Context> contextReference;
 
    public LastfmGetArtistImages(Context context) {
        contextReference = new WeakReference<Context>(context);
 
        // Initiate AQuery 
        aq = new AQuery(contextReference.get());
    } 
 
    @Override 
    protected String doInBackground(String... artistname) {
        if (ApolloUtils.isOnline(contextReference.get()) && artistname[0] != null) {
            try { 
                artist = Artist.getImages(artistname[0], 1, 1, LASTFM_API_KEY);
                Iterator<Image> iterator = artist.getPageResults().iterator();
                while (iterator.hasNext()) {
                    Image mTemp = iterator.next();
                    url = mTemp.getImageURL(ImageSize.LARGESQUARE);
8
CodeRank
This code example shows how to use the following methods:get
    public boolean isUseUnprefixedChildTypes() { 
        return useUnprefixedChildTypes;
    } 
 
    public StandardResourceDescriptionResolver getChildResolver(String key){
        return new StandardResourceDescriptionResolver(keyPrefix+"."+key,bundleBaseName,bundleLoader.get(),reuseAttributesForAdd,useUnprefixedChildTypes);
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public ResourceBundle getResourceBundle(Locale locale) {
        if (locale == null) {
            locale = Locale.getDefault();
        } 
        return ResourceBundle.getBundle(bundleBaseName, locale, bundleLoader.get());
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public String getResourceDescription(Locale locale, ResourceBundle bundle) {
8
CodeRank
This code example shows how to use the following methods:get
	@Override 
	public V get(K key) {
		V result = null;
		Reference<V> reference = softMap.get(key);
		if (reference != null) {
			result = reference.get();
		} 
		return result;
	} 
 
	@Override 
	public boolean put(K key, V value) {
		softMap.put(key, createReference(value));
		return true; 
	} 
 
	@Override 
	public void remove(K key) {
		softMap.remove(key);
	} 
7
CodeRank
This code example shows how to use the following methods:get
 
    public GetCachedImages(Context c, int opt, ImageView iv) {
        contextReference = new WeakReference<Context>(c);
        mContext = contextReference.get();
        choice = opt;
        imageViewReference = new WeakReference<ImageView>(iv);
        mImageView = imageViewReference.get();
 
        // AQuery 
        aquery = new AQuery(mContext);
    } 
 
    @Override 
    protected Bitmap doInBackground(String... args) {
        if (choice == 0)
            url = ApolloUtils.getImageURL(args[0], ARTIST_IMAGE_ORIGINAL, mContext);
        if (choice == 1)
            url = ApolloUtils.getImageURL(args[0], ALBUM_IMAGE, mContext);
        bitmapReference = new WeakReference<Bitmap>(aquery.getCachedImage(url, 300));
        return bitmapReference.get();
8
CodeRank
This code example shows how to use the following methods:get
public abstract class SoftLazyValue<T> { 
  private SoftReference<T> myReference;
 
  public T getValue() { 
    T t;
    if (myReference == null || (t = myReference.get()) == null) {
      t = compute();
      myReference = new SoftReference<T>(t);
    } 
    return t;
  } 
 
  @NotNull 
  protected abstract T compute(); 
} 
8
CodeRank
This code example shows how to use the following methods:get
        return mAlpha;
    } 
    public void setAlpha(float alpha) {
        if (mAlpha != alpha) {
            mAlpha = alpha;
            View view = mView.get();
            if (view != null) {
                view.invalidate();
            } 
        } 
    } 
    public float getPivotX() { 
        return mPivotX;
    } 
    public void setPivotX(float pivotX) {
        if (!mHasPivot || mPivotX != pivotX) {
            prepareForUpdate(); 
            mHasPivot = true;
            mPivotX = pivotX;
            invalidateAfterUpdate(); 
7
CodeRank
This code example shows how to use the following methods:get
	/** 
	 * @tests java.lang.ref.SoftReference#SoftReference(java.lang.Object) 
	 */ 
	public void test_ConstructorLjava_lang_Object() { 
		bool = new Boolean(true);
                SoftReference sr = new SoftReference(bool);
                assertTrue("Initialization failed.", ((Boolean) sr.get())
                                .booleanValue());
	} 
 
	/** 
	 * @tests java.lang.ref.SoftReference#get() 
	 */ 
	public void test_get() { 
		bool = new Boolean(false);
		SoftReference sr = new SoftReference(bool);
		assertTrue("Same object not returned.", bool == sr.get());
	} 
 
	protected void setUp() { 
7
CodeRank
See Code Examples for Java 8 Reference Methods: