[1217] in java-interest

home help back first fref pref prev next nref lref last post

Information exchange between objects

daemon@ATHENA.MIT.EDU (JD Brennan)
Sat Aug 26 06:39:33 1995

Date: Sat, 26 Aug 1995 00:11:19 -0700
From: JD Brennan <brennan@symbologic.com>
To: Paul Beerkens <beerkens@prl.philips.co.uk>
Cc: java-interest@java.sun.com
In-Reply-To: <79149596@toto.iv>
Reply-To: JD Brennan <brennan@symbologic.com>

Paul Beerkens writes:
 > I have a problem with exchanging information between objects.

I've modified your example, to illustrate a method:

class Test extends Applet {
  int Matrix [] [];

  public void init ()
  {
	Matrix=new int [100] [100];
	startup IwantToAccessMatrix(this);
  };

  public void mouseDown (int x,y)
  {
	change matrix
  };
};

class IwantToAcessMatrix extends thread
{
  int Matrix [] [];
  public IwantToAccessMatrix(Test aTest) {
	Matrix = aTest.Matrix;
  }

  public void run ()
  {
	action according to matrix status
  }
};

This could be improved by having an AccessToMatrix interface that
Test implements and is pass to the IwantToAccessMatrix constructor.

JD Brennan
[brennan@symbologic.com               Symbologic Corp., Seattle, WA]
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post