本文整理汇总了Java中gnu.lists.Pair.getCar方法的典型用法代码示例。如果您正苦于以下问题:Java Pair.getCar方法的具体用法?Java Pair.getCar怎么用?Java Pair.getCar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.lists.Pair
的用法示例。
在下文中一共展示了Pair.getCar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluate
import gnu.lists.Pair; //导入方法依赖的package包/类
public Object evaluate(Object clauses, Translator tr) {
while (clauses instanceof Pair) {
Pair pclauses = (Pair) clauses;
Object clause = pclauses.getCar();
clauses = pclauses.getCdr();
if (! (clause instanceof Pair))
tr.errorWithPosition("cond-expand clauses is not a list",
pclauses);
Pair pclause = (Pair) clause;
Object test = Translator.stripSyntax(pclause.getCar());
if ((test == elseSymbol && clauses == LList.Empty)
|| evaluateConditionCar(pclause, tr))
return pclause.getCdr();
}
tr.errorIfNonEmpty(clauses);
return LList.Empty;
}
示例2: createMessageForGetAndEvalScripts
import gnu.lists.Pair; //导入方法依赖的package包/类
private String createMessageForGetAndEvalScripts(LList urlsOrScripts) {
if (urlsOrScripts.isEmpty()) {
return "";
}
Pair p = (Pair) urlsOrScripts;
String e = (String) p.getCar();
if (e.startsWith("http:") || e.startsWith("/")) {
return String
.format("$.getScript($.inArray('%s', loadedScripts)==-1?'%s':null)"
+ ".always(function(script, textStatus) {"
+ "%s" + "});"
+ "if($.inArray('%s', loadedScripts)==-1){loadedScripts.push('%s');}",
e, e,
createMessageForGetAndEvalScripts((LList) p.getCdr()), e, e);
} else {
return e + System.lineSeparator()
+ createMessageForGetAndEvalScripts((LList) p.getCdr());
}
}
示例3: proc
import gnu.lists.Pair; //导入方法依赖的package包/类
private static void proc(LList args, Map<Keyword, Object> argsMap) {
if (!(args instanceof Pair)) {
return;
}
Pair p = (Pair) args;
Object car = p.getCar();
LList cdr = ((LList) p.getCdr());
if (car instanceof Keyword) {
argsMap.put((Keyword) car, ((Pair) cdr).getCar());
} else {
argsMap.put(Keyword.make("rest"), new ArrayList<Object>(Arrays.asList(args.toArray())));
return;
}
proc((LList) ((Pair) cdr).getCdr(), argsMap);
}
示例4: drainTo
import gnu.lists.Pair; //导入方法依赖的package包/类
private static void drainTo(KeyValueTable result, LList args) {
if (args.isEmpty()) {
return;
}
Pair pair = (Pair) args;
LList arg = (LList) pair.getCar();
Map<Keyword, Object> argsMap = LiteralUtils.createArgsMap(arg);
Symbol name = (Symbol) argsMap.get(Keyword.make("name"));
Object defaultVal = argsMap.get(Keyword.make("default"));
LList round = (LList) argsMap.get(Keyword.make("round"));
LList queue = (LList) argsMap.get(Keyword.make("queue"));
LList roundQueues = (LList) argsMap.get(Keyword.make("round-queues"));
if (round != null) {
result.putValueOfEachRound(name.toString(), round);
}
if (roundQueues != null) {
List<Queue<?>> qs = new CopyOnWriteArrayList<>();
for (Object o : new ArrayList<>(roundQueues)) {
qs.add(new ConcurrentLinkedQueue<>((List<?>) o));
}
result.putQueuesOfEachRound(name.toString(), qs);
}
if (queue != null) {
result.putQueue(name.toString(), queue);
}
if (defaultVal != null) {
result.putDefaultValue(name.toString(), defaultVal);
}
drainTo(result, (LList) pair.getCdr());
}