Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Java String Array without implicit size

Name: Anonymous 2008-02-19 7:36

hey people

I'm trying to get strings from a text inside a String array without implicit size

as if: cycle where method reads a line then stores into the array

Name: Anonymous 2008-02-19 8:05

Forget it. It's NP complete.

Name: Anonymous 2008-02-19 8:06

what

Name: Anonymous 2008-02-19 11:02

new GetStringsFromTextInsideAStringArrayWitoutImplizitSize(null, null, null, null, null, null, null, null).dostuff(null, null, null, null, null);

Name: Anonymous 2008-02-19 11:26

String s2 = StringGettingFactory.newStringGetter(s,Java.Strings.Size.WithoutImplicitSize,null,null,null).doStuff(null,null,null)

Name: Anonymous 2008-02-19 12:23

I've never actually seen the null cancer in Java. It encourages overloading to a huge extent.

As for the OP, I echo >>3. What's the problem, exactly?

Name: Anonymous 2008-02-19 16:03

List<String> readText(BufferedReader in) throws IOException {
  List<String> l = new ArrayList<String>();
  String s;
  while((s = in.readLine()) != null) l.add(s);
  return l;
}

Is this what you mean? Use (String[])l.toArray() if you really need an array for some reason.

Name: Anonymous 2008-02-19 17:22

op here.

let me describe what's going on and sorry for my english

there is a text file with several lines of text, and the number of lines is not known.
I need a way to grab the lines from the BufferedReader/FileReader and sort of store it - as in an array -, because later I will give this array to another class that will do a lot of things, like swap chars from chars, remove chars, etc...

but arrays need an implicit number to be created, and I don't know if later on I will be able to perform such swap/remove characters*...

ArrayList could be good, but can I do things* with the stored strings?

thank you and sorry for my english/nervousness? =/

Name: Anonymous 2008-02-19 17:38

>>8
Yeah, do use an ArrayList or similar to store them, not a regular array. What you can do with the Strings inside has nothing to do with the way you store them. You'll be calling them as String s = alist.get(i) anyway, so you'll be dealing with a regular String object.

Strings are immutable in Java, so swapping/removing chars is going to be annoying, but not particularly hard, thanks to String.toCharArray() and the fact that String can take an array of chars in its constructor.

Name: Anonymous 2008-02-19 17:50

>>7
>>9
DON'T HELP HIM!!!

Name: Anonymous 2008-02-19 17:53

>>9
char [] s = alist.get(i).toCharArray() would be shorter. Either way, the basic idea is the same.
Just use ArrayList.set(int, Object) to update the String in the ArrayList when you're done with it.

Name: Anonymous 2008-02-19 18:24

>>11
DON'T HELP HIM!!!

Name: Anonymous 2008-02-19 19:57

sorry for my english

Then why don't you go learn the language fucktard, instead of apologizing for your stupidity every single time?

Oh wait, you can't.

Name: Anonymous 2008-02-19 22:31

StringArray ourStringArrayInJavaEnterprise = new JavaStringArrayFactory(this.getStringArrayParams(LinkedList<Object>), this.getStringArrayOverfactor(), this.getStringArrayArray());
this.getSQLTableSpaceFactory(new RuntimeSQLThreadTable(this.getSQLParams(new SQLTableFactory().getParams())), "add", this.setGlobalFactorStringArray().overRideStringArrayFactory(ourStringArrayInJavaEnterprise).toXML());

[]bENTERPRISE PROGRAMMING[]/b

Name: Anonymous 2008-02-19 23:57

READ THE MOTHERFUCKING API

IF YOU CAN CODE YOU CAN READ HOPEFULLY

Name: Anonymous 2008-02-20 5:14

>>14
And so java imitates art

Name: Anonymous 2008-02-20 6:19

>>13
Fuck you. At least he's trying.

Name: Anonymous 2008-02-20 8:04

>>14
StringArray ourStringArrayInJavaEnterprise = newJavaStringArrayFactory(this.getStringArrayParams(LinkedList<Object>), this.getStringArrayOverfactor(), this.getStringArrayArray());
TYPE MISMATCH

Polymorphism doesn't work that way.

Name: Anonymous 2008-02-20 9:23

StringArray ourStringArrayInJavaEnterprise = (StringArray)new JavaStringArrayFactory(this.getStringArrayParams(LinkedList<Object>), this.getStringArrayOverfactor(), this.getStringArrayArray());

Name: 19 2008-02-20 9:24

also catch(ClassCastException e)

Name: Anonymous 2008-02-20 9:51

>>19
StringArray ourStringArrayInJavaEnterprise = (new JavaStringArrayFactory(this.getStringArrayParams(LinkedList<Object>), this.getStringArrayOverfactor(), this.getStringArrayArray())).execute(JavaStringArrayFactoryCreationParameters.NULL);

Name: Anonymous 2008-02-20 9:53

EnterpriseSolution es = EnterpriseSolutionFactory.createSolution(new SolutionHeuristic(), new SolutionParadigm());

Name: Anonymous 2008-02-20 10:08

