Class ImmutableDefaultPdbModel

    • Method Detail

      • withHeader

        public final ImmutableDefaultPdbModel withHeader​(PdbHeaderLine value)
        Copy the current immutable object by setting a value for the header attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for header
        Returns:
        A modified copy of the this object
      • withExperimentalData

        public final ImmutableDefaultPdbModel withExperimentalData​(PdbExpdtaLine value)
        Copy the current immutable object by setting a value for the experimentalData attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for experimentalData
        Returns:
        A modified copy of the this object
      • withResolution

        public final ImmutableDefaultPdbModel withResolution​(PdbRemark2Line value)
        Copy the current immutable object by setting a value for the resolution attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for resolution
        Returns:
        A modified copy of the this object
      • withModelNumber

        public final ImmutableDefaultPdbModel withModelNumber​(int value)
        Copy the current immutable object by setting a value for the modelNumber attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for modelNumber
        Returns:
        A modified copy of the this object
      • withAtoms

        public final ImmutableDefaultPdbModel withAtoms​(PdbAtomLine... elements)
        Copy the current immutable object with elements that replace the content of atoms.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withAtoms

        public final ImmutableDefaultPdbModel withAtoms​(Iterable<? extends PdbAtomLine> elements)
        Copy the current immutable object with elements that replace the content of atoms. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of atoms elements to set
        Returns:
        A modified copy of this object
      • withModifiedResidues

        public final ImmutableDefaultPdbModel withModifiedResidues​(PdbModresLine... elements)
        Copy the current immutable object with elements that replace the content of modifiedResidues.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withModifiedResidues

        public final ImmutableDefaultPdbModel withModifiedResidues​(Iterable<? extends PdbModresLine> elements)
        Copy the current immutable object with elements that replace the content of modifiedResidues. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of modifiedResidues elements to set
        Returns:
        A modified copy of this object
      • withMissingResidues

        public final ImmutableDefaultPdbModel withMissingResidues​(PdbRemark465Line... elements)
        Copy the current immutable object with elements that replace the content of missingResidues.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withMissingResidues

        public final ImmutableDefaultPdbModel withMissingResidues​(Iterable<? extends PdbRemark465Line> elements)
        Copy the current immutable object with elements that replace the content of missingResidues. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of missingResidues elements to set
        Returns:
        A modified copy of this object
      • withTitle

        public final ImmutableDefaultPdbModel withTitle​(String value)
        Copy the current immutable object by setting a value for the title attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for title
        Returns:
        A modified copy of the this object
      • withChainTerminatedAfter

        public final ImmutableDefaultPdbModel withChainTerminatedAfter​(Iterable<? extends PdbResidueIdentifier> elements)
        Copy the current immutable object with elements that replace the content of chainTerminatedAfter. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of chainTerminatedAfter elements to set
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableDefaultPdbModel that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: atoms.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value DefaultPdbModel with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • chains

        public List<PdbChain> chains()
        Groups together residues in the same chain and repeat that for every chain.

        Returns a lazily initialized value of the chains attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

        Specified by:
        chains in interface PdbModel
        Overrides:
        chains in class DefaultPdbModel
        Returns:
        A lazily initialized value of the chains attribute
      • residues

        public List<PdbResidue> residues()
        Groups together atoms from the same residue and repeat that for every residue.

        Returns a lazily initialized value of the residues attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

        Specified by:
        residues in interface ResidueCollection
        Overrides:
        residues in class DefaultPdbModel
        Returns:
        A lazily initialized value of the residues attribute
      • of

        public static ImmutableDefaultPdbModel of​(PdbHeaderLine header,
                                                  PdbExpdtaLine experimentalData,
                                                  PdbRemark2Line resolution,
                                                  int modelNumber,
                                                  List<PdbAtomLine> atoms,
                                                  List<PdbModresLine> modifiedResidues,
                                                  List<PdbRemark465Line> missingResidues,
                                                  String title,
                                                  Set<PdbResidueIdentifier> chainTerminatedAfter)
        Construct a new immutable DefaultPdbModel instance.
        Parameters:
        header - The value for the header attribute
        experimentalData - The value for the experimentalData attribute
        resolution - The value for the resolution attribute
        modelNumber - The value for the modelNumber attribute
        atoms - The value for the atoms attribute
        modifiedResidues - The value for the modifiedResidues attribute
        missingResidues - The value for the missingResidues attribute
        title - The value for the title attribute
        chainTerminatedAfter - The value for the chainTerminatedAfter attribute
        Returns:
        An immutable DefaultPdbModel instance
      • of

        public static ImmutableDefaultPdbModel of​(PdbHeaderLine header,
                                                  PdbExpdtaLine experimentalData,
                                                  PdbRemark2Line resolution,
                                                  int modelNumber,
                                                  Iterable<? extends PdbAtomLine> atoms,
                                                  Iterable<? extends PdbModresLine> modifiedResidues,
                                                  Iterable<? extends PdbRemark465Line> missingResidues,
                                                  String title,
                                                  Iterable<? extends PdbResidueIdentifier> chainTerminatedAfter)
        Construct a new immutable DefaultPdbModel instance.
        Parameters:
        header - The value for the header attribute
        experimentalData - The value for the experimentalData attribute
        resolution - The value for the resolution attribute
        modelNumber - The value for the modelNumber attribute
        atoms - The value for the atoms attribute
        modifiedResidues - The value for the modifiedResidues attribute
        missingResidues - The value for the missingResidues attribute
        title - The value for the title attribute
        chainTerminatedAfter - The value for the chainTerminatedAfter attribute
        Returns:
        An immutable DefaultPdbModel instance
      • copyOf

        public static ImmutableDefaultPdbModel copyOf​(DefaultPdbModel instance)
        Creates an immutable copy of a DefaultPdbModel value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable DefaultPdbModel instance
      • builder

        public static ImmutableDefaultPdbModel.Builder builder()
        Creates a builder for ImmutableDefaultPdbModel.
         ImmutableDefaultPdbModel.builder()
            .header(pl.poznan.put.pdb.PdbHeaderLine) // required header
            .experimentalData(pl.poznan.put.pdb.PdbExpdtaLine) // required experimentalData
            .resolution(pl.poznan.put.pdb.PdbRemark2Line) // required resolution
            .modelNumber(int) // required modelNumber
            .addAtoms|addAllAtoms(pl.poznan.put.pdb.PdbAtomLine) // atoms elements
            .addModifiedResidues|addAllModifiedResidues(pl.poznan.put.pdb.PdbModresLine) // modifiedResidues elements
            .addMissingResidues|addAllMissingResidues(pl.poznan.put.pdb.PdbRemark465Line) // missingResidues elements
            .title(String) // required title
            .addChainTerminatedAfter|addAllChainTerminatedAfter(pl.poznan.put.pdb.PdbResidueIdentifier) // chainTerminatedAfter elements
            .build();
         
        Returns:
        A new ImmutableDefaultPdbModel builder