Win a copy of Java Challengers this week in the Java in General forum!

Brett Bolen

Greenhorn
+ Follow
since Aug 25, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brett Bolen

How does it compare with Jack Crenshaw's book --  https://www.amazon.com/Math-Toolkit-Real-Time-Programming-Crenshaw/dp/1929629095 .  This was one of my favorite books.  It is similar to the Feynman and  Asimov books that describe science or math.
1 month ago
Actually they are in different packages as well.
b
17 years ago
But what if UglyMap and FriendlyMap are different classes?
b�
17 years ago
Is there a way to limit access to a super classes' public methods?
say I have three classes all derived from a JPanel.
UserMap
|
FriendlyMap
|
UglyMap
|
JPanel
I have some functions in UglyMap, that I want FriendlyMap to use
but I don't want the UserMap to use. Is there a way I can say
that FriendlyMap can use UglyMap.clear(), but stop UserMap
from calling UglyMap.clear()?
Protected doesn't work.
I figured out a way that might work but is messy ( does
declaring 'private FriendlyMap.clear()' work?). This is
messy because UglyMap has about 300 methods in it.
if java had something like c++ friends ( an ugly hack, I
admit), it might help.
Is there another way to do this?

wl
17 years ago