本文整理了Java中clojure.lang.Namespace.getAliases()
方法的一些代码示例,展示了Namespace.getAliases()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Namespace.getAliases()
方法的具体详情如下:
包路径:clojure.lang.Namespace
类名称:Namespace
方法名:getAliases
暂无
代码示例来源:origin: org.dunaj/clojure
public Namespace lookupAlias(Symbol alias){
IPersistentMap map = getAliases();
return (Namespace) map.valAt(alias);
}
代码示例来源:origin: org.dunaj/clojure
public void removeAlias(Symbol alias) {
IPersistentMap map = getAliases();
while(map.containsKey(alias))
{
IPersistentMap newMap = map.without(alias);
aliases.compareAndSet(map, newMap);
map = getAliases();
}
}
代码示例来源:origin: videlalvaro/clochure
public void removeAlias(Symbol alias) {
IPersistentMap map = getAliases();
while(map.containsKey(alias))
{
IPersistentMap newMap = map.without(alias);
aliases.compareAndSet(map, newMap);
map = getAliases();
}
}
代码示例来源:origin: videlalvaro/clochure
public Namespace lookupAlias(Symbol alias){
IPersistentMap map = getAliases();
return (Namespace) map.valAt(alias);
}
代码示例来源:origin: videlalvaro/clochure
public void addAlias(Symbol alias, Namespace ns){
if (alias == null || ns == null)
throw new NullPointerException("Expecting Symbol + Namespace");
IPersistentMap map = getAliases();
while(!map.containsKey(alias))
{
IPersistentMap newMap = map.assoc(alias, ns);
aliases.compareAndSet(map, newMap);
map = getAliases();
}
// you can rebind an alias, but only to the initially-aliased namespace.
if(!map.valAt(alias).equals(ns))
throw new IllegalStateException("Alias " + alias + " already exists in namespace "
+ name + ", aliasing " + map.valAt(alias));
}
代码示例来源:origin: org.dunaj/clojure
public void addAlias(Symbol alias, Namespace ns){
if (alias == null || ns == null)
throw new NullPointerException("Expecting Symbol + Namespace");
IPersistentMap map = getAliases();
while(!map.containsKey(alias))
{
IPersistentMap newMap = map.assoc(alias, ns);
aliases.compareAndSet(map, newMap);
map = getAliases();
}
// you can rebind an alias, but only to the initially-aliased namespace.
if(!map.valAt(alias).equals(ns))
throw new IllegalStateException("Alias " + alias + " already exists in namespace "
+ name + ", aliasing " + map.valAt(alias));
}
内容来源于网络,如有侵权,请联系作者删除!