Class ImmutableDefaultPdbResidue
- All Implemented Interfaces:
Serializable
,Comparable<ChainNumberICode>
,PdbResidue
,ChainNumberICode
DefaultPdbResidue
.
Use the builder to create immutable instances:
ImmutableDefaultPdbResidue.builder()
.
Use the static factory method to create immutable instances:
ImmutableDefaultPdbResidue.of()
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableDefaultPdbResidue
. -
Method Summary
Modifier and TypeMethodDescriptionatoms()
builder()
Creates a builder forImmutableDefaultPdbResidue
.static ImmutableDefaultPdbResidue
copyOf
(DefaultPdbResidue instance) Creates an immutable copy of aDefaultPdbResidue
value.boolean
This instance is equal to all instances ofImmutableDefaultPdbResidue
that have equal attribute values.boolean
Compares the set of actual atoms in this residue with the set of expected atoms derived from the detected type of residue.int
hashCode()
Computes a hash code from attributes:identifier
,standardResidueName
,modifiedResidueName
,atoms
.static ImmutableDefaultPdbResidue
of
(PdbResidueIdentifier identifier, String standardResidueName, String modifiedResidueName, Iterable<? extends PdbAtomLine> atoms) Construct a new immutableDefaultPdbResidue
instance.static ImmutableDefaultPdbResidue
of
(PdbResidueIdentifier identifier, String standardResidueName, String modifiedResidueName, List<PdbAtomLine> atoms) Construct a new immutableDefaultPdbResidue
instance.Detects the type of residue by its name and atom content.withAtoms
(Iterable<? extends PdbAtomLine> elements) Copy the current immutable object with elements that replace the content ofatoms
.withAtoms
(PdbAtomLine... elements) Copy the current immutable object with elements that replace the content ofatoms
.Copy the current immutable object by setting a value for theidentifier
attribute.withModifiedResidueName
(String value) Copy the current immutable object by setting a value for themodifiedResidueName
attribute.withStandardResidueName
(String value) Copy the current immutable object by setting a value for thestandardResidueName
attribute.Methods inherited from class pl.poznan.put.pdb.analysis.DefaultPdbResidue
toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface pl.poznan.put.pdb.ChainNumberICode
compareTo
Methods inherited from interface pl.poznan.put.pdb.analysis.PdbResidue
chainIdentifier, findAtom, hasAnyHydrogen, hasAtom, insertionCode, isConnectedTo, isMissing, isModified, namedResidueIdentifier, nucleobasePlane, oneLetterName, residueNumber, toCif, toPdb
-
Method Details
-
identifier
- Specified by:
identifier
in interfacePdbResidue
- Specified by:
identifier
in classDefaultPdbResidue
- Returns:
- The value of the
identifier
attribute
-
standardResidueName
- Specified by:
standardResidueName
in interfacePdbResidue
- Specified by:
standardResidueName
in classDefaultPdbResidue
- Returns:
- The value of the
standardResidueName
attribute
-
modifiedResidueName
- Specified by:
modifiedResidueName
in interfacePdbResidue
- Specified by:
modifiedResidueName
in classDefaultPdbResidue
- Returns:
- The value of the
modifiedResidueName
attribute
-
atoms
- Specified by:
atoms
in interfacePdbResidue
- Specified by:
atoms
in classDefaultPdbResidue
- Returns:
- The value of the
atoms
attribute
-
withIdentifier
Copy the current immutable object by setting a value for theidentifier
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for identifier- Returns:
- A modified copy of the
this
object
-
withStandardResidueName
Copy the current immutable object by setting a value for thestandardResidueName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for standardResidueName- Returns:
- A modified copy of the
this
object
-
withModifiedResidueName
Copy the current immutable object by setting a value for themodifiedResidueName
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for modifiedResidueName- Returns:
- A modified copy of the
this
object
-
withAtoms
Copy the current immutable object with elements that replace the content ofatoms
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withAtoms
Copy the current immutable object with elements that replace the content ofatoms
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of atoms elements to set- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableDefaultPdbResidue
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:identifier
,standardResidueName
,modifiedResidueName
,atoms
. -
residueInformationProvider
Detects the type of residue by its name and atom content.Returns a lazily initialized value of the
residueInformationProvider
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:
residueInformationProvider
in interfacePdbResidue
- Overrides:
residueInformationProvider
in classDefaultPdbResidue
- Returns:
- A lazily initialized value of the
residueInformationProvider
attribute
-
atomNames
Returns a lazily initialized value of the
atomNames
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:
atomNames
in interfacePdbResidue
- Overrides:
atomNames
in classDefaultPdbResidue
- Returns:
- A lazily initialized value of the
atomNames
attribute
-
hasAllHeavyAtoms
public boolean hasAllHeavyAtoms()Compares the set of actual atoms in this residue with the set of expected atoms derived from the detected type of residue.Returns a lazily initialized value of the
hasAllHeavyAtoms
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:
hasAllHeavyAtoms
in interfacePdbResidue
- Overrides:
hasAllHeavyAtoms
in classDefaultPdbResidue
- Returns:
- A lazily initialized value of the
hasAllHeavyAtoms
attribute
-
of
public static ImmutableDefaultPdbResidue of(PdbResidueIdentifier identifier, String standardResidueName, String modifiedResidueName, List<PdbAtomLine> atoms) Construct a new immutableDefaultPdbResidue
instance.- Parameters:
identifier
- The value for theidentifier
attributestandardResidueName
- The value for thestandardResidueName
attributemodifiedResidueName
- The value for themodifiedResidueName
attributeatoms
- The value for theatoms
attribute- Returns:
- An immutable DefaultPdbResidue instance
-
of
public static ImmutableDefaultPdbResidue of(PdbResidueIdentifier identifier, String standardResidueName, String modifiedResidueName, Iterable<? extends PdbAtomLine> atoms) Construct a new immutableDefaultPdbResidue
instance.- Parameters:
identifier
- The value for theidentifier
attributestandardResidueName
- The value for thestandardResidueName
attributemodifiedResidueName
- The value for themodifiedResidueName
attributeatoms
- The value for theatoms
attribute- Returns:
- An immutable DefaultPdbResidue instance
-
copyOf
Creates an immutable copy of aDefaultPdbResidue
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 DefaultPdbResidue instance
-
builder
Creates a builder forImmutableDefaultPdbResidue
.ImmutableDefaultPdbResidue.builder() .identifier(pl.poznan.put.pdb.PdbResidueIdentifier) // required
identifier
.standardResidueName(String) // requiredstandardResidueName
.modifiedResidueName(String) // requiredmodifiedResidueName
.addAtoms|addAllAtoms(pl.poznan.put.pdb.PdbAtomLine) //atoms
elements .build();- Returns:
- A new ImmutableDefaultPdbResidue builder
-