Package net.hydromatic.morel.eval
Class Unit
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList
-
- net.hydromatic.morel.eval.Unit
-
- All Implemented Interfaces:
Comparable<Unit>,Iterable,Collection,List
public class Unit extends AbstractList implements Comparable<Unit>
A placeholder value for the "unit" type.We sometimes use it as a dummy value when we need to add a variable (and its type) to the compilation environment but we don't have a value (because it's not a runtime environment).
-
-
Field Summary
Fields Modifier and Type Field Description static UnitINSTANCE-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUnit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Unit o)Objectget(int index)intsize()StringtoString()-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Field Detail
-
INSTANCE
public static final Unit INSTANCE
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toStringin classAbstractCollection
-
get
public Object get(int index)
- Specified by:
getin interfaceList- Specified by:
getin classAbstractList
-
size
public int size()
- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList- Specified by:
sizein classAbstractCollection
-
compareTo
public int compareTo(Unit o)
- Specified by:
compareToin interfaceComparable<Unit>
-
-