当前位置: 首页>>代码示例>>Java>>正文


Java IPersistentCollection类代码示例

本文整理汇总了Java中clojure.lang.IPersistentCollection的典型用法代码示例。如果您正苦于以下问题:Java IPersistentCollection类的具体用法?Java IPersistentCollection怎么用?Java IPersistentCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IPersistentCollection类属于clojure.lang包,在下文中一共展示了IPersistentCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getWorkerDependenciesCount

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
/**
 * Returns the amount of worker dependencies in <code>assignment</code>.
 * 
 * @param assignment the assignment to return the amount for
 * @return the amount of worker dependencies
 */
public static int getWorkerDependenciesCount(Assignment assignment) {
    int result = 0;
    IPersistentCollection coll = getWorkerDependencies(assignment);
    if (null != coll) {
        result = coll.count();
    }
    return result;
}
 
开发者ID:QualiMaster,项目名称:Infrastructure,代码行数:15,代码来源:ZkUtils.java

示例2: createAssignment

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
/**
 * Creates an assignment instance. This method is required to support both, the original Storm version as 
 * well as the enhanced QM version.
 * 
 * @param masterCodeDir the directory where the pipeline code is located
 * @param nodeHost the node-host mapping (assignmentId - physical host names)
 * @param executorNodePort the executor - node/port mapping, i.e. [start/end task Id] to port and assignmentId
 * @param executorStart the executorId - start time mapping
 * @param workerDependencies the optional worker dependencies for enacting changes in the correct sequence
 * @return the created assignment instance, <b>null</b> if creation was not possible for some reason 
 */
public static Assignment createAssignment(Object masterCodeDir, IPersistentMap nodeHost, 
    IPersistentMap executorNodePort, IPersistentMap executorStart, IPersistentCollection workerDependencies) {
    Assignment result = null;
    Constructor<?> consEx = null; // the QM extended version
    Constructor<?> consDflt = null; // the default version
    for (Constructor<?> cons : Assignment.class.getConstructors()) {
        int paramCount = cons.getParameterTypes().length;
        if (5 == paramCount) {
            consEx = cons;
        } else if (4 == paramCount) {
            consDflt = cons;
        }
    }

    try {
        if (null != consEx) {
            result = (Assignment) consEx.newInstance(masterCodeDir, nodeHost, executorNodePort, executorStart, 
                workerDependencies);
        } else if (null != consDflt) {
            LOGGER.warn("This is not the QM Storm version running. Falling back to original assignment");
            result = (Assignment) consDflt.newInstance(masterCodeDir, nodeHost, executorNodePort, executorStart);
        }
    } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
        | InvocationTargetException e) {
        LOGGER.error(e.getMessage(), e);
    }
    return result;
}
 
开发者ID:QualiMaster,项目名称:Infrastructure,代码行数:40,代码来源:ZkUtils.java

示例3: empty

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
@Override
public IPersistentCollection empty() {
    return EMPTY_MAP;
}
 
开发者ID:cgrand,项目名称:confluent-map,代码行数:5,代码来源:TrieMap_5Bits.java

示例4: empty

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
public IPersistentCollection empty() {
    // TODO support meta
    return new ConfluentHashMap(Node.EMPTY);
}
 
开发者ID:cgrand,项目名称:confluent-map,代码行数:5,代码来源:ConfluentHashMap.java

示例5: cons

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
@Override
public IPersistentCollection cons(Object o) {
	return getMap().cons(o);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:5,代码来源:IndifferentAccessMap.java

示例6: empty

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
@Override
public IPersistentCollection empty() {
	return new IndifferentAccessMap(PersistentArrayMap.EMPTY);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:5,代码来源:IndifferentAccessMap.java

示例7: cons

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
public IPersistentCollection cons(Object o) {
	return getMap().cons(o);
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:4,代码来源:IndifferentAccessMap.java

示例8: empty

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
public IPersistentCollection empty() {
	return new IndifferentAccessMap(PersistentArrayMap.EMPTY);
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:4,代码来源:IndifferentAccessMap.java

示例9:

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
public final static ISeq core$cons(Object x, IPersistentCollection xs) {
	return (ISeq) core$cons.invoke(x, xs);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:4,代码来源:ClojureHelper.java

示例10: replaceInSeq

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
protected static ISeq replaceInSeq(ISeq xs, int i, IValue x) {
	IPersistentVector leftRight = core$splitAt(i, xs);
	ISeq newLeft = (ISeq) leftRight.nth(0);	
	ISeq newRight = (ISeq) core$cons.invoke(x, core$next((IPersistentCollection) leftRight.nth(1)));
	return core$concat(newLeft, newRight);
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:7,代码来源:List.java

示例11: toPersistent

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
/**
 * Returns a persistent immutable version of this TransientSet. This operation is performed in
 * constant time. Note that after this method is called, this transient instance will no longer
 * be usable and attempts to modify it will fail.
 */
public ClojureSet<T> toPersistent() {
    IPersistentCollection persistent = delegate.persistent();
    IPersistentSet asSet = (IPersistentSet) persistent;
    return ClojureSet.wrap(asSet);
}
 
开发者ID:rschmitt,项目名称:collider,代码行数:11,代码来源:TransientSet.java

示例12: toPersistent

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
/**
 * Returns a persistent immutable version of this TransientList. This operation is performed in
 * constant time. Note that after this method is called, this transient instance will no longer
 * be usable and attempts to modify it will fail.
 */
public ClojureList<T> toPersistent() {
    IPersistentCollection persistent = delegate.persistent();
    IPersistentVector asVector = (IPersistentVector) persistent;
    return ClojureList.wrap(asVector);
}
 
开发者ID:rschmitt,项目名称:collider,代码行数:11,代码来源:TransientList.java

示例13: cons

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
public IPersistentCollection cons(Object o) {
    return getMap().cons(o);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:4,代码来源:IndifferentAccessMap.java

示例14: empty

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
public IPersistentCollection empty() {
    return new IndifferentAccessMap(PersistentArrayMap.EMPTY);
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:4,代码来源:IndifferentAccessMap.java

示例15: count

import clojure.lang.IPersistentCollection; //导入依赖的package包/类
@Override
public int count() {
    return ((IPersistentCollection) map).count();
}
 
开发者ID:rschmitt,项目名称:dynamic-object,代码行数:5,代码来源:DynamicObjectInstance.java


注:本文中的clojure.lang.IPersistentCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。