Questions tagged [value-of]

138 questions
1
vote
4 answers

The method valueOf(String) in the type Integer is not applicable for the arguments (int)

I am getting an error The method valueOf(String) in the type Integer is not applicable for the arguments (int) for the below line when I compile the code in jdk1.4(j2sdk1.4.1_05). If I compile the same code in jdk1.6.0_14, the code works fine.…
SuRa
  • 503
  • 2
  • 12
  • 24
1
vote
1 answer

The good usage of Boolean.valuesOf()

I have a question about the use of Boolean.valueOf(String). In my code the user will answer a question by entering either true or false. Then the String should be converted to a boolean. public String setCorrespondingAuthor () { String respons =…
samia
  • 31
  • 4
1
vote
4 answers

How can we test an Enum like is valueOf()?

G'day, errata ... My plan was as shown below. This update is to clarify and apologise for a late night question. The compile error was due to a problem elsewhere in the file. Clarification: a simple Java enum, like this: public enum…
will
  • 4,799
  • 8
  • 54
  • 90
1
vote
1 answer

Value-of in html markup

I have this XSL file : mylink I want to put the value of my the url attribute in the href. Do you know how to do this ? Because
Pierrick
  • 13
  • 2
1
vote
2 answers

Can't reproduce android crash

Android keeps on reporting crashes from users which I can't reproduce on my phone. I can find the lines which seem to be…
Riverside
  • 207
  • 1
  • 12
1
vote
2 answers

Dynamic xsl:value-of using data from a parameter

I'm trying to get data from a XML using like filter the fields that comes listed in an XML parameter in XSL: The parameter is a xml like this: ID Name
user2516482
  • 15
  • 1
  • 4
1
vote
2 answers

Dynamic for-each based on function arguments in XSLT v2.0

I'd like to create a generic XSLT 2.0 function that would operate on xml like this: Cindy
1
vote
1 answer

Rounding and "Double.valueOf with float"

In Java 6 there are only two Double#valueOf methods : Double#valueOf(double) and Double#valueOf(String). 1 - Witch method is calling when I execute Double#valueOf(float) ? According to Javadoc, it seems to be Double#valueOf(String) but Eclipse links…
Jean-Charles
  • 1,690
  • 17
  • 28
1
vote
1 answer

javascript Date().valueOf() is working on development PC but not on page served by server

The IE9 debugger (F12 developer tools -> script debugger) shows the following in the Locals window when I step through the code when the page is launched from the server: midnight Fri Mar 15 00:00:00 EDT 2013 Object, (Date) myDate Fri…
Tim
  • 8,669
  • 31
  • 105
  • 183
1
vote
1 answer

what's the best way to output the value of several XSL variables?

if you have an XSL transform with code that looks more or less as follows: ...
John Smith
  • 4,416
  • 7
  • 41
  • 56
1
vote
2 answers

Integer.valueOf() invalid int

I am trying to create color values from r,g,b values adding the alpha byte to create a color int. But I am getting errors using : Integer.valueOf(colorStr,16); colorStr is the string that I build, now the value that sends me error is…
user1805792
  • 319
  • 1
  • 4
  • 17
1
vote
2 answers

XSLT Difference between value-of select and variable select

I need to flip the elements of two nodes. Originally the variable were set with the following command:
1
vote
3 answers

Thread safety of enum valueOf()

This is a variation of the perpertual "lengthy-if or switch" dilemma... Consider a multithreaded application using a static method that contains a long (over a dozen conditions) if statement, which checks the type of an object and returns a value…
PNS
  • 19,295
  • 32
  • 96
  • 143
0
votes
1 answer

How to use .valueOf function in java without losing precision?

I want to convert a string to its integer value in java so I'm using the .ValueOf function, however, it truncates the beginning of the string when making it an integer. For example, converting the string "0900" to the integer value 0900 by…
0
votes
0 answers

overriding valueOf and toString not working as expected

I am trying to override valueOf and toString This is becouse I want to add some properties to the premitive values So I created this below class Box { #value; constructor(value) { this.#value = value; } valueOf() { return…
Alen.Toma
  • 4,684
  • 2
  • 14
  • 31