The Redstone Comparator is a special redstone block that is similar to a redstone repeater. Redstone comparators have a third torch on them, allowing for complex redstone features. Redstone comparators have three ports, with two being for input, the third for output. Redstone Comparators also measure how many things a entity holds or weighs allowing for very interesting adventure maps. They also detect how many items are stored in a container block (chest dropper dispenser etc.)
Here is a tutorial on how to build with a Redstone Comparator.