Question: I want to create a table that looks like the attached photo, but can only have 1 column to have input and the rest column are untouchable.

I am using SMSS 2014 in creating database and Visual Studio 2015 Community in frontend.

[enter image description here](http://i.stack.imgur.com/jf7TE.jpg)

Answer: 
The most important thing to understand, regarding this question, is that when you pass a lambda expression to a particular library like the `Stream` API, all the library receives is an implementation of a functional interface, e.g. an instance of `Predicate`. It has no knowledge about what that implementation will do and therefore has no way to exploit scenarios like filtering sorted data via comparison. The stream library simply doesn’t know that the `Predicate` is doing a comparison.

An implementation doing such an optimization would need an interaction of the JVM, which knows and understands the code, and the library, which knows the semantics. Such thing does not happen in current implementation and is currently far away, at least as I can see it.

If the source is a tree or sorted list and you want to benefit from that for filtering, you have to do it using APIs operating on the source, before creating the stream. E.g. suppose, we have a `TreeSet` and want to filter it to get items within a particular range, like

```
// our made-up source
TreeSet<Integer> tree=IntStream.range(0, 100).boxed()
    .collect(Collectors.toCollection(TreeSet::new));
// the naive implementation
tree.stream().filter(i -> i>=65 && i<91).forEach(i->System.out.print((char)i.intValue()));

```

We can do instead:

```
tree.tailSet(65).headSet(91).stream().forEach(i->System.out.print((char)i.intValue()));

```

which will utilize the sorted/tree nature. When we have a sorted list instead, say

```
List<Integer> list=new ArrayList<>(tree);

```

utilizing the sorted nature is more complex as the collection itself doesn’t know that it’s sorted and doesn’t offer operations utilizing that directly:

```
int ix=Collections.binarySearch(list, 65);
if(ix<0) ix=~ix;
if(ix>0) list=list.subList(ix, list.size());
ix=Collections.binarySearch(list, 91);
if(ix<0) ix=~ix;
if(ix<list.size()) list=list.subList(0, ix);
list.stream().forEach(i->System.out.print((char)i.intValue()));

```

Of course, the stream operations here are only exemplary and you don’t need a stream at all, when all you do then is `forEach`…
As far as I am aware, there's no such differenciation for normal streaming.

However, you might be better off when you use parallel streaming when you use a collection which is easily devideable, like ArrayList over LinkedList or any type of Set.