|
From: Brett <wak...@ea...> - 2005-04-18 23:11:09
|
On Mon, 2005-04-18 at 23:21 +0200, Erik Vos wrote:
> Wouldn't a method have been simpler?
>
> boolean hasTokens() {
> return (tokens.size() != 0);
> }
Hmmm... I think that may be.
> Maybe the confusion comes because I'm linking company and space objects as a
> whole,
> rather than having a separate int price attribute in a company object?
>
> In my stockmarket servlet the code is like
>
> for (row = 0; row < stockMarket.getNumberOfRows(); row++) {
> for (col = 0; col < stockMarket.getNumberOfColumns(); col++)
> {
> square = stockMarket.getStockSpace(row, col);
> if (square != null) {
> // draw square
> iterator = square.getTokens().iterator();
> while (iterator.hasNext()) {
> company = (PublicCompany)
> iterator.next();
> // draw company marker
> }
> }
> }
> }
>
> and I don't see why similar code would not work for you.
> I guess I'm missing a point somewhere....
>
Hmmm... can you compare this with my swing version and see if I'm making
the problem harder than it needs to be?
---Brett.
...this is an awesome sight. The entire rebel resistance buried under
six million hardbound copies of "The Naked Lunch." - The Firesign
Theater
|