本文整理汇总了Java中clojure.lang.Keyword类的典型用法代码示例。如果您正苦于以下问题:Java Keyword类的具体用法?Java Keyword怎么用?Java Keyword使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Keyword类属于clojure.lang包,在下文中一共展示了Keyword类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepare
import clojure.lang.Keyword; //导入依赖的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);
}
}
开发者ID:metamx,项目名称:incubator-storm,代码行数:26,代码来源:ClojureBolt.java
示例2: open
import clojure.lang.Keyword; //导入依赖的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);
}
}
开发者ID:metamx,项目名称:incubator-storm,代码行数:26,代码来源:ClojureSpout.java
示例3: writeChunk
import clojure.lang.Keyword; //导入依赖的package包/类
private void writeChunk(Object body, boolean close) throws IOException {
if (body instanceof Map) { // only get body if a map
body = ((Map<Keyword, Object>) body).get(BODY);
}
if (body != null) { // null is ignored
ByteBuffer buffers[];
ByteBuffer t = bodyBuffer(body);
if (t.hasRemaining()) {
ByteBuffer size = chunkSize(t.remaining());
buffers = new ByteBuffer[]{size, t, ByteBuffer.wrap(newLineBytes)};
server.tryWrite(key, buffers);
}
}
if (close) {
serverClose(0);
}
}
开发者ID:nLight,项目名称:jruby-http-kit,代码行数:18,代码来源:AsyncChannel.java
示例4: readable
import clojure.lang.Keyword; //导入依赖的package包/类
private static Keyword readable(int status) {
switch (status) {
case 0:
return K_BY_SERVER;
case -1:
return K_CLIENT_CLOSED;
case 1000:
return K_WS_1000;
case 1001:
return K_WS_1001;
case 1002:
return K_WS_1002;
case 1003:
return K_WS_1003;
default:
return K_UNKNOWN;
}
}
开发者ID:nLight,项目名称:jruby-http-kit,代码行数:19,代码来源:AsyncChannel.java
示例5: Engine
import clojure.lang.Keyword; //导入依赖的package包/类
public Engine() {
updateHandlers = new HashMap<clojure.lang.Keyword,UpdateHandler>();
updateKinematics = new HashMap<clojure.lang.Keyword,Boolean>();
physics = new BrPhysics();
//objects = new HashMap<Long,BrObject>();
objects = new ConcurrentHashMap<Long,BrObject>();
addedObjects = new HashMap<Long,BrObject>();
deletedObjects = new HashSet<Long>();
collisionHandlers = new HashMap< SimpleEntry<clojure.lang.Keyword,clojure.lang.Keyword>, CollisionHandler >();
collisions = new HashSet< SimpleEntry<Long,Long> >();
globalCollisions = new HashSet< SimpleEntry<Long,Long> >();
globalUpdateHandlers =
new PriorityQueue<GlobalUpdateHandler>(1, (Comparator<GlobalUpdateHandler>) new GUHComparator() );
simulationStart = System.nanoTime();
spaceTree = new BrKDTree<BrKDNode>(10);
}
开发者ID:kephale,项目名称:brevis,代码行数:21,代码来源:Engine.java
示例6: valAt
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public Object valAt(Object o) {
try {
if (o instanceof Keyword) {
return getValueByField(((Keyword) o).getName());
} else if (o instanceof String) {
return getValueByField((String) o);
}
} catch (IllegalArgumentException e) {
}
return null;
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:13,代码来源:TupleImpl.java
示例7: valAt
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public Object valAt(Object o) {
if (o instanceof Keyword) {
return valAt(((Keyword) o).getName());
}
return getMap().valAt(o);
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:IndifferentAccessMap.java
示例8: assoc
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public IPersistentMap assoc(Object k, Object v) {
if (k instanceof Keyword)
return assoc(((Keyword) k).getName(), v);
return new IndifferentAccessMap(getMap().assoc(k, v));
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:IndifferentAccessMap.java
示例9: assocEx
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public IPersistentMap assocEx(Object k, Object v) {
if (k instanceof Keyword)
return assocEx(((Keyword) k).getName(), v);
return new IndifferentAccessMap(getMap().assocEx(k, v));
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:IndifferentAccessMap.java
示例10: without
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public IPersistentMap without(Object k) {
if (k instanceof Keyword)
return without(((Keyword) k).getName());
return new IndifferentAccessMap(getMap().without(k));
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:IndifferentAccessMap.java
示例11: entryAt
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public IMapEntry entryAt(Object k) {
if (k instanceof Keyword)
return entryAt(((Keyword) k).getName());
return getMap().entryAt(k);
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:IndifferentAccessMap.java
示例12: prepare
import clojure.lang.Keyword; //导入依赖的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>() {
/**
*
*/
private static final long serialVersionUID = 8969454649175064263L;
{
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);
}
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:36,代码来源:ClojureBolt.java
示例13: open
import clojure.lang.Keyword; //导入依赖的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>() {
/**
*
*/
private static final long serialVersionUID = 9036954267397717931L;
{
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);
}
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:36,代码来源:ClojureSpout.java
示例14: prepare
import clojure.lang.Keyword; //导入依赖的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);
}
}
开发者ID:songtk,项目名称:learn_jstorm,代码行数:31,代码来源:ClojureBolt.java
示例15: open
import clojure.lang.Keyword; //导入依赖的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);
}
}
开发者ID:songtk,项目名称:learn_jstorm,代码行数:31,代码来源:ClojureSpout.java
示例16: valAt
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public Object valAt(Object o) {
try {
if (o instanceof Keyword) {
return getValueByField(((Keyword) o).getName());
} else if (o instanceof String) {
return getValueByField((String) o);
}
} catch (IllegalArgumentException e) {
}
return null;
}
开发者ID:kkllwww007,项目名称:jstrom,代码行数:13,代码来源:TupleImpl.java
示例17: valAt
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public Object valAt(Object o) {
if (o instanceof Keyword) {
return valAt(((Keyword) o).getName());
}
return getMap().valAt(o);
}
开发者ID:kkllwww007,项目名称:jstrom,代码行数:8,代码来源:IndifferentAccessMap.java
示例18: prepare
import clojure.lang.Keyword; //导入依赖的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);
}
}
开发者ID:kkllwww007,项目名称:jstrom,代码行数:28,代码来源:ClojureBolt.java
示例19: open
import clojure.lang.Keyword; //导入依赖的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);
}
}
开发者ID:kkllwww007,项目名称:jstrom,代码行数:28,代码来源:ClojureSpout.java
示例20: valAt
import clojure.lang.Keyword; //导入依赖的package包/类
@Override
public Object valAt(Object o) {
try {
if(o instanceof Keyword) {
return getValueByField(((Keyword) o).getName());
} else if(o instanceof String) {
return getValueByField((String) o);
}
} catch(IllegalArgumentException e) {
}
return null;
}
开发者ID:metamx,项目名称:incubator-storm,代码行数:13,代码来源:TupleImpl.java
注:本文中的clojure.lang.Keyword类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论