Package au.csiro.snorocket.core.util

Examples of au.csiro.snorocket.core.util.SparseConceptSet


    private int size = 0;

    S(final int capacity) {
        set = new DenseConceptMap<IConceptSet>(capacity);
        for (int i = 0; i < capacity; i++) {
            final SparseConceptSet subsumes = new SparseConceptSet();
            subsumes.add(i);
            subsumes.add(IFactory.TOP_CONCEPT);
            set.put(i, subsumes);
        }
        size = capacity;
    }
View Full Code Here


    IConceptSet get(int concept) {
        IConceptSet subsumes = set.get(concept);

        if (null == subsumes) {
            // A Concept always subsumes itself and TOP
            subsumes = new SparseConceptSet();
            subsumes.add(concept);
            subsumes.add(IFactory.TOP_CONCEPT);
            set.put(concept, subsumes);
            size++;
        }
View Full Code Here

    void put(int child, int parent) {
        IConceptSet subsumes = set.get(child);

        if (null == subsumes) {
            subsumes = new SparseConceptSet();
            set.put(child, subsumes);
            size++;
            // A Concept always subsumes itself and TOP
            subsumes.add(child);
            subsumes.add(IFactory.TOP_CONCEPT);
View Full Code Here

    protected IConceptSet getConcept(int r) {
        if (r >= data.length) {
            resizeRoles(r + 1);
        }
        if (null == data[r]) {
            data[r] = new SparseConceptSet();
        }
        return data[r];
    }
View Full Code Here

     */
    private void rePrimeNF6(AxiomSet as, IConceptMap<IConceptSet> subsumptions) {
        int size = as.getNf6Axioms().size();
        if (size == 0)
            return;
        IConceptSet deltaNF6 = new SparseConceptSet(size);
        for (NF6 nf6 : as.getNf6Axioms()) {
            deltaNF6.add(nf6.getR());
        }

        for (IntIterator it = deltaNF6.iterator(); it.hasNext();) {
            int role = it.next();
            for (IntIterator it2 = contextIndex.keyIterator(); it2.hasNext();) {
                int concept = it2.next();
                Context ctx = contextIndex.get(concept);
                if (ctx.getSucc().containsRole(role) && !ctx.getSucc().lookupConcept(role).contains(concept)) {
View Full Code Here

        if (r >= ROLES) {
            resizeRoles(r);
        }
        final int index = indexOf(A, r);
        if (null == data[index]) {
            data[index] = new SparseConceptSet();
            addRole(r);

            if (null != base && index < base.length && null != base[index]) {
                data[index].addAll(base[index]);
            }
View Full Code Here

            return IConceptSet.EMPTY_SET;
        }
        final int index = indexOf(B, r) + 1;
        if (null == data[index]) {
            if (null != base && index < base.length && null != base[index]) {
                data[index] = new SparseConceptSet();
                data[index].addAll(base[index]);
                return new ReadonlyConceptSet(data[index]);
            } else {
                return IConceptSet.EMPTY_SET;
            }
View Full Code Here

            return IConceptSet.EMPTY_SET;
        }
        final int index = indexOf(A, r);
        if (null == data[index]) {
            if (null != base && index < base.length && null != base[index]) {
                data[index] = new SparseConceptSet();
                data[index].addAll(base[index]);
                return new ReadonlyConceptSet(data[index]);
            } else {
                return IConceptSet.EMPTY_SET;
            }
View Full Code Here

            resizeRoles(r);
        }
        // Note the "+1" in the following line:
        final int index = indexOf(B, r) + 1;
        if (null == data[index]) {
            data[index] = new SparseConceptSet();
            addRole(r);

            if (null != base && index < base.length && null != base[index]) {
                data[index].addAll(base[index]);
            }
View Full Code Here

     *
     * @param concept
     */
    public Context(int concept) {
        this.concept = concept;
        s = new SparseConceptSet();
        s.add(concept);
        s.add(IFactory.TOP_CONCEPT);

        pred = new CR(factory.getTotalRoles());
        succ = new CR(factory.getTotalRoles());
View Full Code Here

TOP

Related Classes of au.csiro.snorocket.core.util.SparseConceptSet

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.