xtc.type
Class StringReference

java.lang.Object
  extended by xtc.type.Reference
      extended by xtc.type.StringReference

public class StringReference
extends Reference

Representation of a reference to a constant string. A string reference neither has a base nor an offset.

Version:
$Revision: 1.9 $
Author:
Robert Grimm

Field Summary
 
Fields inherited from class xtc.type.Reference
type
 
Constructor Summary
StringReference(java.lang.String literal, Type type)
          Create a new string reference.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getLiteral()
          Get this string reference's literal.
 int hashCode()
           
 boolean isConstant()
          Determine whether this reference represents a compile-time constant memory location.
 boolean isString()
          Determine whether this reference is a string reference.
 void write(java.lang.Appendable out)
          Write a human readable representation to the specified appendable.
 
Methods inherited from class xtc.type.Reference
add, add, difference, getBase, getField, getIndex, getLocation, getType, hasBase, hasField, hasIndex, hasLocation, indirect, isCast, isDynamic, isIndirect, isNull, isPrefix, isStatic, isVariable, subtract, subtract, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringReference

public StringReference(java.lang.String literal,
                       Type type)
Create a new string reference. The specified type must be a valid character type.

Parameters:
literal - The string literal.
type - The literal's declared type.
Throws:
java.lang.IllegalArgumentException - Signals that the type is not a string type.
Method Detail

isString

public boolean isString()
Description copied from class: Reference
Determine whether this reference is a string reference.

Overrides:
isString in class Reference
Returns:
true if this reference is a string reference.
See Also:
StringReference

getLiteral

public java.lang.String getLiteral()
Get this string reference's literal.

Returns:
The literal.

isConstant

public boolean isConstant()
Description copied from class: Reference
Determine whether this reference represents a compile-time constant memory location.

Overrides:
isConstant in class Reference
Returns:
true if this reference represents a compile-time memory location.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

write

public void write(java.lang.Appendable out)
           throws java.io.IOException
Description copied from class: Reference
Write a human readable representation to the specified appendable.

Specified by:
write in class Reference
Parameters:
out - The appendable.
Throws:
java.io.IOException - Signals an I/O error.


Copyright © 2012. All Rights Reserved.