本文整理汇总了Java中clojure.lang.Keyword类的典型用法代码示例。如果您正苦于以下问题:Java Keyword类的具体用法?Java Keyword怎么用?Java Keyword使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Keyword类属于clojure.lang包,在下文中一共展示了Keyword类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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;
}
示例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);
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}