Package hydra.go.syntax
Class SourceFile
- java.lang.Object
-
- hydra.go.syntax.SourceFile
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SourceFile>
public class SourceFile extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<SourceFile>
A Go source file: a package clause, imports, and top-level declarations- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSourceFile.BuilderA fluent builder forSourceFile.
-
Field Summary
Fields Modifier and Type Field Description java.util.List<TopLevelDecl>declarationsstatic NameDECLARATIONSName of thehydra.go.syntax.SourceFile.declarationsfield.java.util.List<ImportDecl>importsstatic NameIMPORTSName of thehydra.go.syntax.SourceFile.importsfield.static NamePACKAGEName of thehydra.go.syntax.SourceFile.packagefield.PackageClausepackage_static NameTYPE_Name of thehydra.go.syntax.SourceFiletype.
-
Constructor Summary
Constructors Constructor Description SourceFile(PackageClause package_, java.util.List<ImportDecl> imports, java.util.List<TopLevelDecl> declarations)Constructs an immutableSourceFile.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SourceFile.Builderbuilder()Creates a new fluent builder forSourceFile.intcompareTo(SourceFile other)booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()SourceFilewithDeclarations(java.util.List<TopLevelDecl> declarations)Returns a copy of thisSourceFilewithdeclarationsreplaced.SourceFilewithImports(java.util.List<ImportDecl> imports)Returns a copy of thisSourceFilewithimportsreplaced.SourceFilewithPackage(PackageClause package_)Returns a copy of thisSourceFilewithpackagereplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.go.syntax.SourceFiletype.
-
PACKAGE
public static final Name PACKAGE
Name of thehydra.go.syntax.SourceFile.packagefield.
-
IMPORTS
public static final Name IMPORTS
Name of thehydra.go.syntax.SourceFile.importsfield.
-
DECLARATIONS
public static final Name DECLARATIONS
Name of thehydra.go.syntax.SourceFile.declarationsfield.
-
package_
public final PackageClause package_
-
imports
public final java.util.List<ImportDecl> imports
-
declarations
public final java.util.List<TopLevelDecl> declarations
-
-
Constructor Detail
-
SourceFile
public SourceFile(PackageClause package_, java.util.List<ImportDecl> imports, java.util.List<TopLevelDecl> declarations)
Constructs an immutableSourceFile.
-
-
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(SourceFile other)
- Specified by:
compareToin interfacejava.lang.Comparable<SourceFile>
-
withPackage
public SourceFile withPackage(PackageClause package_)
Returns a copy of thisSourceFilewithpackagereplaced.
-
withImports
public SourceFile withImports(java.util.List<ImportDecl> imports)
Returns a copy of thisSourceFilewithimportsreplaced.
-
withDeclarations
public SourceFile withDeclarations(java.util.List<TopLevelDecl> declarations)
Returns a copy of thisSourceFilewithdeclarationsreplaced.
-
builder
public static SourceFile.Builder builder()
Creates a new fluent builder forSourceFile.
-
-