Maps and Separate Classes
Hi again :D hehe
Any idea how I can transfer the file reading into an empty java class say ReadFile.java. And access the Map set from the first main gui java class (im using netbeans, if this helps :D)
Thank you!
steve
p.s. the txt file it reads if the following flights.txt - e.g. aberdeen,london,50 (start,destination,cost) aberdeen,manchester,21 - london,brighton,12
Map<String,Map<String,Integer>> flights = new HashMap<String,Map<String,Integer>>();
private void buttonOpenFileActionPerformed(java.awt.event.ActionEvent evt) {
// load the first line from a file into the firstlineBox textbox
JFileChooser fileChooser = new JFileChooser(); // create a file chooser
int returnVal = fileChooser.showOpenDialog(this); // show an open file dialogue
if (returnVal == JFileChooser.APPROVE_OPTION) { // was it successful (not cancelled)
File file = fileChooser.getSelectedFile(); // if so, get selected file
try { // catch I/O errors
FileReader fr = new FileReader(file); // set up file reader
LineNumberReader input = new LineNumberReader(fr); // line number reader supports readLine
// all set up, now we can read!
while (true) {
String line = input.readLine(); // read first line
if (line==null)
break;
String[] s = line.split(",");
Map<String,Integer> cityMap = flights.get(s[0]);
if (cityMap==null)
cityMap=new HashMap<String,Integer>();
flights.put(s[0],cityMap);
cityMap.put(s[1],Integer.parseInt(s[2]));
} catch (IOException ex) { // catch I/O errors
JOptionPane.showMessageDialog(this,"I/O error: " + ex.toString()); // show error message
}
... i worked it out myself with the help of your code... works a treat
cheers
here is the answer:
private void buttonOpenFileActionPerformed(java.awt.event.ActionEvent evt) {
// load the first line from a file into the firstlineBox textbox
JFileChooser fileChooser = new JFileChooser(); // create a file chooser
int returnVal = fileChooser.showOpenDialog(this); // show an open file dialogue
if (returnVal == JFileChooser.APPROVE_OPTION) { // was it successful (not cancelled)
File file = fileChooser.getSelectedFile(); // if so, get selected file
try { // catch I/O errors
FileReader fr = new FileReader(file); // set up file reader
MyFileReader readFile = new MyFileReader();
readFile.readFile(fr);
} catch (IOException ex) { // catch I/O errors
IOErrorMsg(ex); // show error message
}
Similar Messages
-
Clarification of JAR file and separate classes
Hi all,
I wanted to clarify a basic question. When do we club all classes to make a JAR file? For instance, in a web app with servlets, had all the servlet classes been put into a single JAR file, would that work? I know that woudn't but why?
Is JAR file like a single executable (.exe) file? So, when (which type of applications) do we need single JAR and when separate classes?
thanks muchThanks, I've gone thru it. So, sounds like JAR file can be used for invoking app thru command line or from some other app or even running applet in a browser. It can not be used for a servlet or jsp application. Am I right?
-
Class-Map and Policy-Map Configuration in CM Confusion
Hi,
I'm implementing a green field WAAS deployment for a customer. We currently have a Proof-of-Concept up and running.
I've got some questions regarding custom class-map and policy-map configuration in the CM. I'd like to nail-down the custom class-map and policy-map configuration (and understanding) in the PoC before cutting over the PoC branches to the production WAAS environment.
Assuming a typical WAAS Deployment using WCCP for off-path interception, branch to DC.
==> 61 in LAN (BRANCH ROUTER) <== 62 in WAN (WAN CLOUD) ==> 61 in WAN (DC ROUTER) <== 62 in LAN
We are using two distinct device groups, BRANCH and DATA CENTER.
If the customer has traffic that we need to classify in order to provide TFO only optimisation, should the single class-map include the traffic in both directions? Ie., (assume the SERVER is 10.1.1.1 TCP Port 443). Should the class-map be configured as:
Class-Map
Line 1: DST IP 10.1.1.1 DST Port 443
Line 2: SRC IP 10.1.1.1 SRC Port 443
Or in this case is only the DST line required? And in which Device Group should the custom policy be applied? Or should it be applied to both Device Groups? If it should be applied to both Device Groups, then would it make more sense to have the policy-map in the Branch DG configured to match the DST traffic, and on the Data Center DG have a different class-map match the SRC traffic?
My confusion is how to classify the traffic (SRC or DST or Both - Separate classes for each or different lines within the same class-map), and where to apply the appropriate policy (both Device Groups, just Branch, just DC) and why...
I tried to apply a custom policy and the impact in the PoC was that the TCP Summary report stopped reporting the individual traffic classes showed 'other traffic' only. Can anyone explain why this may have occurred?
I hope this makes sense.for instance like this:
policy-map police-in
class class-default
police rate 10 mpbs <optionally set burst>
policy-map shape-out-parent
class class-default
shape 10 mpbs <optional burst config>
service-policy shape-out-child
policy-map shape-out-child
class class-default
queue-limit 10 packets
int g 0/0/0/0
service-policy police-in in
service-policy shape-out-parent out
also have a look at CL 2013/2014 (orlando/sanfran) ID 2904 for more QOS details
and the support forum article of "asr9000 quality of service architecture"
xander -
ZBF Class-map and different way of doing them
Hi People just though i would ask a question on how to set up a ZBF. (question at the end of example config's)
i have been playing with this for a while now and like to get advice over what way is the recomended way of doing multiple matchs
ok we we all know the basic
class-map type inspect match-any ZBF_CM_ICMP
match protocol icmp
policy-map type inspect ZBF_PM_EXTERNAL->DMZ
class type inspect ZBF_CM_ICMP
inspect
and then the ZP dont need to show, this is a simple map using nbar fair enough
then we could a mulitiple matches
class-map type inspect match-any ZBF_CM_STD_DMZ_PORTS
match protocol icmp
match protocol http
match protocol dns
match protocol https
policy-map type inspect ZBF_PM_DMZ->EXTERNAL
class type inspect ZBF_CM_STD_DMZ_PORTS
inspect
Ok still easy to understand but now come the bit that a little more copmplex non NBAR matches
ip access-list extended AL_RDP_PORT
permit tcp any any eq 3389
class-map type inspect match-all ZBF_CM_RDP
match access-group name AL_RDP_PORT
policy-map type inspect ZBF_PM_EXTERNAL->DMZ
class type inspect ZBF_CM_RDP
inspect
This config is now using an access list because NBAR dosent have the protocol in it then map the AL to the CM then CM to PM. next is example is what i setup to get more non NBAR ports and only for 1 host
ip access-list extended AL_HOST_IP_IN
permit ip any host 11.11.11.11
ip access-list extended AL_ISATAP
permit 41 any any
ip access-list extended AL_TEREDO
permit udp any any eq 3544
class-map type inspect match-ANY ZBF_CM_DirectAccess_Protocols
description Nested Class Map
match access-group name AL_ISATAP
match access-group name AL_TEREDO
match protocol https
class-map type inspect match-ALL ZBF_CM_APP_IN
match access-group name AL_HOST_IP_IN
match access-group name ZBF_CM_DirectAccess_Protocols
policy-map type inspect ZBF_PM_EXTERNAL->DMZ
class type inspect ZBF_CM_APP_IN
inspect (or pass with rule for other direction)
THis is what i setup and it works not for this example but the rule flow i then was having issues with DMVPN and ZBF (turned out to be an iso bug annoying me) but i used CiscoCP to setup the ZBF automaticly forthe DMVPN and it ZBF rule where same proceduare as below.
ip access-list extended AL_HOST_IP_IN
permit ip any host 11.11.11.11
ip access-list extended AL_ISATAP
permit 41 any any
ip access-list extended AL_TEREDO
permit udp any any eq 3544
class-map type inspect match-ANY CM_ISATAP
match access-group name AL_ISATAP
class-map type inspect match-ANY CM_TEREDO
match access-group name AL_TEREDO
class-map type inspect match-ANY ZBF_CM_DirectAccess_Protocols
description Nested Class Map
match class-map CM_ISATAP
match class-map CM_TEREDO
match protocol https
class-map type inspect match-ALL ZBF_CM_APP_IN
match access-group name AL_HOST_IP_IN
match access-group name ZBF_CM_DirectAccess_Protocols
policy-map type inspect ZBF_PM_EXTERNAL->DMZ
class type inspect ZBF_CM_APP_IN
inspect
So what Cisco CP did was make yet another level of nesting rather then the match-all class map having the match access list command then made a cm with access list then the main class map had only other match class maps in it..
QUESTION:
Why did CiscoCP do the extra nesting
both ways worked but i would like to know why the cisco CP did the same thing with the other layer of CM did it do this for best practise or dose this make changed later easier i cant understand whats the advange to doing it this way... but if there is a valid reason then ill great jjust trying to understand.
thanks
regards
A very sore headed
DaveWhen people say "use as few classes as possible", it's usually related not to optimize heap usage, but jar size.
But it's true that some smart use of OOP can save a lot of memory during runtime (and even jar size in some cases). Using an interface in my GUI library helps make the architecture a lot simpler and more compact, to the point that even if all the GUI widgets are being used (so the "just loading the code you need at the moment" argument is moot) memory use is still smaller because I need a lot less hacks to glue everything together.
It still is worth noting that often memory fragmentation is the true cause of running-out-of-memory-errors, and in this case loading many small classes will achieve exactly the opposite.
shmoove -
Datastore id and flat class mapping
Hi,
I have
- an abstract persistent class A with 2 concrete persistent subclasses A1
and A2. I'm using datastore identity and flat class mapping.
- a class B that has a field fb with a one-many mapping to A1 objects
(Hashset).
- a class C that has a field fc with a one-many mapping to A objects
(Hashset).
- an instance a1 of A1 (id = 5)
- an instance b of B in which fb contains a1
- an instance c of C in which fc contains a1
When loading b and then c, i happen to have 2 instances representing a1 in
the same persistent manager. the one loaded in b has A1-5 as ObjectId and
the one loaded in c has A-5 as ObjectId. Thus those two objects have a
different object id while they represents the same data.
I would expect to find only one.
Do you have any idea ?
Thanks,
Laurent CzinczenheimI found the problem! There is no more jdo-1.0.1.jar in the kodo rar :-)
Czinczenheim wrote:
I have only kodo in the rar. If i put the kodo rar 3.1.3, i can deploy it.
if i put the kodo rar 3.2.0, i cannot and get the previous exception. Is
there any difference in the packages used by kodo 3.2.0 (other than kodo
packages) that could interfer with the one i could have in my jboss lib
directories ?
thanks
laurent
Stephen Kim wrote:
Kodo should either not be in the classpath and only in the rar or
viceversa. It still seems like a classpath issue. Can you inspect your
kodo-jdo-runtime.jars for the existence of kodo/util/FatalUserException?
Czinczenheim wrote:
I have only one version of Kodo in my classpath. Therefore, when i
replace
the rar by the one from version 3.1.3 (or any older version), i don'thave
any problem to deploy the kodo resource adapter.
Stephen Kim wrote:
It appears that you may be having classpath problems. Do you have
multiple versions of Kodo in the classpath or ear/rar?
Czinczenheim wrote:
Marc,
i wanted to try it with the new 3.2 beta version but i can't even deploy
kodo 3.2.b1 in JBoss 3.2.3. Here is the stacktrace i get when deploying
the rar (My kodo-ds.xml is the same as the one i used with kodo 3.1.3):
11:47:52,975 INFO [RARDeployment] Starting
11:47:53,036 WARN [ServiceController] Problem starting service
jboss.jca:service=ManagedConnectionFactory,name=jdo/pmf/prisma01
java.lang.NoClassDefFoundError: kodo/util/FatalUserException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
at java.lang.Class.getConstructor0(Class.java:1922)
at java.lang.Class.newInstance0(Class.java:278)
at java.lang.Class.newInstance(Class.java:261)
at
org.jboss.resource.connectionmanager.RARDeployment.startService(RARDeployment.java:533)
>>>
at
org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
>>>
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
>>>
at $Proxy12.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:394)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
>>>
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
>>>
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:177)
at $Proxy18.start(Unknown Source)
at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:231)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
>>>
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy6.deploy(Unknown Source)
at
org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
>>>
at
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
>>>
at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
>>>
at
org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
>>>
at
org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
>>>
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
>>>
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:394)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
>>>
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:632)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
>>>
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
at org.jboss.Main.boot(Main.java:150)
at org.jboss.Main$1.run(Main.java:388)
at java.lang.Thread.run(Thread.java:534)
Thanks for your help since the initial bug i described is critical forus.
Laurent
Marc Prud'hommeaux wrote:
Laurent-
I believe I have seen that problem, but I can't recall the exact
symptoms (or the exact bug number). However, I do think that it was
fixed for Kodo 3.2. Can you download the 3.2 beta and see if the
problem
still occurs?
If it does still happen, can you provide us with your .jdo, .mapping,
and .java files for the classes so we can take a look?
In article <[email protected]>, Czinczenheim wrote:
Hi,
I have
- an abstract persistent class A with 2 concrete persistent subclasses
A1
and A2. I'm using datastore identity and flat class mapping.
- a class B that has a field fb with a one-many mapping to A1 objects
(Hashset).
- a class C that has a field fc with a one-many mapping to A objects
(Hashset).
- an instance a1 of A1 (id = 5)
- an instance b of B in which fb contains a1
- an instance c of C in which fc contains a1
When loading b and then c, i happen to have 2 instances representing
a1
in
the same persistent manager. the one loaded in b has A1-5 as ObjectIdand
the one loaded in c has A-5 as ObjectId. Thus those two objects have a
different object id while they represents the same data.
I would expect to find only one.
Do you have any idea ?
Thanks,
Laurent Czinczenheim
Marc Prud'hommeaux
SolarMetric Inc.
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com -
Moving buttons and their listeners to separate classes
Hi
I am trying to move out buttons and their listeners to separate classes, but when I do so, the program stops working. When I click on the button they dont react, probably the listeners doesent listens as the action performe prints out testprints.
In other words, I have huge troubles with do my gui object oriented. I doesent seem to be able to move out relevant listener methods and their components to separate classes.
Here is the code for one add button that I have tried to write in a separate class:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import se.cs.DB.DBMovie;
import se.cs.inputvalidation.PatternsMovie;
import se.cs.main.Main;
import se.cs.main.MessageArea;
public class ButtonAddMovie {
private DBMovie init = new DBMovie();
private ComboBoxesMovie comboBoxesMovie = new ComboBoxesMovie();
private TextFieldsMovie textFieldsMovie = new TextFieldsMovie();
private PatternsMovie patternsMovie = new PatternsMovie();
private MessageArea messageArea = new MessageArea();
private Pattern patternYear;
private Pattern patternSection;
private Pattern patternExFields;
private Matcher matcherYear;
private Matcher matcherSection;
private Matcher matcherTotalEx;
private Matcher matcherExIn;
private Matcher matcherExOut;
private String genreString;
// Initializes the button components
private JButton addButton = new JButton("Add");
public ButtonAddMovie() {
listener();
public void listener() {
addButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addButton(e);
public void addButton(ActionEvent e) {
genreString = comboBoxesMovie.convertGenreIndex();
regex();
public void regex() {
patternYear = Pattern.compile(patternsMovie.getYEAR_FIELD());
patternSection = Pattern.compile(patternsMovie.getSECTION_FIELD());
patternExFields = Pattern.compile(patternsMovie.getExFields());
matcherYear = patternYear.matcher(textFieldsMovie.getTextYear());
matcherSection = patternSection.matcher(textFieldsMovie.getTextYear());
matcherTotalEx = patternExFields.matcher(textFieldsMovie
.getTextTotalEx());
matcherExIn = patternExFields.matcher(textFieldsMovie.getTextExIn());
matcherExOut = patternExFields.matcher(textFieldsMovie.getTextExOut());
if (matcherYear.matches() && matcherSection.matches()
&& matcherTotalEx.matches() && matcherExIn.matches()
&& matcherExOut.matches()) {
messageArea.getMessageArea().setText("");
callInsertStatement();
JOptionPane.showMessageDialog(null, this.messageDialog(),
"Movie added", JOptionPane.INFORMATION_MESSAGE);
else if (!matcherYear.matches()) {
messageArea.getMessageArea().setText(
"The input for year field does not match.\n"
+ "You have to enter 4 digits.");
else if (!matcherSection.matches()) {
messageArea.getMessageArea().setText(
"The input for section field does not match.\n"
+ "You have to enter 1-4 digits.");
else if (!matcherTotalEx.matches()) {
messageArea.getMessageArea().setText(
"The input for total ex field does not match.\n"
+ "You have to enter 1.");
else if (!matcherExIn.matches()) {
messageArea.getMessageArea().setText(
"The input for ex in does not match.\n"
+ "You have to enter 1 digit.");
else if (!matcherExOut.matches()) {
messageArea.getMessageArea().setText(
"The input for ex out does not match.\n"
+ "You have to enter 1 digits.");
public void callInsertStatement() {
try {
init.insertStatement(textFieldsMovie.getTextTitle(),
textFieldsMovie.getTextYear(), genreString, comboBoxesMovie
.convertGradeIndex(), textFieldsMovie
.getTextSection(),
textFieldsMovie.getTextTotalEx(), textFieldsMovie
.getTextExIn(), textFieldsMovie.getTextExOut());
} catch (SQLException ex) {
ex.printStackTrace();
public String messageDialog() {
int grade = comboBoxesMovie.getGradeBox().getSelectedIndex() + 1;
String title = textFieldsMovie.getTitleField().getText();
String year = textFieldsMovie.getYearField().getText();
String section = textFieldsMovie.getSectionField().getText();
String totalEx = textFieldsMovie.getTotalExField().getText();
String exIn = textFieldsMovie.getExInField().getText();
String exOut = textFieldsMovie.getExOutField().getText();
return "\n" + "Title: " + title + "\n" + "Year: " + year + "\n"
+ "Genre: " + comboBoxesMovie.convertGenreIndex() + "\n"
+ "Grade: " + grade + "\n" + "Section: " + section + "\n"
+ "Total ex.: " + totalEx + "\n" + "Ex. in: " + exIn + "\n"
+ "Ex. out: " + exOut + "\n";
* Gets the addButton
* @return addButton
public JButton getAddButton() {
return addButton;
}I said "don't" cross-post and that the discussion has already been started in the "New To Java" forum.
If you have two discussions going on then people waste time answering because they don't know what has already been suggested. -
Nested classes and separate files in Javadoc...
Hello. I am writing an application, and it has several .java files, and some of the classes contained therein contain nested classes, for example
ClassOne.java
class ClassOne
// stuff
class innerClassOne
//more stuff
}ClassTwo.java
class ClassTwo
// stuff
class innerClassTwo
//more stuff
}What I want to do is generate documentation like the online java documentation for my app, that is, documentation that will contain ALL the classes and nested classes involved, and link everything that comes in java already to the sun online java docs.
I've figured out the -link command for javadoc, and I can make that work, but I've run into some other snags.
1.) Javadoc isn't finding or documenting my nested classes, despite them being marked up. Google does not wish to help.
2.) Some classes reference other classes of mine that aren't conatined in the same .java file, but do exist in their own .java files in the dame local directory. Javadoc does not like this, and gives errors.
3.) Running javadoc on one file at a time overwrites the old file's documentation, thus I cannot seem to get an index.html javadoc file that links to all my classes, nor can I get the classes to link to each other.
What do I need to do to fix these?So this means a nested static inner class CANNOT refer to its own instanced variables, like a normal static method, but CAN refer to its outer class instanced variables?No, it means that a static nested class cannot refer to instance variables of its enclosing class. Example:public class Foo {
int i;
static class Bar {
int j = i; // WRONG! Bar class is static context
}~ -
XSLT mapping calls Java class, with hardcoded values-problem at Transport
Hi All,
I know the subject may be misguiding, but i need some suggestions how to handle the following scenario.
From my XSLT mapping, i am calling a java function which performs a data connection to an oracle database and then returns some values, whcih i have mapped in the mapping.
The problem is, i have hardcoded the Connection parameters....
and now that we transport these objects to production, the connection parameters will change.
I thought of two solutions
1) i create a new java class for Production system
2) i define the parameters as input arguemnts to my method, whcih is called from XSLT mapping
But in both cases, if theres any chg in future, there will a dependancy on one of the objects to be changed and sent again.
What is the suggested way? is there nothing like a property file(like in EP), where you define dependant parameters...and the file is only changed.
XI Gurus, please suggest me the correct way to handle.....
Thanks a lot.
MonaMona,
This is what i do..
1) Parametrize ur current calling class,
2) define a separate class called dbConnect.java there, you have all your parameters that way when there is a change your main program is untouched, and you just need to change the dbconnect.
The call from your current class will be just like
dbConnect.Runsql("sql as a string");
the runSql can then internally call
dbConnect().connect(); //that should do the connection opening.
then create a prepared statement from your string input and call the db.......
this is the implementation that would be best suited for your scenario, you can further parametrize the method to where you can add the database params from the calling xml..so all that needs to be done when the machine is changed or any param is changed is ..modify the xml........not too bad was that.....
Regards
Ravi -
XSLT Mapping with Java class not working in Integration Repository
Hi,
I have an XSLT mapping program with Java enhancement and I was able to successfully tested it in Stylus Studio. However, when I imported the Java class and the xslt program in Enterprise Service Builder and tested it, my program does not compile.
Here is the error message: "Transformer Configuration Exception occurred when loading XSLT mapping_temp.xsl; details: Could not compile stylesheet".
My java program is in a zip file containing SOAPHeaderHandler.java and SOAPHeaderhandler.class. My Java has a package com.nga.xslt.
Here is the declaration of my Java class in the XSLT: xmlns:javamap="java:com.nga.xslt.SOAPHeaderHandler"
It seems that it could not read the java class. Can you please advice what is wrong?Hi ,
select XMLTOOLKIT option in Operation mapping and execute it.
I am not sure we can call java program in XSLT Program,but alternative is copy the code and use it in XSLT mapping it self,that means your XSLT program will become with JAVA extensions.
then in Operation mapping level select SAPXMLTOOL kit option and execute it. i hope it will work. if it is not working then you have deploy some JAXP files on server,because the way execution of XSLT Mpaping program got changed,like when eve you executing XSLT with extnasions( if you are not using XMLTOOL kit option) then you have to use latest version of JAXP.JDK files.
Regards,
Raj -
Hey, everybody. I'm learning Java through a text and it instructed me to write a class that contains several methods for generating random numbers and characters. It then instructed me to write a class containing a main method that calls one of the methods in this separate class. I know that you can't write two classes in one file, so I would appreciate it if someone could help by telling me how I'm supposed to make this work. Here are the two separate classes:
1 public class RandomCharacter {
2 /** Generate a random character between ch1 and ch2 */
3 public static char getRandomCharacter(char ch1, char ch2) {
4 return (char)(ch1 + Math.random() * (ch2 - ch1 + 1));
5 }
6
7 /** Generate a random lowercase letter */
8 public static char getRandomLowerCaseLetter() {
9 return getRandomCharacter('a', 'z');
10 }
11
12 /** Generate a random uppercase letter */
13 public static char getRandomUpperCaseLetter() {
14 return getRandomCharacter('A', 'Z');
15 }
16
17 /** Generate a random digit character */
18 public static char getRandomDigitCharacter() {
19 return getRandomCharacter('0', '9');
20 }
21
22 /** Generate a random character */
23 public static char getRandomCharacter() {
24 return getRandomCharacter('\u0000', '\uFFFF');
25 }
26 }
1 public class TestRandomCharacter {
2 /** Main method */
3 public static void main(String args[]) {
4 final int NUMBER_OF_CHARS = 175;
5 final int CHARS_PER_LINE = 25;
6
7 // Print random characters between '!' and '~', 25 chars per line
8 for (int i = 0; i < NUMBER_OF_CHARS; i++) {
9 char ch = RandomCharacter.getRandomLowerCaseLetter() ;
10 if ((i + 1) % CHARS_PER_LINE == 0)
11 System.out.println(ch);
12 else
13 System.out.print(ch);
14 }
15 }
16 }So I put both of the files in a package called getrandom, then compiled the public class with the functions and tried to compile the class with the main function. This is what I got from the compiler:
colton-ogdens-macbook:getrandom coltonogden$ javac TestRandomCharacter.java
TestRandomCharacter.java:10: cannot find symbol
symbol : variable RandomCharacter
location: class getrandom.TestRandomCharacter
char ch = RandomCharacter.getRandomLowerCaseLetter();
^
1 error
Here are the two source code files again:
package getrandom;
public class RandomCharacter {
public static char getRandomCharacter(char ch1, char ch2) {
return (char)(ch1 + Math.random() * (ch2 - ch1 + 1));
public static char getRandomLowerCaseLetter() {
return getRandomCharacter('a', 'z');
public static char getRandomUpperCaseLetter() {
return getRandomCharacter('A', 'Z');
public static char getRandomDigitCharacter() {
return getRandomCharacter();
public static char getRandomCharacter() {
return getRandomCharacter('\u0000', '\uFFFF');
package getrandom;
public class TestRandomCharacter {
public static void main(String[] args) {
final int NUMBER_OF_CHARS = 175;
final int CHARS_PER_LINE = 25;
for (int i = 0; i < NUMBER_OF_CHARS; i++) {
char ch = RandomCharacter.getRandomLowerCaseLetter();
if ((i + 1) % CHARS_PER_LINE == 0)
System.out.println(ch);
else
System.out.print(ch);
}It's exactly how they are given in the text, and with no explanation on packages or anything of the sort, which is strange. I put them both in the same directory, called also getrandom. What I suspect is that TestRandomCharacter isn't getting the class RandomCharacter, or I haven't created an instance of that class in TestRandomCharacter, but then why would the text write them out like this, expecting me to be able to compile them? I find it obscure. -
BC-XI V3.0 Message Mapping with Java Class
Hi all
In the Integretion Builder Design i try to import a Java Class in order to convert a source to a target field. I have created an tested the class with the eclipse V3.0.
If i import the source in a customized mapping function i always get the error:
"OFFMANNONLINESHOP_ORDER2SAP_ORDERS05_MSGMAP01 hat keinen Quellkode." (...message..has no source code)
I have also imported the import classes in the "Imported Archives".
This message always appear if the import line for the classes is filled.
Do somebody knows this problem
Message was edited by: Christoph Borst
Message was edited by: Christoph Borst
Message was edited by: Christoph BorstHi ,
select XMLTOOLKIT option in Operation mapping and execute it.
I am not sure we can call java program in XSLT Program,but alternative is copy the code and use it in XSLT mapping it self,that means your XSLT program will become with JAVA extensions.
then in Operation mapping level select SAPXMLTOOL kit option and execute it. i hope it will work. if it is not working then you have deploy some JAXP files on server,because the way execution of XSLT Mpaping program got changed,like when eve you executing XSLT with extnasions( if you are not using XMLTOOL kit option) then you have to use latest version of JAXP.JDK files.
Regards,
Raj -
How to restructure this code into separate classes?
I have C# code that initializes a force feedback joystick and plays an effect file(vibrates the joystick). I have turn the console application into library
code to make a dll so that I can use it in LabVIEW.
Right now all the code is written under one class, so went I put the dll in LabVIEW I can only select that one class. labVIEW guy told me that I need to
restructure my C# code into separate classes. Each class that I want to access from LabVIEW needs to marked as public. Then I can instantiate that class in LabVIEW using a constructor, and call methods and set properties of that class using invoke nodes and
property nodes.
How can I do this correctly? I tried changing some of them into classes but doesn't work. Can you guys take a look at the code to see if it is even possible
to break the code into separate classes? Also, if it is possible can you guide me, suggest some reading/video, etc.
Thank you
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using Microsoft.DirectX.DirectInput;
namespace JoystickProject
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
private System.Windows.Forms.Label label1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private Device device = null;
private bool running = true;
private ArrayList effectList = new ArrayList();
private string joyState = "";
public bool InitializeInput()
// Create our joystick device
foreach(DeviceInstance di in Manager.GetDevices(DeviceClass.GameControl,
EnumDevicesFlags.AttachedOnly | EnumDevicesFlags.ForceFeeback))
// Pick the first attached joystick we see
device = new Device(di.InstanceGuid);
break;
if (device == null) // We couldn't find a joystick
return false;
device.SetDataFormat(DeviceDataFormat.Joystick);
device.SetCooperativeLevel(this, CooperativeLevelFlags.Exclusive | CooperativeLevelFlags.Background);
device.Properties.AxisModeAbsolute = true;
device.Properties.AutoCenter = false;
device.Acquire();
// Enumerate any axes
foreach(DeviceObjectInstance doi in device.Objects)
if ((doi.ObjectId & (int)DeviceObjectTypeFlags.Axis) != 0)
// We found an axis, set the range to a max of 10,000
device.Properties.SetRange(ParameterHow.ById,
doi.ObjectId, new InputRange(-5000, 5000));
// Load our feedback file
EffectList effects = null;
effects = device.GetEffects(@"C:\MyEffectFile.ffe",
FileEffectsFlags.ModifyIfNeeded);
foreach(FileEffect fe in effects)
EffectObject myEffect = new EffectObject(fe.EffectGuid, fe.EffectStruct,
device);
myEffect.Download();
effectList.Add(myEffect);
while(running)
UpdateInputState();
Application.DoEvents();
return true;
public void PlayEffects()
// See if our effects are playing.
foreach(EffectObject myEffect in effectList)
//if (button0pressed == true)
//MessageBox.Show("Button Pressed.");
// myEffect.Start(1, EffectStartFlags.NoDownload);
if (!myEffect.EffectStatus.Playing)
// If not, play them
myEffect.Start(1, EffectStartFlags.NoDownload);
//button0pressed = true;
protected override void OnClosed(EventArgs e)
running = false;
private void UpdateInputState()
PlayEffects();
// Check the joystick state
JoystickState state = device.CurrentJoystickState;
device.Poll();
joyState = "Using JoystickState: \r\n";
joyState += device.Properties.ProductName;
joyState += "\n";
joyState += device.ForceFeedbackState;
joyState += "\n";
joyState += state.ToString();
byte[] buttons = state.GetButtons();
for(int i = 0; i < buttons.Length; i++)
joyState += string.Format("Button {0} {1}\r\n", i, buttons[i] != 0 ? "Pressed" : "Not Pressed");
label1.Text = joyState;
//if(buttons[0] != 0)
//button0pressed = true;
public Form1()
// Required for Windows Form Designer support
InitializeComponent();
// TODO: Add any constructor code after InitializeComponent call
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
if( disposing )
if (components != null)
components.Dispose();
base.Dispose( disposing );
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
public void InitializeComponent()
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
// label1
this.label1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.label1.Location = new System.Drawing.Point(8, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(272, 488);
this.label1.TabIndex = 0;
// Form1
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.SystemColors.ControlText;
this.ClientSize = new System.Drawing.Size(288, 502);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.label1});
this.Name = "Form1";
this.Text = "Joystick Stuff";
this.ResumeLayout(false);
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
using (Form1 frm = new Form1())
frm.Show();
if (!frm.InitializeInput())
MessageBox.Show("Couldn't find a joystick.");Imho he means the following.
Your class has performs two tasks:
Controlling the joystick.
Managing the joystick with a form.
So I would recommend, that you separate the WinForm from the joystick code. E.g.
namespace JoystickCtlLib
public class JoystickControl
private Device device = null;
private bool running = true;
private ArrayList effectList = new ArrayList();
private string joyState = "";
public string State { get { return this.joyState; } }
public bool InitializeInput() { return true; }
public void PlayEffects() { }
private void UpdateInputState() { }
So that your joystick class does not reference or uses any winform or button.
btw, there is a thing which is more important than that: Your polling the device in the main thread of your application. This will block your main application. Imho this should be a job for a thread like background worker. -
Listen for an events for Swing objects in a separate class?
Hi all, sorry if this is in the wrong section of the forum but since this is a problem I am having with a Swing based project I thought i'd come here for help. Essentially i have nested panels in separate classes for the sake of clarity and to follow the ideas of OO based development. I have JPanels that have buttons and other components that will trigger events. I wish for these events to effect other panels, in the Hierachy of my program:
MainFrame(MainPanel(LeftPanel, RightPanel, CanvasPanel))
Sorry I couldnt indent to show the hierarchy. Here LeftPanel, RightPanel and CanvasPanel are objects that are created in the MainPanel. For example i want an event to trigger a method in another class e.g. LeftPanel has a button that will call a method in CanvasPanel. I have tried creating an EventListner in the MainPanel that would determine the source and then send off a method to the relevant class, but the only listeners that respond are the ones relevant to the components of class. Can I have events that will be listened to over the complete scope of the program? or is there another way to have a component that can call a method in the class that as an object, it has been created in.
Just as an example LeftPanel has a component to select the paint tool (its a simple drawing program) that will change a color attribute in the CanvasPanel object. Of course I realize i could have one massive Class with everything declared in it, but I'd rather learn if it is possible to do it this way!
Thanks in advance for any help you can offer
Lawrence
Edited by: insertjokehere on Apr 15, 2008 12:24 PMThanks for the response, ive added ActionListneres in the class where the component is, and in an external class. The Listeners work inside the class, but not in the external class
import java.awt.event.ActionEvent;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
public class LeftPanel extends JPanel implements ActionListener {
/* Constructing JButtons, null until usage of the constructor */
JButton pencilBut;
JButton eraserBut;
JButton textBut;
JButton copyBut;
JButton ssincBut;
JButton ssdecBut;
ActionListener a = new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.print("\nNot supported yet.");
/* The Top Panel contains the title of program */
public LeftPanel(Dimension d){
/* Sets up the layout for the Panel */
BoxLayout blo = new BoxLayout(this,BoxLayout.Y_AXIS);
this.setLayout(blo);
/* Sets Up the Appearance of the Panel */
this.setMinimumSize(d);
this.setBackground(Color.RED);
this.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
/* Pencil Tool */
pencilBut = new JButton("Pencil");
pencilBut.setAlignmentX(Component.CENTER_ALIGNMENT);
pencilBut.setActionCommand("pencil");
pencilBut.addActionListener(a);
this.add(pencilBut);
/* Eraser Tool */
eraserBut = new JButton("Eraser");
eraserBut.setAlignmentX(Component.CENTER_ALIGNMENT);
eraserBut.addActionListener(a);
this.add(eraserBut);
/* Text Tool */
textBut = new JButton("Text");
textBut.setAlignmentX(Component.CENTER_ALIGNMENT);
textBut.addActionListener(a);
this.add(textBut);
/* Copy Previous Page */
copyBut = new JButton("Copy Page");
copyBut.setAlignmentX(Component.CENTER_ALIGNMENT);
copyBut.addActionListener(a);
this.add(copyBut);
/* Stroke Size Increase */
ssincBut = new JButton("Inc");
ssincBut.setAlignmentX(Component.CENTER_ALIGNMENT);
ssincBut.addActionListener(a);
this.add(ssincBut);
/* Stroke Size Decrease */
ssdecBut = new JButton("Dec");
ssdecBut.setAlignmentX(Component.CENTER_ALIGNMENT);
ssdecBut.addActionListener(a);
this.add(ssdecBut);
System.out.print("\nLeftPanel Completed");
public void actionPerformed(ActionEvent e) {
System.out.print("\nAction Performed");
}But this is not picked up in my external class here
import java.awt.event.ActionEvent;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
public class MainPanel extends JPanel implements ActionListener {
/* Creates a new the main JPanel that is used in the FlipBookFrame to contain all of the elements */
public MainPanel(){
/* TopPanel constraints*/
tpcs.gridx = 1;
tpcs.gridy = 0;
tpcs.gridwidth = 1;
tpcs.gridheight = 1;
tpcs.fill = GridBagConstraints.BOTH;
tpcs.weightx = 0.0;
tpcs.weighty = 1.0;
/* LeftPanel Constraints*/
lpcs.gridx = 0;
lpcs.gridy = 0;
lpcs.gridwidth = 1;
lpcs.gridheight = 3;
lpcs.fill = GridBagConstraints.BOTH;
lpcs.weightx = 1.0;
lpcs.weighty = 1.0;
/* CentrePanel Constraints*/
cpcs.gridx = 1;
cpcs.gridy = 1;
cpcs.gridwidth = 1;
cpcs.gridheight = 1;
cpcs.fill = GridBagConstraints.NONE;
cpcs.weightx = 0.0;
cpcs.weighty = 0.0;
/* RightPanel Constraints*/
rpcs.gridx = 2;
rpcs.gridy = 0;
rpcs.gridwidth = 1;
rpcs.gridheight = 3;
rpcs.fill = GridBagConstraints.BOTH;
rpcs.weightx = 1.0;
rpcs.weighty = 1.0;
/* BottomPanel Constraints*/
bpcs.gridx = 1;
bpcs.gridy = 2;
bpcs.gridwidth = 1;
bpcs.gridheight = 1;
bpcs.fill = GridBagConstraints.BOTH;
bpcs.weightx = 0.0;
bpcs.weighty = 1.0;
this.setLayout(gblo); //Sets the Layout of the panel to a GridBagLayout
this.add(tp, tpcs); //Adds the TopPanel to the MainPanel using the TopPanel layout
this.add(lp, lpcs); //Adds the LeftPanel to the MainPanel using the LeftPanel layout
this.add(cp, cpcs); //Adds the CanvasPanel to the MainPanel using the CanvasPanel layout
this.add(rp, rpcs); //Adds the RightPanel to the MainPanel using the RightPanel layout
this.add(bp, bpcs); //Adds the BottomPanel to the MainPanel using the BottomPanel layout
gblo.layoutContainer(this); //Lays Out the Container
public PanelSizes getPanelSizes(){
return ps;
public void actionPerformed(ActionEvent e) {
System.out.print("\nExternal Class finds event!");
/*String command = e.getActionCommand();
if (command.equals("pencil")){
System.out.print("\nYESSSSSSSSSSSSSSSSSSSSS!");
/* Create of objects using the PanelSizes funtions for defining the */
PanelSizes ps = new PanelSizes(); //Creates a new PanelSizes object for sizing the panel
CanvasPanel cp = new CanvasPanel(ps.getCentrePanelDimension()); //Creates a new Canvas Panel
TopPanel tp = new TopPanel(ps.getHorizontalPanelDimension()); //Creates the TopPanel
BottomPanel bp = new BottomPanel(ps.getHorizontalPanelDimension()); //Creates the BottomPanel
LeftPanel lp = new LeftPanel(ps.getVerticalPanelDimension()); //Creates the LeftPanel
RightPanel rp = new RightPanel(ps.getVerticalPanelDimension()); //Creates the RightPanel
/* I have chosen to create individual constraints for each panel to allow for adding of all
components a the end of the constructor. This will use slightly more memory but gives clarity
in the code */
GridBagConstraints cpcs = new GridBagConstraints();
GridBagConstraints tpcs = new GridBagConstraints();
GridBagConstraints bpcs = new GridBagConstraints();
GridBagConstraints lpcs = new GridBagConstraints();
GridBagConstraints rpcs = new GridBagConstraints();
GridBagLayout gblo = new GridBagLayout();
}Any help will be greatly appreciated :-) -
Interface Mapping Object - No class definition found
Hi
I have created a simple Interface Mapping in the Integration Repo. When i try to TEST the interface mapping i get class not found errors.See the stacktrace below.
LinkageError at JavaMapping.load(): Could not load class: com/sap/xi/tf/_PO_MAPPING_
- java.lang.NoClassDefFoundError: Illegal name: com/sap/xi/tf/_PO_MAPPING_
Looks like some standard sap packages are missing from the CLASSPATH. Anyidea where it has to be specified ?
PO_MAPPING is the message mapping object i have created and the test is successful for this object.However when i reference it in Interface Mapping , i get the above errors.
I suppose XI generates Java Code when i create these objects and the mappings.Any idea where the JVM seems to reference these packages and How to rectify it ?
Thanks
SaravanaHi,
Please check whether you have applied note 755302.
- Sreekanth -
Multi-Mapping and Message Split using BPM UDFs Error
hi
As per the below blog
Illustration of Multi-Mapping and Message Split using BPM in SAP Exchange Infrastructure
I have just modified the UDFs(1.selectnodeifA 2.selectNodeifB)
1.selectnodeifA
for(int i=0;i<=n;i++)
if(Name<i>.equals("A"))
result.addValue(Node<i>);
2.selectNodeifB
for(int i=0;i<=n;i++)
if(Name<i>.equals("B"))
result.addValue(Node<i>);
while checking I am getting the following errors
Source code has syntax error:
D:/usr/sap/D10/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapdc8fa4d0896011dd907d001cc01cef0d/source/com/sap/xi/tf/_bpm_mm_.java:132: cannot resolve symbol
symbol : variable n
location: class com.sap.xi.tf._bpm_mm_
for(int i=0;i<=n;i++)
^
D:/usr/sap/D10/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Mapdc8fa4d0896011dd907d001cc01cef0d/source/com/sap/xi/tf/_bpm_mm_.java:140: cannot resolve symbol symbol : variable n
location: class com.sap.xi.tf._bpm_mm_
for(int i=0;i<=n;i++)
^
2 errors
The source code given in the blog is correct ? I thought for loop has not completed
pls help
manianHi manian,
I was having a look to Illustration of Multi-Mapping and Message Split using BPM in SAP Exchange Infrastructure blog.
The functions are not the same. I mean, yours and blogs functions.
Each function has two parameters, Name and node. Furtheremore, in the blogs' functions is using arrays and you don't.
So, the right code will be
1.selectnodeifA
for(int i=0;i<=node.length();i++)
if(Name<i>.equals("A"))
result.addValue(Node<i>);
However, if you don't need an advance user defined function as you want to process just one element of the node's queue, you will not need to use for sentence.
Something like:
1.selectnodeifA
// for(int i=0;i<=n;i++)
if(Name.equals("A"))
result.addValue(Node);
Hope it is usefull for you.
Carlos
Maybe you are looking for
-
Report script - using substitution variable with multiple values
Hi All, Substitution variable with multiple values is not working correctly with Report scripts. Can you please let me know what is the syntax to assign multiple values to a sub variable using maxl: alter database samp.samp set variable 'ExtractQuart
-
Return delivery through action box
hi, i have a standard scenario in which i want to do return delivery to vendor through notification action box. for this, I have maintained all required setting as follows in notification f2, activity Create Return Delivery is maintained
-
DW CS3 Crashing when /select tag closed
Hi all, Could someone please take a brief look at the code below and tell me why Dreamweaver CS3 keeps crashing every time I try to close the </select> tag? Quick rundown: I'm populating a detail page from my SQL database. If an option (for example "
-
RE:-Data Porting in Oracle
hello, can anybody help me. Tell me it is possible in oracle we directly port the data from foxpro to oracle. one other thing is that we can use oracle for writing some kind of code using we port the data. In compare to visual foxpro how oracle is be
-
IPhone, relationship killer?
so, after read everyone's problem here, I know I am not the only one who have phone problems. Here are the peoblems that I am having now: Call drops not to mention; text messages send and receive delay or the text message will stop working, the whole