org.foray.ps
Class PsString

java.lang.Object
  extended by org.foray.ps.PsObjectComposite
      extended by org.foray.ps.PsString
All Implemented Interfaces:
PsObject

public class PsString
extends PsObjectComposite

Class representing a string PostScript object.


Constructor Summary
PsString(String value)
          Constructor.
 
Method Summary
 PsObject duplicate()
          This is a shallow copy.
 boolean equals(Object anObject)
           
 PsName getTypeName()
          Needed for the "type" operator.
 String getValue()
          Returns this string's value.
 boolean isComparable(PsObject object)
          Test the comparability of two PSObjects.
 boolean isComposite()
          The method should be overridden by composite objects.
 boolean isExecutable()
          Indicates whether this object is executable.
 void setExecutable(boolean newExecutable)
          Sets the executable status of this name.
 void setValue(String newValue)
          Sets this string's value.
 int size()
          Return the size, in characters, of the encapsulated String.
 String toString()
           
 
Methods inherited from class org.foray.ps.PsObjectComposite
getAccess, setAccess
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PsString

public PsString(String value)
Constructor.

Parameters:
value - The value to encapsulate.
Method Detail

duplicate

public PsObject duplicate()
Description copied from interface: PsObject
This is a shallow copy. Specifically, composite objects should generally return themselves. Simple objects should return copies of themselves.

Returns:
A duplicate of this that conforms to what is expected by the "dup" operator.

isComposite

public boolean isComposite()
Description copied from interface: PsObject
The method should be overridden by composite objects.

Returns:
True iff this object is a composite PostScript object.

equals

public boolean equals(Object anObject)
Overrides:
equals in class Object

isExecutable

public boolean isExecutable()
Description copied from interface: PsObject
Indicates whether this object is executable.

Returns:
True iff this object is executable.

isComparable

public boolean isComparable(PsObject object)
Description copied from interface: PsObject
Test the comparability of two PSObjects. Used in the eq, ne, lt, etc. operators.

Parameters:
object - The object that should be tested for comparability.
Returns:
True if this is comparable to object, false otherwise.

getTypeName

public PsName getTypeName()
Description copied from interface: PsObject
Needed for the "type" operator.

Returns:
The type name as defined in PSRM2, Chapter 8, "type" operator.

size

public int size()
Return the size, in characters, of the encapsulated String.

Returns:
The size of the string.

toString

public String toString()
Overrides:
toString in class Object

getValue

public String getValue()
Returns this string's value.

Returns:
The value.

setValue

public void setValue(String newValue)
Sets this string's value.

Parameters:
newValue - The new value for this string.

setExecutable

public void setExecutable(boolean newExecutable)
Sets the executable status of this name.

Parameters:
newExecutable - The new executable status of this name. Set to true to make it executable, set it to false to make it not executable.


Copyright © 2017. All rights reserved.