>>19,21
You don't understand how factory patterns work. You don't instantiate them, you use their static methods to instantiate other objects.

>>22
Doing it right.

Name: Anonymous 2008-02-20 10:15

>>23
no one cares

Name: Anonymous 2008-02-20 10:24

>>23
You know Java... LOL!

Anyway, an Enterprise-grade design pattern is to use a constant factory -- you just can't know when those constants change!

type null = ConstantFactory.newConstant("NULL");

Name: Anonymous 2008-02-20 10:42

>>25
Design patterns aren't specific to Java, dipshit. The GoF used Sepples and Smalltalk, and didn't even mention Java.

Also, type is not a Java keyword.

Name: Anonymous 2008-02-20 10:51

>>26
Design patterns aren't specific to Java, dipshit. The GoF used Sepples and Smalltalk, and didn't even mention Java.
Did I say they were?
Also, type is not a Java keyword.
I used that because I don't know Java (but I just read some Java code where there was this type called ``Object,'' would that be right?).

You obviously know Java... get out of my /game/.

Name: Anonymous 2008-02-20 11:04

>>27
Did I say they were?
You know Java... LOL!
You implied I had to know Java to recognise misuse of design patterns, even though Java is a niggerly easy language to just read if you know any C-derived language even a tiny bit, thereby implying that you didn't know design patterns exist independently of the language, and in fact predate it.

I used that because I don't know Java
You also don't know anything about design patterns. In fact, you don't know anything even remotely relevant to this thread, yet you continue to shit it up. gb2/pr/

(but I just read some Java code where there was this type called ``Object,'' would that be right?).
No. null isn't a constant (as Java is too high-level for that sort of faggotry) or an object (as Java is OO in the same sense that Sepples is OO; that is, not really), or even a primitive. It's just a keyword.

You obviously know Java... get out of my nigger.
I do know Java, and design patterns, which means I have an informed opinion on them, which I can back up with more than just failed attempts at shitty satire. You, on the other hand, are an ignorant dickfuck.

Java is a crap language suffering from ENTERPRISE cancer, but you aren't in any position to say so, as you don't know anything about it.
Design patterns are retarded bullshit, but again, you aren't in any position to know this.

The fact that you're proud of your ignorance leads me to believe you're still in high school (or midle school). /pr/ will value your skills more highly than /prog/.

Name: Anonymous 2008-02-20 11:12

>>28
I DONT HAVE TO GIVE REASONS FOR MY AGRUMENTS BECAUZE I AM EXPART PROGRASMMERAR!!!11111111111 I ROTE A C COMPILER USIN SNAI SEE WHEN WAS I FIVE YEARS OLD AND THEN THE ISO SPCEC WHEN I SAW INNE YARD OL!D11111111

IVE RITTEN HUUUUUUUUUUUUUGE POROGRAMS UILL EVER COMPREREHEND!!!!!!!111111

GTFO!!!!!!!!!!!!! SAGEEEEEEEE!!!!!!!!!! EMAIL SAGE!!!!!!!!!!!!!!! ENGLISH BE GONE!!!!!!!!!!!!!!!!!! JUST LIKE PRESIDENT!!!!!!!!!!!!

Name: Anonymous 2008-02-20 11:17

>>29
Back to /b/, please.

Name: Chris Hanssen 2008-02-20 11:19

>>30
Well I am not an "/b/." You have no right to call me that if I made mistakes.  This site should have some rules about harrassments, threats, and name calling.  I am still in the need of more help in that regards

Name: Anonymous 2008-02-20 11:32

>>28
GTFO my fucking /prog/, humorless anticudder.

Name: Anonymous 2008-02-20 11:52

GAYS

Name: Anonymous 2008-02-20 12:27

>>9
>>11

op here

thank you for your support.
as for handling Strings I've done it before, like you said, with CharArrays. =) thank you so much

Name: Anonymous 2008-02-20 12:30

>>34
Java? TOPSAGE!!!!!!!!!!!!!!!!!!!1

Name: Anonymous 2008-02-20 12:32

age for java

Name: Anonymous 2008-02-20 12:48

>>32
The fact that nobody likes your jokes doesn't mean they're humorless. It means you just aren't funny.

Name: Anonymous 2008-02-20 13:04

>>37
Good thing everyone else does like my jokes then.

Name: Anonymous 2008-02-20 13:08

>>38
>>39 here, I don't like your jokes.

Name: Anonymous 2008-02-20 13:10

>>40 here, me neither.

Name: Anonymous 2008-02-20 13:16

I don't like humor.

Name: Anonymous 2008-02-20 13:27

I prefer humour.

Name: Anonymous 2008-02-20 13:43

I like drugs

Name: Anonymous 2008-02-20 18:05

>>42
I prefer humoor.

I like Java jokes, but only if they're done right. When you fuck up important parts, the only thing up for ridicule is your ignorance.

Name: Anonymous 2008-02-20 19:11

I don't like his jokes much, but I appreciate them in their irrelvant trashy style

Name: Anonymous 2009-08-16 23:01

