Class EmptyList

java.lang.Object
nz.org.riskscape.engine.types.EmptyList
All Implemented Interfaces:
ContainingType, Type, WrappingType

public class EmptyList extends Object implements Type, ContainingType, WrappingType

A special case of a list type, which is always empty. It is special, as it is co-variant with any other list, e.g. an empty list can be assigned to any other list type without upsetting type safety.

It wraps a list of type nothing, so that if you want to pretend it's a list, Type#find will do the right thing. Note that we return a list of type nothing so that if you attempt to use the member type, no equivalence or covariance is going to work for you