Jacson

de.spieleck.util
Class Strings

java.lang.Object
  extended byde.spieleck.util.Strings

public class Strings
extends java.lang.Object

A class to represent a list of strings with appropriate hashCode and equals implemented.

I'm surprised, that this is needed instead of String[].

Version:
1.0
Author:
fsn

Constructor Summary
Strings(int n)
          Empty Strings
Strings(java.lang.String[] strs)
          Directly wrap given String-array
 
Method Summary
 boolean equals(java.lang.Object o)
          provide a working overall equals()
 int getLength()
           
 java.lang.String getString(int i)
           
 int hashCode()
          provide a working overall hashCode.
 void setString(int i, java.lang.String h)
          Modify a particular String in the array
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Strings

public Strings(int n)
Empty Strings


Strings

public Strings(java.lang.String[] strs)
Directly wrap given String-array

Method Detail

setString

public void setString(int i,
                      java.lang.String h)
Modify a particular String in the array

Parameters:
i - the position in the array.
h - the value to set.

getLength

public int getLength()
Returns:
the number of Strings in the array.

getString

public java.lang.String getString(int i)
Returns:
a particular String from the array.

hashCode

public int hashCode()
provide a working overall hashCode.

Returns:
the hashcode

equals

public boolean equals(java.lang.Object o)
provide a working overall equals()

Returns:
true if object equal to me.

toString

public java.lang.String toString()
Returns:
prettyprinted String array.

Spieleck

Copyleft 2002 spieleck.de.