Class Sexpr.Token<T>

All Implemented Interfaces:
IAttributeValue, INode, IPos.IPosable, IResponse, ISexpr, ISexpr.IToken<T>
Enclosing class:
Sexpr

public static class Sexpr.Token<T> extends Sexpr implements ISexpr.IToken<T>
Represents a single S-expression token with intrinsic type T
  • Field Details

    • value

      protected T value
  • Constructor Details

    • Token

      public Token(T value)
  • Method Details

    • value

      public T value()
      Specified by:
      value in interface ISexpr.IToken<T>
    • kind

      public String kind()
      Description copied from interface: ISexpr
      A word characterizing the subclass
      Specified by:
      kind in interface ISexpr
    • isOK

      public boolean isOK()
      Description copied from interface: IResponse
      Returns true if the response is a SUCCESS response
      Specified by:
      isOK in interface IAttributeValue
      Specified by:
      isOK in interface IResponse
    • isError

      public boolean isError()
      Description copied from interface: IResponse
      Returns true if the response is an error response
      Specified by:
      isError in interface IAttributeValue
      Specified by:
      isError in interface IResponse
    • accept

      public <TT> TT accept(IVisitor<TT> v) throws IVisitor.VisitorException
      Description copied from interface: INode
      The accept method corresponding to IVisitor, to be implemented in each subclass as { return v.visit(this); }
      Specified by:
      accept in interface INode
      Type Parameters:
      TT - the return type desired from the visit methods
      Parameters:
      v - the visitor class
      Returns:
      the value returned by the visit method
      Throws:
      IVisitor.VisitorException