• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can someone please further explain "Line" and its sub-classes?  RSS feed

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read what the documentation had to say, all I understand that it's..."something" that, once started, hogs the necessary resources, but I have a hard time imagining what it is exactly, is it just a normal object existing in the heap? That's now what I understood.

I mean, for example, when reading on streams and seeing the diagrams, I visually imagine how they are attached and how the data flows, and I'm trying to do the same thing with Line, if possible.

Also, what's the basic, superficial difference between Line, DataLine, and TargetLine/SourceLine? The last two are the most important
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resource allocation and heap-hogging and all that are not really what a beginner should be worried about. I took a quick look at line, last night i wrote a test program than ran out of heap because I failed to clear the storage area each time I completed the loop.

No big deal, I found it and fixed it in minutes.

The way you get rid of something in java is like this:

doSomething(Object o){ work; work; work; work; work; work; }

When the logic path leaves the curly braces, Object o is no longer needed and the runtime can detect this situation easily. The area is reclaimed for use somewhere else if needed.

Streams, at your level, are Exactly the same thing as a file on disk. When you open a file with notepad, that's pretty close to what it looks like on disc.

Line, DataLine, and TargetLine/SourceLine? are just something somebody came up with trying to explain something to you. You can make these extensions yourself in your first program if you want to.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!