Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9007385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:40:30+00:00 2026-06-16T01:40:30+00:00

Consider a wrapper class W , wrapping C , this meaning that for most

  • 0

Consider a wrapper class W, wrapping C, this meaning that for most attributes of C, there is a correspondent attribute A on W, its logic consisting in nothing more than delegation to C‘s A. This situation can be most precisely depicted with the sketch shown below:

class W {
    private C c;

    getX() { return c.getX(); }
    getY() { return c.getY(); }
}

The trouble is that I’ve decided that I wan’t to get rid of getX(), and I’d prefer to either as a transitory step to put C c as public, having all the calling code of W do a w.c.getX() or w.c.getY() or alternatively to put create a W.getC(), and have all calls to getX() and getY() go through it.

What this all boils down is to an “un-encapsulate” refactoring. Is there anything performing this much needed task either in Eclipse or Intellij?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:40:32+00:00Added an answer on June 16, 2026 at 1:40 am
    1. Write your new getC() method.
    2. Rewrite getX() to be return getC().getX().
    3. Inline getX().

    The same goes for y.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this very simple example, where I have template wrapper class for which are
Consider the following wrapper function that retrys a given function some given number of
Consider this code: class test { public static void main(String[] args) { test inst_test
Consider this simple class: template<class T> class Foo{ public: Foo(T const& val) : _val(val)
Consider the following example: ( live demo here ) HTML: <div id=outer_wrapper> <div class=wrapper>
Consider the following example : HTML: <div class=wrapper> <div class=left>Some text here</div><div class=right>Hello Stack
Consider the following code : HTML: <div id=wrapper> <div class='a'></div> <div class='a'></div> <div class='a'></div>
Lets consider a simple class template< typename T > class Wrapper { public: //
Consider this class: @Entity class Bar { @Id private long id; private FooId fooId;
Consider the following example: ( live demo here ) HTML: <div class=wrapper> <div city_id=1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.