Java Code Examples for org.apache.commons.collections.map.ReferenceMap

The following examples show how to use org.apache.commons.collections.map.ReferenceMap. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: tinkerpop   Author: apache   File: NL_O_OB_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
    final NL_O_OB_S_SE_SL_Traverser<R> clone = (NL_O_OB_S_SE_SL_Traverser<R>) super.split(r, step);
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #2
Source Project: tinkerpop   Author: apache   File: NL_O_OB_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Admin<T> split() {
    final NL_O_OB_S_SE_SL_Traverser<T> clone = (NL_O_OB_S_SE_SL_Traverser<T>) super.split();
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #3
Source Project: tinkerpop   Author: apache   File: B_LP_NL_O_P_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
    final B_LP_NL_O_P_S_SE_SL_Traverser<R> clone = (B_LP_NL_O_P_S_SE_SL_Traverser<R>) super.split(r, step);
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #4
Source Project: tinkerpop   Author: apache   File: B_LP_NL_O_P_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Admin<T> split() {
    final B_LP_NL_O_P_S_SE_SL_Traverser<T> clone = (B_LP_NL_O_P_S_SE_SL_Traverser<T>) super.split();
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #5
Source Project: tinkerpop   Author: apache   File: B_NL_O_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
    final B_NL_O_S_SE_SL_Traverser<R> clone = (B_NL_O_S_SE_SL_Traverser<R>) super.split(r, step);

    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #6
Source Project: tinkerpop   Author: apache   File: B_NL_O_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Admin<T> split() {
    final B_NL_O_S_SE_SL_Traverser<T> clone = (B_NL_O_S_SE_SL_Traverser<T>) super.split();

    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #7
Source Project: tinkerpop   Author: apache   File: B_LP_NL_O_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
    final B_LP_NL_O_S_SE_SL_Traverser<R> clone = (B_LP_NL_O_S_SE_SL_Traverser<R>) super.split(r, step);
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #8
Source Project: tinkerpop   Author: apache   File: B_LP_NL_O_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Admin<T> split() {
    final B_LP_NL_O_S_SE_SL_Traverser<T> clone = (B_LP_NL_O_S_SE_SL_Traverser<T>) super.split();
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #9
Source Project: tinkerpop   Author: apache   File: LP_NL_O_OB_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
    final LP_NL_O_OB_S_SE_SL_Traverser<R> clone = (LP_NL_O_OB_S_SE_SL_Traverser<R>) super.split(r, step);
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #10
Source Project: tinkerpop   Author: apache   File: LP_NL_O_OB_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Admin<T> split() {
    final LP_NL_O_OB_S_SE_SL_Traverser<T> clone = (LP_NL_O_OB_S_SE_SL_Traverser<T>) super.split();
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #11
Source Project: tinkerpop   Author: apache   File: LP_NL_O_OB_P_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public <R> Admin<R> split(final R r, final Step<T, R> step) {
    final LP_NL_O_OB_P_S_SE_SL_Traverser<R> clone = (LP_NL_O_OB_P_S_SE_SL_Traverser<R>) super.split(r, step);
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #12
Source Project: tinkerpop   Author: apache   File: LP_NL_O_OB_P_S_SE_SL_Traverser.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Admin<T> split() {
    final LP_NL_O_OB_P_S_SE_SL_Traverser<T> clone = (LP_NL_O_OB_P_S_SE_SL_Traverser<T>) super.split();
    clone.nestedLoops = new Stack<>();
    for(LabelledCounter lc : this.nestedLoops)
        clone.nestedLoops.push((LabelledCounter) lc.clone());

    if (this.loopNames != null) {
        clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
        while (loopNamesIterator.hasNext()) {
            final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();

            final int idx = this.nestedLoops.indexOf(pair.getValue());
            if (idx != -1)
                clone.loopNames.put(pair.getKey(), clone.nestedLoops.get(idx));
        }
    }

    return clone;
}
 
Example #13
Source Project: zap-extensions   Author: zaproxy   File: PersistentXSSUtils.java    License: Apache License 2.0 5 votes vote down vote up
/** Resets the state of {@code PersistentXSSUtils}. */
@SuppressWarnings("unchecked")
public static void reset() {
    uniqueIndex = 0;
    map = new HashMap<>();
    sourceToSinks = new HashMap<>();
    cachedUris =
            Collections.synchronizedMap(new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT));
    cachedParams =
            Collections.synchronizedMap(new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT));
}
 
Example #14
Source Project: scava   Author: crossminer   File: PongoFactory.java    License: Eclipse Public License 2.0 4 votes vote down vote up
private PongoFactory(){
	cache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
	getContributors().add(new ClasspathPongoFactoryContributor());
}
 
Example #15
Source Project: tinkerpop   Author: apache   File: NL_O_OB_S_SE_SL_Traverser.java    License: Apache License 2.0 4 votes vote down vote up
public NL_O_OB_S_SE_SL_Traverser(final T t, final Step<T, ?> step) {
    super(t, step);
    this.nestedLoops = new Stack<>();
    this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
}
 
Example #16
Source Project: tinkerpop   Author: apache   File: B_LP_NL_O_P_S_SE_SL_Traverser.java    License: Apache License 2.0 4 votes vote down vote up
public B_LP_NL_O_P_S_SE_SL_Traverser(final T t, final Step<T, ?> step, final long initialBulk) {
    super(t, step, initialBulk);
    this.nestedLoops = new Stack<>();
    this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
}
 
Example #17
Source Project: tinkerpop   Author: apache   File: B_NL_O_S_SE_SL_Traverser.java    License: Apache License 2.0 4 votes vote down vote up
public B_NL_O_S_SE_SL_Traverser(final T t, final Step<T, ?> step, final long initialBulk) {
    super(t, step, initialBulk);
    this.nestedLoops = new Stack<>();
    this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
}
 
Example #18
Source Project: tinkerpop   Author: apache   File: B_LP_NL_O_S_SE_SL_Traverser.java    License: Apache License 2.0 4 votes vote down vote up
public B_LP_NL_O_S_SE_SL_Traverser(final T t, final Step<T, ?> step, final long initialBulk) {
    super(t, step, initialBulk);
    this.nestedLoops = new Stack<>();
    this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
}
 
Example #19
Source Project: tinkerpop   Author: apache   File: LP_NL_O_OB_S_SE_SL_Traverser.java    License: Apache License 2.0 4 votes vote down vote up
public LP_NL_O_OB_S_SE_SL_Traverser(final T t, final Step<T, ?> step) {
    super(t, step);
    this.nestedLoops = new Stack<>();
    this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
}
 
Example #20
Source Project: tinkerpop   Author: apache   File: LP_NL_O_OB_P_S_SE_SL_Traverser.java    License: Apache License 2.0 4 votes vote down vote up
public LP_NL_O_OB_P_S_SE_SL_Traverser(final T t, final Step<T, ?> step) {
    super(t, step);
    this.nestedLoops = new Stack<>();
    this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
}