de.cm.frw.core.fun.impl
Class Stream.SimplePair
java.lang.Object
de.cm.frw.core.fun.impl.Stream.SimplePair
- All Implemented Interfaces:
- Pair
- Enclosing class:
- Stream
public static class Stream.SimplePair
- extends java.lang.Object
- implements Pair
This would be called an cons cell in Lisp:
(cons a b) = new Pair(a, b)
(car (cons a b)) = a = (new Pair(a, b)).first()
(cdr (cons a b)) = b = (new Pair(a, b)).second()
- Author:
- cm
Method Summary |
java.lang.Object |
first()
|
java.lang.Object |
second()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Stream.SimplePair
public Stream.SimplePair(java.lang.Object a,
java.lang.Object b)
first
public java.lang.Object first()
- Specified by:
first
in interface Pair
second
public java.lang.Object second()
- Specified by:
second
in interface Pair