本文整理汇总了Java中clojure.lang.RT类的典型用法代码示例。如果您正苦于以下问题:Java RT类的具体用法?Java RT怎么用?Java RT使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RT类属于clojure.lang包,在下文中一共展示了RT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import clojure.lang.RT; //导入依赖的package包/类
private void init() {
loader = new DynamicClassLoaderSimple(ClassLoader.getSystemClassLoader());
loader.addJars(classPath);
loader.addDynamicDir(outDir);
String loadFunctionPrefix = "run_str";
currenClojureNS = String.format("%1$s_%2$s", beaker_clojure_ns, shellId);
try {
String clojureInitScript = String.format(initScriptSource(), beaker_clojure_ns, shellId,
loadFunctionPrefix);
clojureLoadString = RT.var(String.format("%1$s_%2$s", beaker_clojure_ns, shellId),
String.format("%1$s_%2$s", loadFunctionPrefix, shellId));
clojure.lang.Compiler.load(new StringReader(clojureInitScript));
} catch (IOException e) {
logger.error(e.getMessage());
}
exit = false;
executor = new BeakerCellExecutor("clojure");
}
示例2: traverseFrom
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseFrom(final Object lbound, Winner winner) {
if (null == winner)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(lbound, lkey) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lbound, lubound) <= 0 ?
traverseFrom(lbound, match.left) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseFrom(lbound, match.right);
}
})
);
}
示例3: rtraverseFrom
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseFrom(final Object ubound, Winner winner) {
if (null == winner)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(lkey, ubound) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, ubound) <= 0 ?
rtraverseFrom(ubound, match.right) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseFrom(ubound, match.left);
}
})
);
}
示例4: traverseAtMost
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseAtMost(final Object priority, final Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) > 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseAtMost(priority, match.left);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseAtMost(priority, match.right);
}
})
);
}
示例5: traverseBelow
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseBelow(final Object priority, final Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) >= 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseBelow(priority, match.left);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseBelow(priority, match.right);
}
})
);
}
示例6: rtraverseAtMost
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseAtMost(final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) > 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseAtMost(priority, match.right);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseAtMost(priority, match.left);
}
})
);
}
示例7: rtraverseBelow
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseBelow(final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) >= 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseBelow(priority, match.right);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseBelow(priority, match.left);
}
})
);
}
示例8: open
import clojure.lang.RT; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void open(Map stormConf, TopologyContext context,
SpoutOutputCollector collector) {
_collector = collector;
_context = context;
workerTimeoutMills = 1000 * RT.intCast(stormConf.get(Config.SUPERVISOR_WORKER_TIMEOUT_SECS));
_process = new ShellProcess(_command);
Number subpid = _process.launch(stormConf, context);
LOG.info("Launched subprocess with pid " + subpid);
heartBeatExecutorService = MoreExecutors.getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1));
}
示例9: prepare
import clojure.lang.RT; //导入依赖的package包/类
@Override
public void prepare(final Map stormConf, final TopologyContext context, final OutputCollector collector) {
IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
try {
IFn preparer = (IFn) hof.applyTo(RT.seq(_params));
final Map<Keyword,Object> collectorMap = new PersistentArrayMap( new Object[] {
Keyword.intern(Symbol.create("output-collector")), collector,
Keyword.intern(Symbol.create("context")), context});
List<Object> args = new ArrayList<Object>() {{
add(stormConf);
add(context);
add(collectorMap);
}};
_bolt = (IBolt) preparer.applyTo(RT.seq(args));
//this is kind of unnecessary for clojure
try {
_bolt.prepare(stormConf, context, collector);
} catch(AbstractMethodError ame) {
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例10: open
import clojure.lang.RT; //导入依赖的package包/类
@Override
public void open(final Map conf, final TopologyContext context, final SpoutOutputCollector collector) {
IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
try {
IFn preparer = (IFn) hof.applyTo(RT.seq(_params));
final Map<Keyword,Object> collectorMap = new PersistentArrayMap( new Object[] {
Keyword.intern(Symbol.create("output-collector")), collector,
Keyword.intern(Symbol.create("context")), context});
List<Object> args = new ArrayList<Object>() {{
add(conf);
add(context);
add(collectorMap);
}};
_spout = (ISpout) preparer.applyTo(RT.seq(args));
//this is kind of unnecessary for clojure
try {
_spout.open(conf, context, collector);
} catch(AbstractMethodError ame) {
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例11: create
import clojure.lang.RT; //导入依赖的package包/类
static public PersistentPrioritySearchQueue create(ISeq items) {
IPersistentMap ret = EMPTY;
for (; items != null; items = items.next().next()) {
if (items.next() == null)
throw new IllegalArgumentException(
String.format("No value supplied for key: %s", items.first())
);
ret = ret.assoc(items.first(), RT.second(items));
}
return (PersistentPrioritySearchQueue) ret;
}
示例12: traverse
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverse(final Object key, final Object priority, Loser losers) {
if (null == losers)
return RT.list(new MapEntry(key, priority));
final Object lkey = losers.key;
final Object lpriority = losers.priority;
final Loser lleft = losers.left;
final Loser lright = losers.right;
if (kcomp.compare(lkey, losers.split) <= 0)
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(lkey, lpriority, lleft);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(key, priority, lright);
}
})
);
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(key, priority, lleft);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(lkey, lpriority, lright);
}
})
);
}
示例13: rtraverse
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverse(final Object key, final Object priority, Loser losers) {
if (null == losers)
return RT.list(new MapEntry(key, priority));
final Object lkey = losers.key;
final Object lpriority = losers.priority;
final Loser lleft = losers.left;
final Loser lright = losers.right;
if (kcomp.compare(lkey, losers.split) <= 0)
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(key, priority, lright);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(lkey, lpriority, lleft);
}
})
);
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(lkey, lpriority, lright);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(key, priority, lleft);
}
})
);
}
示例14: traverseAtMostRange
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseAtMostRange(final Object low, final Object high, final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) > 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(low, lkey) <= 0 && kcomp.compare(lkey, high) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(low, lubound) <= 0 ?
traverseAtMostRange(low, high, priority, match.left) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, high) <= 0 ?
traverseAtMostRange(low, high, priority, match.right) :
null;
}
})
);
}
示例15: traverseBelowRange
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseBelowRange(final Object low, final Object high, final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) >= 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(low, lkey) <= 0 && kcomp.compare(lkey, high) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(low, lubound) <= 0 ?
traverseBelowRange(low, high, priority, match.left) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, high) <= 0 ?
traverseBelowRange(low, high, priority, match.right) :
null;
}
})
);
}