Package pl.poznan.put.structure.formats
Class ImmutableStrandView
java.lang.Object
pl.poznan.put.structure.formats.StrandView
pl.poznan.put.structure.formats.ImmutableStrandView
- All Implemented Interfaces:
DotBracket
,Strand
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableStrandView
extends StrandView
Immutable implementation of
StrandView
.
Use the builder to create immutable instances:
ImmutableStrandView.builder()
.
Use the static factory method to create immutable instances:
ImmutableStrandView.of()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableStrandView
. -
Method Summary
Modifier and TypeMethodDescriptionint
begin()
static ImmutableStrandView.Builder
builder()
Creates a builder forImmutableStrandView
.Combines strands which share a base pair into a new dot-bracket instance and returns a list of those.static ImmutableStrandView
copyOf
(StrandView instance) Creates an immutable copy of aStrandView
value.int
end()
boolean
This instance is equal to all instances ofImmutableStrandView
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:combineStrands
,name
,begin
,end
,parent
.name()
static ImmutableStrandView
of
(String name, DotBracket parent, int begin, int end) Construct a new immutableStrandView
instance.parent()
symbols()
final ImmutableStrandView
withBegin
(int value) Copy the current immutable object by setting a value for thebegin
attribute.final ImmutableStrandView
withCombineStrands
(Iterable<? extends DotBracket> elements) Copy the current immutable object with elements that replace the content ofcombineStrands
.final ImmutableStrandView
withCombineStrands
(DotBracket... elements) Copy the current immutable object with elements that replace the content ofcombineStrands
.final ImmutableStrandView
withEnd
(int value) Copy the current immutable object by setting a value for theend
attribute.final ImmutableStrandView
Copy the current immutable object by setting a value for thename
attribute.final ImmutableStrandView
withParent
(DotBracket value) Copy the current immutable object by setting a value for theparent
attribute.Methods inherited from class pl.poznan.put.structure.formats.StrandView
description, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface pl.poznan.put.structure.formats.DotBracket
containsMissing, findStrand, isIsolated, isolatedSymbols, length, missingInternal, missingTerminal, originalIndex, pairs, pseudoknotOrder, sequence, sequence, strands, structure, structure, toStringWithStrands
Methods inherited from interface pl.poznan.put.structure.formats.Strand
isSingleStrand, missingBegin, missingEnd, sequenceRY
-
Method Details
-
combineStrands
Combines strands which share a base pair into a new dot-bracket instance and returns a list of those.- Returns:
- The list of dot-bracket instances, each containing strands which only pair with each other.
-
name
- Specified by:
name
in interfaceStrand
- Specified by:
name
in classStrandView
- Returns:
- The value of the
name
attribute
-
begin
public int begin()- Specified by:
begin
in interfaceStrand
- Specified by:
begin
in classStrandView
- Returns:
- The value of the
begin
attribute
-
end
public int end()- Specified by:
end
in interfaceStrand
- Specified by:
end
in classStrandView
- Returns:
- The value of the
end
attribute
-
parent
- Specified by:
parent
in classStrandView
- Returns:
- The parent dot-bracket structure of this strand.
-
withCombineStrands
Copy the current immutable object with elements that replace the content ofcombineStrands
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withCombineStrands
Copy the current immutable object with elements that replace the content ofcombineStrands
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of combineStrands elements to set- Returns:
- A modified copy of
this
object
-
withName
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name- Returns:
- A modified copy of the
this
object
-
withBegin
Copy the current immutable object by setting a value for thebegin
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for begin- Returns:
- A modified copy of the
this
object
-
withEnd
Copy the current immutable object by setting a value for theend
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for end- Returns:
- A modified copy of the
this
object
-
withParent
Copy the current immutable object by setting a value for theparent
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for parent- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableStrandView
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:combineStrands
,name
,begin
,end
,parent
. -
symbols
Returns a lazily initialized value of the
symbols
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:
symbols
in interfaceDotBracket
- Overrides:
symbols
in classStrandView
- Returns:
- A lazily initialized value of the
symbols
attribute
-
of
Construct a new immutableStrandView
instance.- Parameters:
name
- The value for thename
attributeparent
- The value for theparent
attributebegin
- The value for thebegin
attributeend
- The value for theend
attribute- Returns:
- An immutable StrandView instance
-
copyOf
Creates an immutable copy of aStrandView
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 StrandView instance
-
builder
Creates a builder forImmutableStrandView
.ImmutableStrandView.builder() .addCombineStrands|addAllCombineStrands(pl.poznan.put.structure.formats.DotBracket) //
combineStrands
elements .name(String) // requiredname
.begin(int) // requiredbegin
.end(int) // requiredend
.parent(pl.poznan.put.structure.formats.DotBracket) // requiredparent
.build();- Returns:
- A new ImmutableStrandView builder
-