String.class without split(String regex)
hello,
This is my problem:
I am using eclipse with j2sdk1.4.2 which
implement
the clase String.class with
method replaceAll(String regex, String replacement) and
method split(String regex)
PAth: home_j2sdk1.4.2/jre/lib/rt.jar 25.762kb
In this way:
String columns[] = line.split("\t");
for (int i=0; i<columns.length; i++)
ws.addCell(new Label(i,row,columns.replaceAll("\"","")));
I move the code above to websphere Application Developer 5.1.2
which use Home_Websphere/eclipse/jre/lib/rt.jar 8.827 kb
this jar in yours String.class not contains the
method replaceAll(String regex, String replacement) and
method split(String regex)
I need to find the use my code above with that methods,
what i need to do ???
possible,i need to find the source to String.java of j2sdk1.4.2
which implement the methods, but where ???
or there is another way to do it ???
Any help is greatly appreciated.
If websphere is supposedly 1.4 compatible, arethey
"allowed" to leave out methods from the JFC? Not sure what the JFC is, but no, they would not be
allowed to leave out any methods.
JFC - Java Foundation Classes. I think they started calling what might be considered the Java Core the JFC when they first added Swing to the distribution. Maybe the term is no longer used.
RRD-R
� {�
Similar Messages
-
How to reference a class without using the new keyword
I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
c.getFirstName();quedogf94 wrote:
I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
c.getFirstName();No.
Using new does not erase anything. There's nothing to erase. It's brand new. It creates a new instance, and whatever that constructor puts in there, is there. If you then change the contents of that instance, and you want to see them, you have to have maintained a reference to it somewhere, and access that instance's state through that reference.
As already stated, you seem to be confused between class and instance, at the very least.
Run this. Study the output carefully. Make sure you understand why you see what you do. Then, if you're still confused, try to rephrase your question in a way that makes some sense based on what you've observed.
(And not that accessing a class (static) member through a reference, like foo1.getNumFoos() is syntactically legal, but is bad form, since it looks like you're accessing an instance (non-static) member. I do it here just for demonstration purposes.)
public class Foo {
private static int numFoos; // class variable
private int x; // instance varaible
public Foo(int x) {
this.x = x;
numFoos++;
// class method
public static int getNumFoos() {
return numFoos;
// instance method
public int getX() {
return x;
public static void main (String[] args) {
System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
System.out.println ();
Foo foo1 = new Foo(42);
System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
System.out.println ("foo1.x is " + foo1.getX ());
System.out.println ();
Foo foo2 = new Foo(666);
System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
System.out.println ("foo1.x is " + foo1.getX ());
System.out.println ("foo2.numFoos is " + foo2.getNumFoos ());
System.out.println ("foo2.x is " + foo2.getX ());
System.out.println ();
} -
I have a string like this:
String parseMe = "//element//elementAgain/elementSecond"
I want to get the string between // and /. How can I do that using split and regex? I'm confused on how will i construct my regex expression. can anyone help me or show me how? thanks!String parseMe = "//element//elementAgain/elementSecond";
Pattern p = Pattern.compile("//(.*?)(?=/)");
for(Matcher m = p.matcher(parseMe); m.find(); System.out.println(m.group(1))); -
Testing classes without a main()...
i was wondering if its possible to run a test ona class without a main...my prof isnt letting us use "static" methods because it obviously defeats the purpose of OOD. So now im left wondering how the hell to get my test classes running...here is an example of one..i made the "main" method here static and it worked fine...but now how do i go about making it work non static?
import java.util.*;
import java.io.*;
public class BankAccountTest
public void main(String[] args)
String testName = "Testy McTesterson";
BankAccount test = new BankAccount();
test.setBalance(100.00);
System.out.println(test.getBalance());
test.setName(testName);
System.out.println(test.getName());
thanks in advance,
Cuda
Edited by: 74Cuda on Mar 8, 2008 7:28 PMHow the Java virtual machine "gets started" is covered in the JVM specification 5.2 "The Java virtual machine starts up by creating an initial class, which is specified in an implementation-dependent manner, using the bootstrap class loader (�5.3.1). The Java virtual machine then links the initial class, initializes it, and invokes its public class method void main(String[])". Note that it's a class - ie static - method that kicks the whole thing off. And it really has to be as no code has been run, and no objects created at this point.
http://java.sun.com/docs/books/jvms/second_edition/html/ConstantPool.doc.html#51579
Magic involves suspending the everyday laws of nature and logic to effect the impossible. Stage magic merely hides these laws to create a pleasant illusion.
I suspect that IDEs' lack of an apparent static main() method when performing unit testing is just stage magic.
For instance junit.swingui.TestRunner includes this method:
public static void main(String[] args) {
new TestRunner().start(args);
} -
Is it possible to create a javafx class without extending Application class ? If yes, how ?
There is no such thing as a javafx class. It is a regular java class. The Aapplication class is the entry
point for JavaFX application. You have to extend the Application class to create Javafx application . -
How to export the text edit data to excel file without splitting the data in excel file?
how to export the text edit data to excel file without splitting the data in excel file?
I have a requirement in SAP HR where in the appraiser can add comments in the area given and can export that to excel file. Currently the file is getting exported but the comments getting split into deifferent rows.
I want the entire comment to be fit in one row.
Please help.
Thank youHi,
if your text edit value is stored in 'lv_string' variable.
then before exporting the value to excel you have to remove CL_ABAP_CHAR_UTILITIES=>NEWLINE
that is '#' from the variable lv_string.
for that use code some thing like this.
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE in lv_string WITH space.
I think this will do the trick. -
For each sample example in OSB without Split join
Hi,
Any body have sample example for For each in OSB without Split join......Thanks in advanceI know this is an old thread, but I just ran into this same problem. Wow! That's a crappy 'feature'. I wasted 4 hours this morning on this thinking it was me doing something wrong in my xpath, but nope, you need to cast the counter to an int .......
I hope they fix things like this in the next major release.
Thanks for the solution. -
Lot size Key without splitting Quota
Hi,
Can any one explain me what is the use of Lot size Key without splitting Quota.
We had created a lot size Key - XY with following seting:-
1) Lotsize Proceed = P
2) Lotsize indicator -K
3) Scheduling =2
4) No of periods = 1
5) Splitting Quota = Not checked(blank)
If we had configured this lot size key, what is the benefits of the above setting, What testing need to be done to know whether this lot size key is working perfectly after configuration?.
Thanks in advanceHi,
If splitting quota indicator not set, then qouta arrangement is not used during planning wrt to selected lot size.
Lot size procedure you selected, it is a periodic lot sizing procedure. Here the system groups several requirements within a time interval together to form a lot.
Lot size indicator Determines how the lot size is calculated for a certain lot-sizing procedure during material requirements planning. For your selection system creates lot size by refereing to planning calender defined in the system
Scheduling -
This indicator defines the time in the period the system is to create the availability date or the start date for the lot for period
lot-sizing procedures.
The availability date is the date on which the material, including the goods receipt processing time, is available again. In the MRP list, the availability date is equal to the MRP date.
In in-house production, the start date is the order start date, in external procurement the start date is the release date.
according to your selection - Availability date at period end
No of periods - 1
Run a complete MRP cycel to check whether it is working properly or not.
Post the results what you get.
Regards,
Pavan -
Classes without packages not accepted by ejbc compilation ?
Hey guys ...
I noticed something which I found unusual...I mite be missing something out here
When ejbc generates the Bean IMPL class , it does not put any import statements
in the generated java file but references all the classes in the Bean with their
absolute path ...
Now ..I have a 3rd-party jar which does not have certain classes in packages...and
I reference these classes within my Session Bean...the session bean compiles properly
..but when ejbc happens and the Impl class gets generated with the absolute path
and no imports...the compiler expects to find all these 3rd-party classes without
packages within the current session bean package itself which it will not..and
hence throws all sorts of "cannot resolve symbol" errors...
Does this mean that within my EJB beans I can never reference classes without
packages or is there something I am missing..?
Thanx,
KrishRob ,
I agree with u that giving classes without package is not a good practise..but
Itz got a history which believe it or not stems from another weblogic problem(related
to webservices..)
anywayz..that is another issue alltogether...
I don't think this bug is fixed...coz I checked a WLS70 Impl and it is still generating
the IMPL without the imports...
But can u clarify..what u wud mean by "fixing the bug" ..does it mean that the
Impl would start putting the imports..?
Thanx,
Krish
Rob Woollen <[email protected]> wrote:
I recall this bug being reported before. You might try the latest
service pack and see if it's been fixed already. Otherwise, you'll have
to contact [email protected]
FWIW, it's quite disturbing that a 3rd party would give you a jar
without a package.
-- Rob
Krishnan Venkataraman wrote:
Hey guys ...
I noticed something which I found unusual...I mite be missing
something out here
When ejbc generates the Bean IMPL class , it does not put any import
statements
in the generated java file but references all the classes in the Bean
with their
absolute path ...
Now ..I have a 3rd-party jar which does not have certain classes in
packages...and
I reference these classes within my Session Bean...the session bean
compiles properly
..but when ejbc happens and the Impl class gets generated with the
absolute path
and no imports...the compiler expects to find all these 3rd-party
classes without
packages within the current session bean package itself which it will
not..and
hence throws all sorts of "cannot resolve symbol" errors...
Does this mean that within my EJB beans I can never reference classes
without
packages or is there something I am missing..?
Thanx,
Krish -
hellow, i have a web aplication named test , and i have a class named conexion
when i import a package "pack" with the class conexion, not problem (test/WEB-INF/classes/pack/conexion.class) <% import="pack.* " %> but when i have only the class conexion WITHOUT package (test/WEB-INF/classes/conexion.class) and i import <%import ="conexion" %> i have problem ("The import conexion cannot be resolved") and when i not import the class i have problem (conexion cannot be resolved to a type) , my question is:
how to i import a class without package in JSP , and if the test/WEB-INF/classes is in the classpath when compile the servlet , why the tomcat not found the class conexion?
(tomcat 5.5.20 , jdk 1.5.09 , vim)
thank
(Sorry my english , i'm from Chile)Hi I am hosting my JSP application with Resin 2.17 which uses classes directly in JSP code (not packages). To make this work I had to specify the classpath in Resin.conf and it worked.
My problem is getting this to work with TomCat or any other application server that will allow me to debug my project in Eclipse or NetBeans IDE. (I have yet to find an IDE that Supports debugging JSP/Java code running on Resin - so I want to switch my application server but I am not sure how to configure my classpath for the application servers to look for java classes in the specified directory just like I did with Resin. -
Can we maintain two values for one material a plant without split valuation
Hello Guru's,
We have a situation, we use MOVING AVERAGE PRICE in accounting view 1. Without split valuation.
The actual issue is, we receive, damaged material from a customer with a "0" value, and we send the material as it is, to a vendor with a "0" value.
The vendor, sends us back the repaired material with a value, say "10" (and this keeps changing).
Is it possible, to have Non Valuated Stock and Valuated Stock within the same Plant, for Material "A".
And it shouldn't affect the MAP. Also, we don't want to have Split Valuation.
Please help.
Kashiif i am getting your scenrio correctly then i will suggets u to maintian the material master with moving avreage price control indicator then
case1> gr from customer at o rs
use the tcode mb1c and movement type 511
as it is evaluated at MAP hence only material document genrated no accounting document
well tried to realize your scenerio but it is not possible to do that
as MAP is going to get effected as a result of valuated good recipet
u need to go for separate material code then transfer good from non valuated to valuated one using tcode mb1b and movement type 309 or use split valuation -
How do you call a method from another class without extending as a parent?
How do you call a method from another class without extending it as a parent? Is this possible?
Why don't you just create an instance of the class?
Car c = new Car();
c.drive("fast");The drive method is in the car class, but as long as the method is public, you can use it anywhere.
Is that what you were asking or am I totally misunderstanding your question?
Jen -
Is it Possible to assign Valuation class without accounting view in MM
Hi all,
I have check my client system for materials having without accounting view while checking in table mbew for this material having valuation class.can anyelse say is it possible to assign valuation class without having accounting view.
Advance thanks,
rarajaHello ,
It is not possible to have a valuation class without accounting view.
There is some mistake that you are possibly making . pls check the same .Pls check if u r viewing the material master at the correct plant level .Also if you say that in MBEW valuation class exists , find out l the corresponding valuation level, the see the material master at the same level . You will definitely find the accounting view.
Regards
Anis -
Map xsd complex type to existing java class without adding JAXB annotations
Hello
I've got a case where I should map an xsd complex type to an existing Java class without modifying that class, i.e. without adding JAXB annotations to that class.
Is this possible somehow?
As far as I've understood, the <javaType> declaration (adapter, parse/print methods) can only be used for xsd simple types.
Thanks, TomIt should be possible to implement an XmlAdapter<...,...> which performs the required conversion between the original type and a JAXB-annotated type. Then, at the places where the original type is used, the @XmlJavaTypeAdapter annotation would be used.
The xjc compiler supports this for xsd simple types (xjc:javaType annotation), but not for complex types.
Any idea why this is restricted to simple types?
Would it be possible to implement a xjc plugin which does this for complex types?
Thanks Tom. -
Dear Expert,
In sales order level, i have normal materials and third party materials also in one sales order.
In this case, i want to take only one invoice without splitting the invoice (with third party materials).
because third party material don't have delivery.
plz tell me how to do this?
Thanks for advanceHi,
You can take both materials in invoice if both have billing relevance is order related billing.
But if you have delivery for one material and that have delivery related billing and for other third party do not have delivery then can not.
Now if you have delivery for one material and that material is billing relevance as per the delivery then
for third party material do virtual GR then create delivery & show it as delivered and then both will come in billing
Or else try
The material which have delivery related billing then
Run VF04 select option order related & delivery related then both documents will appear delivery for delivery material and same order for third party material select both document OR & DELIVERY and click on billing system will combine both in one.
I had applied last option in one of my project.
Kapil
Maybe you are looking for
-
I use my PowerPC Quicksilver G4 (2.1), 867 MHz, 1.5 GB standart video card system 10.4.11 to scan (lack of driver for my Mac Pro 10.6.8) The G4 has been running flawless, now I get kernel panics every time (shut down your computer). When it stays on
-
How to use an array for variable name of swing components using NetBeans
I'm completely new to Java and GUIs, so excuse me if I use the wrong terminology. I'm making a JFrameFrom in NetBeans. I'm getting really tired of typing instructions like jTextField15.setText(variable[15].text); I would like to make the variable nam
-
Strange behaviour accessing cache via TCPExtend in multithreaded client
I have set up a test where 10 threads issue a cache.invoke against the cache service, and the EntryProcessor simply sleeps for 4 seconds. The key being used for each thread is different. The single cluster node which I am using for the test is config
-
How do I remove the photo frame icon from the lock screen on iPhone 5 ?? I am using a 4 digit passcode but there no option for the photo frame.
-
Screen saver won't start since Lion upgrade. Two different machines, same issue.
Screen saver won't start since Lion upgrade. Two different machines, same issue. Help