org.extendj.ast.AttributeValue Maven / Gradle / Ivy
The newest version!
package org.extendj.ast;
import java.util.ArrayList;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.IOException;
import java.util.Set;
import beaver.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.LinkedHashSet;
import java.util.*;
import org.jastadd.util.PrettyPrintable;
import org.jastadd.util.PrettyPrinter;
import java.util.zip.*;
import java.io.*;
import org.jastadd.util.*;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
/**
* @ast class
* @declaredat ASTState:2
*/
public class AttributeValue extends java.lang.Object {
/**
* This singleton object is an illegal, unused, attribute value.
* It represents that an attribute has not been memoized, or that
* a circular attribute approximation has not been initialized.
*/
public static final Object NONE = new Object();
public final T value;
public AttributeValue(T value) {
this.value = value;
}
public static boolean equals(AttributeValue v1, AttributeValue v2) {
if (v1 == null || v2 == null) {
return v1 == v2;
} else {
return equals(v1.value, v2.value);
}
}
public static boolean equals(V v1, V v2) {
if (v1 == null || v2 == null) {
return v1 == v2;
} else {
return v1 == v2 || v1.equals(v2);
}
}
}