org.foray.ps
Class PsBoolean

java.lang.Object
  extended by org.foray.ps.PsBoolean
All Implemented Interfaces:
PsObject, PsObjectSimple

public final class PsBoolean
extends Object
implements PsObjectSimple

Class representing a boolean PostScript object.


Method Summary
 PsObject duplicate()
          This is a shallow copy.
static PsBoolean getBoolean(boolean value)
          Returns the appropriate instance of this class.
 PsName getTypeName()
          Needed for the "type" operator.
 boolean getValue()
          Returns the object 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getBoolean

public static PsBoolean getBoolean(boolean value)
Returns the appropriate instance of this class.

Parameters:
value - The boolean value for which an instance of PsBoolean is needed.
Returns:
The appropriate instance.

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.

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

isExecutable

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

Specified by:
isExecutable in interface PsObject
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.

Specified by:
isComparable in interface PsObject
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.

Specified by:
getTypeName in interface PsObject
Returns:
The type name as defined in PSRM2, Chapter 8, "type" operator.

getValue

public boolean getValue()
Returns the object value.

Returns:
The boolean value.

toString

public String toString()
Overrides:
toString in class Object

isComposite

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

Specified by:
isComposite in interface PsObject
Returns:
True iff this object is a composite PostScript object.


Copyright © 2017. All rights reserved.