Sashi Gundoji

Greenhorn
+ Follow
since Jan 30, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sashi Gundoji

Hi all,

I am new to Java and I am having basic question about reflection.

I am having one main package and under main package I have several other package. See below example.

I need to search from main package to find all test files and get all variables of test files.

I need to search the whole main package.

Is it a good idea to use reflection or some other way. If reflection is good, then I would like to know how can I get all packages references by using reflection.

Example:

MainPackage
SubPackage1
subsubpackage11
test1.java
SubPackage2
test2.java
SubPackage3
subsubpackage31
test3.java


thanking you,

Regards,
Dimpu
17 years ago
Hi,

I am new to java. I have a large file it contains the lines. Each line will be terminated with \n.

I do not want to read all lines at once, I would like to read some blocks of lines at once.

I really did not find a method to read specified number of lines. I found there some methods which are reading the number of bytes.

If any body know how to read please send me the source.

Thanking you

Regards,
Dimpu
17 years ago
Hallo all,

I need one basic information about below program. I would like to know is this really works.

-> Base class
public abstract class test {

public Synchronized abstract void readData();


}

-> Child class1

public class test1 extends test {

public Synchronized abstract void readData() {
read state1;
read state2;
}
}

-> Child class2

public class test2 extends test {

public Synchronized abstract void readData() {
read state3;
read state4;
}

}
If this way possible, then i would like to know is that readData method will be Synchronized. If one Daemon is calling child1 readData Method and another daemon is calling child2 readData simultaneously, then what will happen.

thanking you

Regards,
Sashi
17 years ago
hallo,

I am using JDK1.4 and i would like to use BlockingQueue.

I tried in eclipse with JDK1.5, but still i am not able to see the source code.

If anybody knows where can i see the source, please let me know.


Thanking you

Regards,
Sashi
Thank you for your message. I am using lesser version of JDK. I am not able to look into java code even in JDK1.5.

Eclipse is showing below message:
Source not found
The jar file rt.jar has no source attachment.
You can attach the source by clicking Attach Source below

I tried to locate rt.jar, but still that does not help me. So could you please tell me how I can see the source code.

thanks,

Regards,
Sashi
17 years ago
Hallo,

I am new to Java and I am programming with multiple daemons are running parallel. I have one problem. i used each daemon with synchronization.master daemon is always waiting for data from slave daemons.

master daemon {
synchronized (datareceived) {
while(processrunning) {
datareceived.wait();
do some process with data
}
}

slave daemon1 {
synchronized (datareceived) {
while(processrunning) {
ReadData;
datareceived.notify();
}
}

slave daemon2 {
synchronized (datareceived) {
while(processrunning) {
ReadData;
datareceived.notify();
}
}


The problem is if master daemon is not at the position of wait and if one of slave did send notify(), then i am loosing the notification.

What I want is, i should not loose any notification. I should respond on each notification. So please let me know if somebody can help regarding

Thank you,

Regards,
Dimpu
Hallo,
I am new to Java and I am programming with multiple daemons are running parallel. I have one problem. i used each daemon with synchronization.master daemon is always waiting for data from slave daemons.

master daemon {
synchronized (datareceived) {
while(processrunning) {
datareceived.wait();
do some process with data
}
}

slave daemon1 {
synchronized (datareceived) {
while(processrunning) {
ReadData;
datareceived.notify();
}
}

slave daemon2 {
synchronized (datareceived) {
while(processrunning) {
ReadData;
datareceived.notify();
}
}


The problem is if master daemon is not at the position of wait and if one of slave did send notify(), then i am loosing the notification.

What I want is, i should not loose any notification. I should respond on each notification. So please let me know if somebody can help regarding

Thank you,

Regards,
Dimpu
17 years ago
hallo,

thanks for the more info. It really did help me lot. Once again thank you all.
17 years ago
Hallo,

I am new to Java, I need some information regarding String Queues in Java.

I wanted a queue, which should wait on new element. I do not want poll the loop for new data. I should need non poll type queue, which stay for new event. When ever new element arriaves it should come out from that statement and it should give me the element.

Please let me know, if somebody know about queues in Java.

thanks
Regards,
Sashi
17 years ago
Hi,

I am new to Java. If I want to write lot of doubles number into a file, which one is the best. Writing in the format of Binary or in the format of ASCII.

Please give me suggestion.
18 years ago