Package hydra.lisp.syntax
Class ImportDeclaration
- java.lang.Object
-
- hydra.lisp.syntax.ImportDeclaration
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ImportDeclaration>
public class ImportDeclaration extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<ImportDeclaration>
An import/require declaration. Serializes as (:require [name ...]) in Clojure, (require 'name) in Emacs Lisp, (:use :name) or (:import-from :name ...) in Common Lisp, (import (name)) in Scheme- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImportDeclaration.BuilderA fluent builder forImportDeclaration.
-
Field Summary
Fields Modifier and Type Field Description NamespaceNamemoduleThe module being importedstatic NameMODULEName of thehydra.lisp.syntax.ImportDeclaration.modulefield.ImportSpecspecImport specificationstatic NameSPECName of thehydra.lisp.syntax.ImportDeclaration.specfield.static NameTYPE_Name of thehydra.lisp.syntax.ImportDeclarationtype.
-
Constructor Summary
Constructors Constructor Description ImportDeclaration(NamespaceName module, ImportSpec spec)Constructs an immutableImportDeclaration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImportDeclaration.Builderbuilder()Creates a new fluent builder forImportDeclaration.intcompareTo(ImportDeclaration other)booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()ImportDeclarationwithModule(NamespaceName module)Returns a copy of thisImportDeclarationwithmodulereplaced.ImportDeclarationwithSpec(ImportSpec spec)Returns a copy of thisImportDeclarationwithspecreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.lisp.syntax.ImportDeclarationtype.
-
MODULE
public static final Name MODULE
Name of thehydra.lisp.syntax.ImportDeclaration.modulefield.
-
SPEC
public static final Name SPEC
Name of thehydra.lisp.syntax.ImportDeclaration.specfield.
-
module
public final NamespaceName module
The module being imported
-
spec
public final ImportSpec spec
Import specification
-
-
Constructor Detail
-
ImportDeclaration
public ImportDeclaration(NamespaceName module, ImportSpec spec)
Constructs an immutableImportDeclaration.- Parameters:
module- The module being importedspec- Import specification
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(ImportDeclaration other)
- Specified by:
compareToin interfacejava.lang.Comparable<ImportDeclaration>
-
withModule
public ImportDeclaration withModule(NamespaceName module)
Returns a copy of thisImportDeclarationwithmodulereplaced.
-
withSpec
public ImportDeclaration withSpec(ImportSpec spec)
Returns a copy of thisImportDeclarationwithspecreplaced.
-
builder
public static ImportDeclaration.Builder builder()
Creates a new fluent builder forImportDeclaration.
-
-