Package org.jgroups.util
Class AsciiString
- java.lang.Object
-
- org.jgroups.util.AsciiString
-
- All Implemented Interfaces:
java.lang.Comparable<AsciiString>
public class AsciiString extends java.lang.Object implements java.lang.Comparable<AsciiString>
Simple string implemented as a byte[] array. Each character's higher 8 bits are truncated and only the lower 8 bits are stored. AsciiString is mutable for efficiency reasons, but the chars array should never be changed !- Since:
- 3.5
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
val
-
Constructor Summary
Constructors Constructor Description AsciiString()
AsciiString(byte[] val)
AsciiString(int length)
AsciiString(java.lang.String str)
AsciiString(AsciiString str)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
chars()
int
compareTo(AsciiString str)
boolean
equals(byte[] other)
boolean
equals(java.lang.Object obj)
int
hashCode()
int
length()
java.lang.String
toString()
-
-
-
Constructor Detail
-
AsciiString
public AsciiString()
-
AsciiString
public AsciiString(java.lang.String str)
-
AsciiString
public AsciiString(AsciiString str)
-
AsciiString
public AsciiString(byte[] val)
-
AsciiString
public AsciiString(int length)
-
-
Method Detail
-
chars
public byte[] chars()
-
length
public int length()
-
compareTo
public int compareTo(AsciiString str)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AsciiString>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
equals
public boolean equals(byte[] other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-