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:
java.lang.Comparable<Unit>,java.lang.Iterable,java.util.Collection,java.util.List
public class Unit extends java.util.AbstractList implements java.lang.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).
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUnit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Unit o)java.lang.Objectget(int index)intsize()java.lang.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
-
-
-
-
Field Detail
-
INSTANCE
public static final Unit INSTANCE
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.AbstractCollection
-
get
public java.lang.Object get(int index)
- Specified by:
getin interfacejava.util.List- Specified by:
getin classjava.util.AbstractList
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein interfacejava.util.List- Specified by:
sizein classjava.util.AbstractCollection
-
-