Questions tagged [class-hierarchy]

Class hierarchy refers to a set of classes and their inter-relationships.

A classification of object types, denoting objects as the instantiations of classes (class is like a blueprint, the object is what is built from that blueprint) inter-relating the various classes by relationships such as "inherits", "extends", "is an abstraction of", "an interface definition".

http://en.wikipedia.org/wiki/Class_hierarchy

276 questions
160
votes
3 answers

How to test if one java class extends another at runtime?

How to I test if a is a subclass of b? Class a = A.class; Class b = B.class;
Armand
  • 23,463
  • 20
  • 90
  • 119
55
votes
5 answers

Difference between Module and Class in Python

Can I assign value to a variable in the module? If yes, what is the difference between a class and module? PS: I'm a Java guy (in case it helps in the way of explaining). Thanks.
liwevire
  • 782
  • 2
  • 9
  • 21
27
votes
5 answers

Ambiguous when two superclasses have a member function with the same name, but different signatures

struct A { void f(int x) {} }; struct B { template void f(T x) {} }; struct C : public A, public B {}; struct D { void f(int x){} template void f(T x) {} }; int main(int argc, char **argv) { C c; …
Fabio Dalla Libera
  • 1,297
  • 1
  • 10
  • 24
21
votes
2 answers

Can I see interfaces in Eclipse's type hierarchy view?

When I check the type hierarchy of a class that is derived from an interface in Eclipse, it doesn't show the interfaces. Is there a way to configure Eclipse to display the interfaces in the type hierarchy? Or is there any other way to see this…
oshai
  • 14,865
  • 26
  • 84
  • 140
19
votes
2 answers

IntelliJ IDEA: Is there a way to list all interfaces implemented by a class and its parents?

I work on a relatively complex Java project where classes commonly have four or five ancestors before Object. Given such a class, e.g. D in a hierarchy like this: Object > A > B > C > D, I would like to know what all interfaces it effectively…
mkorvas
  • 563
  • 3
  • 10
15
votes
2 answers

Does ruby provide a method to show the hierarchy calls?

That's all, i want to see what are the clases that inherits a fixed class. There is a method for this in Ruby? Aptana offers an option that shows this, but is there any method? Thanks
flyer88
  • 1,073
  • 3
  • 15
  • 33
14
votes
5 answers

OOP Difference between a derived class and an inherited class?

From an OOP point of view is there any difference between a derived class and an inherited class? Or is it simply terminology?
JL.
  • 78,954
  • 126
  • 311
  • 459
14
votes
8 answers

I need to implement C# deep copy constructors with inheritance. What patterns are there to choose from?

I wish to implement a deepcopy of my classes hierarchy in C# public Class ParentObj : ICloneable { protected int myA; public virtual Object Clone () { ParentObj newObj = new ParentObj(); newObj.myA =…
AnthonyLambert
  • 8,768
  • 4
  • 37
  • 72
12
votes
2 answers

Deciphering vtable dumps

I am "playing" with virtual inheritance in C++, and I want to know how a class object is laid out. I have those three classes: class A { private: int a; public: A() {this->a = 47;} virtual void setInt(int x) {this->a = x;} virtual…
pvinis
  • 4,059
  • 5
  • 39
  • 59
12
votes
7 answers

Tool to Show Class Hierarchies in .NET

Is there a way/tool that could show me all the classes/interfaces that implement a certain interface in my project? In Eclipse (Java) I would use the context menu "Open Type Hierarchy" option, which would show me a (pretty) tree of types that extend…
Hosam Aly
  • 41,555
  • 36
  • 141
  • 182
12
votes
3 answers

Is there a way to find all children of a Matlab class?

The Matlab function superclasses returns the names of all parents of a given class. Is there an equivalent to find all classes derived from a given class, i.e. children classes ? The function allchild seems to be restricted to graphical handles. If…
Ratbert
  • 5,463
  • 2
  • 18
  • 37
12
votes
9 answers

Class inheritance in python

I am solving this problem : Consider the following hierarchy of classes: class Person(object): def __init__(self, name): self.name = name def say(self, stuff): return self.name + ' says: ' + stuff…
sid597
  • 999
  • 3
  • 16
  • 31
12
votes
1 answer

What does the built in object hierarchy look like in javascript?

I was looking for a diagram which shows the built in types of javascript like Function and String but on google I keep finding diagrams with the browser-related stuff like Window. I'm just looking for the pure js object diagram. I know about the…
Adam Arold
  • 29,285
  • 22
  • 112
  • 207
11
votes
1 answer

Class and Interface hierarchies in Entity Framework?

I have two related classes which share a common interface and are both stored in the same underlying database table. However, the Entity Framework generates one common class, where I really need the two distinct classes. How do I resolve this? Is it…
flesh
  • 23,725
  • 24
  • 80
  • 97
10
votes
3 answers

Wrong name resolution when parent and inner class have the same name

I have an odd case with Visual Studio 2003. For somewhat legitimate reasons, I have the following hierarchy: class A {}; class B : public A { public: class A {}; }; class C : public B::A {}; That is, I have an inner class with the same name…
Michael Mrozek
  • 169,610
  • 28
  • 168
  • 175
1
2 3
18 19