public AtomicDatatype intersection( AtomicDatatype dt ) {
if( this == dt )
return this;
GenericIntervalList result = new GenericIntervalList( valueSpace );
if( dt instanceof BaseXSDAtomicType ) {
BaseXSDAtomicType other = (BaseXSDAtomicType) dt;
GenericIntervalList original = new GenericIntervalList( values );
Iterator it = other.values.iterator();
while( it.hasNext() ) {
GenericIntervalList.Interval interval = (GenericIntervalList.Interval) it.next();
GenericIntervalList o = new GenericIntervalList( original );
o.restrictToInterval( interval );
result.addIntervalList( o );
}
}
return create( result );