title: How can I provided two interfaces (a "public" and and "extended" one) at the same time?
body: <p>I have blocks performing calculations using a function <code>step()</code>. The blocks can be connected to
  each other with <code>connect(Block)</code>.</p>
  
  <pre><code>interface Block {
      void connect(Block b);
      void step();
  }
  </code></pre>
  
  <p>However from within a concrete block implementation (e.g. in <code>step</code>) it should be
  possible to <code>read</code> from the connected block:</p>
  
  <pre><code>class ABlockImpl implements Block {
      private Block src; // link to the block this block is connected to
      public void connect(Block b) {
          src = b;
      }
  
      public void step() {
          double x = src.read(); // XXX src is of type Block and there is no read() in Block
          /* ... */
      }
  
      public double read() {
          return 3.14;
      }
  }
  </code></pre>
  
  <p>Since there is no <code>read()</code> in <code>Block</code>, this won't compile. For clients the "public" Block interface is sufficient, I need <code>read</code> only internally. I could add <code>read</code> to the Block interface, but to me this feels wrong.</p>
  
  <p>Since there are multiple different implementations of Block, I cannot cast <code>src</code> to <code>ABlockImpl</code> before the call to <code>read</code>.</p>
  
  <p>Is there an alternative way to "hide" <code>read</code>?</p>