Class ImmutableAtomPair
- All Implemented Interfaces:
Comparable<AtomPair>
AtomPair.
Use the builder to create immutable instances:
ImmutableAtomPair.builder().
Use the static factory method to create immutable instances:
ImmutableAtomPair.of().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionprotected BondLengthstatic ImmutableAtomPair.Builderbuilder()Creates a builder forImmutableAtomPair.static ImmutableAtomPairCreates an immutable copy of aAtomPairvalue.protected doubledistance()booleanThis instance is equal to all instances ofImmutableAtomPairthat have equal attribute values.inthashCode()Computes a hash code from attributes:leftAtom,rightAtom.static ImmutableAtomPairof(PdbAtomLine leftAtom, PdbAtomLine rightAtom) Construct a new immutableAtomPairinstance.toString()Prints the immutable valueAtomPairwith attribute values.final ImmutableAtomPairwithLeftAtom(PdbAtomLine value) Copy the current immutable object by setting a value for theleftAtomattribute.final ImmutableAtomPairwithRightAtom(PdbAtomLine value) Copy the current immutable object by setting a value for therightAtomattribute.Methods inherited from class pl.poznan.put.torsion.AtomPair
compareTo, generateValidationMessage
-
Method Details
-
withLeftAtom
Copy the current immutable object by setting a value for theleftAtomattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for leftAtom- Returns:
- A modified copy of the
thisobject
-
withRightAtom
Copy the current immutable object by setting a value for therightAtomattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rightAtom- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableAtomPairthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:leftAtom,rightAtom. -
toString
Prints the immutable valueAtomPairwith attribute values. -
distance
protected double distance()Returns a lazily initialized value of the
distanceattribute. 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. -
bondLength
Returns a lazily initialized value of the
bondLengthattribute. 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.- Overrides:
bondLengthin classAtomPair- Returns:
- A lazily initialized value of the
bondLengthattribute
-
of
Construct a new immutableAtomPairinstance.- Parameters:
leftAtom- The value for theleftAtomattributerightAtom- The value for therightAtomattribute- Returns:
- An immutable AtomPair instance
-
copyOf
Creates an immutable copy of aAtomPairvalue. 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 AtomPair instance
-
builder
Creates a builder forImmutableAtomPair.ImmutableAtomPair.builder() .leftAtom(pl.poznan.put.pdb.PdbAtomLine) // requiredleftAtom.rightAtom(pl.poznan.put.pdb.PdbAtomLine) // requiredrightAtom.build();- Returns:
- A new ImmutableAtomPair builder
-