Lain.

Name: Anonymous 2010-06-08 11:51




              ...........
           ....        ...
      ...........  .          ...
       ..      ....            ..
     ......  ..      .             ..
   ...      ..     ..              .
   .       .    ..              ..
    ....   ..               .
      ...
      .    ...
      . ..
  .         ...
..           ..
. ....        .
.   ...        ..
.    ....    ..
..    ..... . ...
 ...  .     ........
    ..         ...
           ..

Name: Anonymous 2010-06-08 11:51




              ...........
           ....        ...
      ...........  .          ...
       ..      ....            ..
     ......  ..      .             ..
   ...      ..     ..              .
   .       .    ..              ..
    ....   ..               .
      ...
      .    ...
      . ..
  .         ...
..           ..
. ....        .
.   ...        ..
.    ....    ..
..    ..... . ...
 ...  .     ........
    ..         ...
           ..

Name: Anonymous 2010-06-08 11:56



        |
        |           |
        |         --|
        |       --|                   ..
 -\        |      -|         HAVE YOU READ YOUR    .
   --      |-|----/         SICKPEA TODAT?..
     --    |--    /|-         .        .
       \--      |-         .        .
    | \-       |-         .        .
    |      -||         .        .
    \ /       --\         .        .
    |-       -| -----     ................
       |-----| |  -|
       /     --|-/
     //           |
    /           |
           |
           |
           |




        |
        |           |
        |         --|
        |       --|                   ..
 -\        |      -|         HAVE YOU READ YOUR    .
   --      |-|----/         SICKPEA TODAT?..
     --    |--    /|-         .        .
       \--      |-         .        .
    | \-       |-         .        .
    |      -||         .        .
    \ /       --\         .        .
    |-       -| -----     ................
       |-----| |  -|
       /     --|-/
     //           |
    /           |
           |
           |
           |

Name: Anonymous 2010-06-08 11:57



        |
        |           |
        |         --|
        |       --|                   ..
 -\        |      -|         HAVE YOU READ YOUR    .
   --      |-|----/         SICKPEA TODAT?..
     --    |--    /|-         .        .
       \--      |-         .        .
    | \-       |-         .        .
    |      -||         .        .
    \ /       --\         .        .
    |-       -| -----     ................
       |-----| |  -|
       /     --|-/
     //           |
    /           |
           |
           |
           |

Name: Anonymous 2010-06-08 12:03




        |
        |           |
        |         --|
        |       --|                   ..
 -\        |      -|         HAVE YOU READ YOUR    .
   --      |-|----/         SICKPEA TODAT?..
     --    |--    /|-         .        .
       \--      |-         .        .
    | \-       |-         .        .
    |      -||         .        .
    \ /       --\         .        .
    |-       -| -----     ................
       |-----| |  -|
       /     --|-/
     //           |
    /           |
           |
           |
           |

Name: Anonymous 2010-06-08 12:04




        |
        |           |
        |         --|
        |       --|                   ..
 -\        |      -|         HAVE YOU READ YOUR    .
   --      |-|----/         SICKPEA TODAT?..
     --    |--    /|-         .        .
       \--      |-         .        .
    | \-       |-         .        .
    |      -||         .        .
    \ /       --\         .        .
    |-       -| -----     ................
       |-----| |  -|
       /     --|-/
     //           |
    /           |
           |
           |
           |

Name: Anonymous 2010-06-08 12:06



'-._                  ___.....___
    `.__           ,-'        .-'  \
        `''-------'          / o )  `._     WHY IS THIS
                              `-'      (     HAPPENING?
                                        \
                                         \
                                   ______)
   ................._          .-''    /
                     `-.._         _.-'
                          `'-----''

Name: Anonymous 2010-06-08 12:07

[m]

'-._                  ___.....___
    `.__           ,-'        .-'  \
        `''-------'          / o )  `._     WHY IS THIS
                              `-'      (     HAPPENING?
                                        \
                                         \
                                   ______)
   ................._          .-''    /
                     `-.._         _.-'
                          `'-----''
[m]

Name: Anonymous 2010-06-08 12:07



'-._                  ___.....___
    `.__           ,-'        .-'  \
        `''-------'          / o )  `._     WHY IS THIS
                              `-'      (     HAPPENING?
                                        \
                                         \
                                   ______)
   ................._          .-''    /
                     `-.._         _.-'
                          `'-----''

Name: Anonymous 2010-06-08 12:08




        |
        |           |
        |         --|
        |       --|                   ..
 -\        |      -|         HAVE YOU READ YOUR    .
   --      |-|----/         SICKPEA TODAT?..
     --    |--    /|-         .        .
       \--      |-         .        .
    | \-       |-         .        .
    |      -||         .        .
    \ /       --\         .        .
    |-       -| -----     ................
       |-----| |  -|
       /     --|-/
     //           |
    /           |
           |
           |
           |

Name: Anonymous 2010-11-14 4:57

Name: Anonymous 2011-02-03 1:37

Don't change these.
Name: Email:
Entire Thread Thread List