/* BSD 2-Clause License - see OPAL/LICENSE for details. */ package org.opalj package da import scala.xml.Node import scala.xml.NodeSeq /** * @author Michael Eichberg */ trait CONSTANT_Ref extends Constant_Pool_Entry { final override def size: Int = 1 + 2 + 2 val class_index: Constant_Pool_Index val name_and_type_index: Constant_Pool_Index override def asCPNode(implicit cp: Constant_Pool): Node =
{ this.getClass().getSimpleName } (
class_index={ class_index } « { cp(class_index).asCPNode } »
name_and_type_index={ name_and_type_index } « { cp(name_and_type_index).asCPNode } »
)
def asInstructionParameter(classType: Option[String])(implicit cp: Constant_Pool): NodeSeq = { { if (classType.isDefined) { classType.get }  else NodeSeq.Empty } { asJavaReferenceType(class_index).asSpan("") } {{ { cp(name_and_type_index).asInstructionParameter } }} } override def toString(implicit cp: Constant_Pool): String = { cp(class_index).toString(cp)+"{ "+cp(name_and_type_index).toString(cp)+" }" } } object CONSTANT_Ref { def unapply(ref: CONSTANT_Ref): Option[(Constant_Pool_Index, Constant_Pool_Index)] = { Some((ref.class_index, ref.name_and_type_index)) } }