org.opensaml.artifact
Class TwoByteSequence

java.lang.Object
  extended byorg.opensaml.artifact.TwoByteSequence
All Implemented Interfaces:
ByteSizedSequence
Direct Known Subclasses:
SAMLArtifact.TypeCode

public class TwoByteSequence
extends Object
implements ByteSizedSequence

A TwoByteSequence is an arbitrary sequence of two bytes.

Author:
Tom Scavo

Field Summary
protected  byte byte0
           
protected  byte byte1
           
 
Constructor Summary
TwoByteSequence(byte byte0, byte byte1)
          The workhorse constructor.
TwoByteSequence(short s)
          A convenience constructor.
 
Method Summary
 boolean equals(Object o)
          Equate two sequences of bytes.
 byte[] getBytes()
          Get the actual bytes of this sequence of bytes.
 int hashCode()
          Compute the hashcode of this sequences of bytes.
 int size()
          Get the size of this sequence of bytes.
 String toString()
          Converts this sequence of bytes to a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

byte0

protected byte byte0

byte1

protected byte byte1
Constructor Detail

TwoByteSequence

public TwoByteSequence(byte byte0,
                       byte byte1)
The workhorse constructor.


TwoByteSequence

public TwoByteSequence(short s)
A convenience constructor.

Method Detail

size

public int size()
Get the size of this sequence of bytes. The size of course is 2.

Specified by:
size in interface ByteSizedSequence
Returns:
always returns 2

getBytes

public byte[] getBytes()
Description copied from interface: ByteSizedSequence
Get the actual bytes of this sequence of bytes.

Specified by:
getBytes in interface ByteSizedSequence
Returns:
the actual sequence of bytes

toString

public String toString()
Converts this sequence of bytes to a string. This method hex-encodes this TwoByteSequence object.

Specified by:
toString in interface ByteSizedSequence
Returns:
the hex encoding of this two-byte sequence
See Also:
Hex

equals

public boolean equals(Object o)
Description copied from interface: ByteSizedSequence
Equate two sequences of bytes.

Specified by:
equals in interface ByteSizedSequence

hashCode

public int hashCode()
Description copied from interface: ByteSizedSequence
Compute the hashcode of this sequences of bytes.

Specified by:
hashCode in interface ByteSizedSequence


Copyright ? 2005 UCAID. All Rights Reserved.