![JAR search and dependency download from the Maven repository](/logo.png)
com.jfreeman.attribute.EarlyBoundAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lazy Show documentation
Show all versions of lazy Show documentation
A library for type-safe, tractable lazy evaluation and late binding in Java.
package com.jfreeman.attribute;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.jfreeman.lazy.Lazy;
/**
* An attribute that is always written before it is read.
*
* @author jfreeman
*/
public class EarlyBoundAttribute
implements Attribute
{
private final Map> _attrs = new ConcurrentHashMap<>();
/**
* {@inheritDoc}
*
* May not be called for a node until after its value has been
* {@link #put(Object, Lazy)}.
*/
@Override
public Lazy get(N node) {
return _attrs.get(node);
}
/**
* {@inheritDoc}
*
* Must be called before {@link #get(Object)} for the same node.
*/
@Override
public void put(N node, Lazy value) {
_attrs.put(node, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy