Package org.mindswap.pellet.utils

Examples of org.mindswap.pellet.utils.GenericIntervalList


    protected BaseXSDAtomicType( ATermAppl name, ValueSpace valueSpace ) {
        super( name );

        this.valueSpace = valueSpace;
        this.values = new GenericIntervalList( valueSpace.getMinValue(), valueSpace.getMaxValue(), valueSpace );
    }
View Full Code Here


    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 );
View Full Code Here

    public AtomicDatatype union( AtomicDatatype dt ) {
        if( this == dt )
            return this;

        GenericIntervalList result = new GenericIntervalList( valueSpace );
        if( dt instanceof BaseXSDAtomicType ) {
            BaseXSDAtomicType other = (BaseXSDAtomicType) dt;

            result.addIntervalList( values );
            result.addIntervalList( other.values );
        }

        return create( result );
    }
View Full Code Here

    public AtomicDatatype difference( AtomicDatatype dt ) {
        if( this == dt )
            return EmptyDatatype.instance;

        GenericIntervalList result = new GenericIntervalList( valueSpace );
        if( dt instanceof BaseXSDAtomicType ) {
            BaseXSDAtomicType other = (BaseXSDAtomicType) dt;

            result.addIntervalList( values );
            result.removeIntervalList( other.values );
        }

        return create( result );
    }
View Full Code Here

        return create( result );
    }

    public AtomicDatatype enumeration( Set enum_ ) {
        GenericIntervalList result = new GenericIntervalList( valueSpace );
        for( Iterator i = enum_.iterator(); i.hasNext(); ) {
            Number number = (Number) i.next();
            result.addInterval( number, number );
        }

        return create( result );
    }
View Full Code Here

        return create( result );
    }

    public Datatype singleton( Object value ) {
        GenericIntervalList result = new GenericIntervalList( valueSpace );
        result.addInterval( value, value );

        return create( result );
    }
View Full Code Here

            }
            else
                return this;
           
            // create an interval from the min max values
            GenericIntervalList intervalList = new GenericIntervalList( values );
            // intersect the current interval list with this restriction
            intervalList.restrictToInterval( start, incStart, end, incEnd );
            // derive the new type
            return create( intervalList );
        } catch (Exception e) {
            e.printStackTrace();
            throw new UnsupportedOperationException("Value " + value + " is not valid for the facet " + facet);
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.utils.GenericIntervalList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.