1

Can someone please tell me what this is doing. Its a class that holds an extending generic of itself? what does that even mean?

 public abstract class AbstractStructureBuilder<T extends AbstractStructureBuilder> implements IStructureBuilder
    {

       //abstract and concrete methods in here
    }
6
  • possible duplicate of Why in java enum is declared as Enum<E extends Enum<E>> in particular this answer. Commented Nov 29, 2012 at 18:33
  • @assylias I'm asking a question of unknown syntax, I cannot draw correlation to an unknown topic. Commented Nov 29, 2012 at 18:34
  • 1
    Does the link I provided help? Commented Nov 29, 2012 at 18:40
  • 1
    I commented on your answer. Thanks again for the supporting information Commented Nov 29, 2012 at 18:42
  • @stackoverflow Not sure what you mean - I'm just pointing out the fact that a very good answer has been given on a very similar question, which you might find useful. Commented Nov 29, 2012 at 18:48

3 Answers 3

1

The correct answer and some rational is given here: http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeParameters.html#FAQ106

Sign up to request clarification or add additional context in comments.

Comments

1

It means the AbstractStructureBuilder has a type parameter that extends AbstractStructureBuilder.

Comments

0

There's not much there, but I would guess this could be a class for representing nodes in a tree or graph. The class would have generified getters and setters. For instance a method getChildren might return a list of T. Then one can extend AbstractStructureBuilder to, for example, make nodes in a family tree. If you do that, then the getter will return List<FamilyTreeNode>.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.