Class Node
- java.lang.Object
-
- com.ss.android.ugc.bytex.common.graph.Node
-
- All Implemented Interfaces:
Jsonable,java.io.Serializable
- Direct Known Subclasses:
ClassNode,InterfaceNode
public abstract class Node extends java.lang.Object implements Jsonable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.util.concurrent.atomic.AtomicBooleandefinedflag of whether we have visit the real node
used by duplicate class checkerClassEntityentityjava.util.List<InterfaceNode>interfacesClassNodeparentparent class node of this class node
it could be null when it doesn't exists actually, it's a virtual class node
-
Constructor Summary
Constructors Constructor Description Node(ClassEntity entity, ClassNode parent, java.util.List<InterfaceNode> interfaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldEntityconfirmOriginField(java.lang.String name, java.lang.String desc)One field of a class may be not defined in this class, it probably is a field inherited from a specific ancestor class.MethodEntityconfirmOriginMethod(java.lang.String name, java.lang.String desc)One method of a class may be not defined in this class, it probably is a method inherited from a specific ancestor class.kotlin.Pair<java.util.Set<ClassNode>,java.util.Set<InterfaceNode>>getAllChildren(boolean includeSelf)booleaninheritFrom(Node node)Determines if the class or interface represented by the specified node parameter is either the same as, or is a superclass or superinterface of, the class or interface represented by this node.booleanisAssignableFrom(Node node)Determines if the class or interface represented by this node is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified node parameter.voidread(com.google.gson.stream.JsonReader jsonReader, com.google.gson.Gson gson)voidwrite(com.google.gson.stream.JsonWriter jsonWriter, com.google.gson.Gson gson)
-
-
-
Field Detail
-
parent
public ClassNode parent
parent class node of this class node
it could be null when it doesn't exists actually, it's a virtual class node
-
interfaces
public java.util.List<InterfaceNode> interfaces
-
entity
public ClassEntity entity
-
defined
public final transient java.util.concurrent.atomic.AtomicBoolean defined
flag of whether we have visit the real node
used by duplicate class checker
-
-
Constructor Detail
-
Node
public Node(ClassEntity entity, ClassNode parent, java.util.List<InterfaceNode> interfaces)
-
-
Method Detail
-
isAssignableFrom
public final boolean isAssignableFrom(Node node)
Determines if the class or interface represented by this node is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified node parameter. It returns true if so;otherwise it returns false. much like return node instanceof this
-
inheritFrom
public final boolean inheritFrom(Node node)
Determines if the class or interface represented by the specified node parameter is either the same as, or is a superclass or superinterface of, the class or interface represented by this node. It returns true if so;otherwise it returns false. much like return this instanceof node
-
confirmOriginMethod
public MethodEntity confirmOriginMethod(java.lang.String name, java.lang.String desc)
One method of a class may be not defined in this class, it probably is a method inherited from a specific ancestor class. So this method is used to find where the method was really defined.- Parameters:
name- method namedesc- method desc- Returns:
- If the method with specific 'name' and 'desc' is not found, it would return null.
-
confirmOriginField
public FieldEntity confirmOriginField(java.lang.String name, java.lang.String desc)
One field of a class may be not defined in this class, it probably is a field inherited from a specific ancestor class. So this method is used to find where the field with specific 'name' and 'desc' is really defined.- Parameters:
name- method namedesc- method desc- Returns:
- If the method with specific 'name' and 'desc' is not found, it would return null.
-
getAllChildren
public kotlin.Pair<java.util.Set<ClassNode>,java.util.Set<InterfaceNode>> getAllChildren(boolean includeSelf)
-
read
public void read(com.google.gson.stream.JsonReader jsonReader, com.google.gson.Gson gson) throws java.io.IOException
-
-