< prev index next >

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/BranchHandle.java

Print this page




  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 package com.sun.org.apache.bcel.internal.generic;
  22 
  23 /**
  24  * BranchHandle is returned by specialized InstructionList.append() whenever a
  25  * BranchInstruction is appended. This is useful when the target of this
  26  * instruction is not known at time of creation and must be set later
  27  * via setTarget().
  28  *
  29  * @see InstructionHandle
  30  * @see Instruction
  31  * @see InstructionList
  32  * @version $Id$
  33  */
  34 public final class BranchHandle extends InstructionHandle {
  35 
  36     // This is also a cache in case the InstructionHandle#swapInstruction() method is used
  37     // See BCEL-273
  38     private BranchInstruction bi; // An alias in fact, but saves lots of casts
  39 
  40 
  41     private BranchHandle(final BranchInstruction i) {
  42         super(i);
  43         bi = i;
  44     }
  45 
  46     /** Factory method.
  47      */
  48     static BranchHandle getBranchHandle( final BranchInstruction i ) {
  49         return new BranchHandle(i);
  50     }
  51 
  52 




  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 package com.sun.org.apache.bcel.internal.generic;
  22 
  23 /**
  24  * BranchHandle is returned by specialized InstructionList.append() whenever a
  25  * BranchInstruction is appended. This is useful when the target of this
  26  * instruction is not known at time of creation and must be set later
  27  * via setTarget().
  28  *
  29  * @see InstructionHandle
  30  * @see Instruction
  31  * @see InstructionList

  32  */
  33 public final class BranchHandle extends InstructionHandle {
  34 
  35     // This is also a cache in case the InstructionHandle#swapInstruction() method is used
  36     // See BCEL-273
  37     private BranchInstruction bi; // An alias in fact, but saves lots of casts
  38 
  39 
  40     private BranchHandle(final BranchInstruction i) {
  41         super(i);
  42         bi = i;
  43     }
  44 
  45     /** Factory method.
  46      */
  47     static BranchHandle getBranchHandle( final BranchInstruction i ) {
  48         return new BranchHandle(i);
  49     }
  50 
  51 


< prev index next >