Package pl.poznan.put.structure.formats
Class ImmutableDefaultStrand
- java.lang.Object
-
- pl.poznan.put.structure.formats.DefaultStrand
-
- pl.poznan.put.structure.formats.ImmutableDefaultStrand
-
- All Implemented Interfaces:
DotBracket,Strand
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableDefaultStrand extends DefaultStrand
Immutable implementation ofDefaultStrand.Use the builder to create immutable instances:
ImmutableDefaultStrand.builder(). Use the static factory method to create immutable instances:ImmutableDefaultStrand.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableDefaultStrand.BuilderBuilds instances of typeImmutableDefaultStrand.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableDefaultStrand.Builderbuilder()Creates a builder forImmutableDefaultStrand.List<DotBracket>combineStrands()Combines strands which share a base pair into a new dot-bracket instance and returns a list of those.static ImmutableDefaultStrandcopyOf(DefaultStrand instance)Creates an immutable copy of aDefaultStrandvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableDefaultStrandthat have equal attribute values.inthashCode()Computes a hash code from attributes:combineStrands,name,symbols.Stringname()static ImmutableDefaultStrandof(String name, Iterable<? extends DotBracketSymbol> symbols)Construct a new immutableDefaultStrandinstance.static ImmutableDefaultStrandof(String name, List<DotBracketSymbol> symbols)Construct a new immutableDefaultStrandinstance.List<DotBracketSymbol>symbols()ImmutableDefaultStrandwithCombineStrands(Iterable<? extends DotBracket> elements)Copy the current immutable object with elements that replace the content ofcombineStrands.ImmutableDefaultStrandwithCombineStrands(DotBracket... elements)Copy the current immutable object with elements that replace the content ofcombineStrands.ImmutableDefaultStrandwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableDefaultStrandwithSymbols(Iterable<? extends DotBracketSymbol> elements)Copy the current immutable object with elements that replace the content ofsymbols.ImmutableDefaultStrandwithSymbols(DotBracketSymbol... elements)Copy the current immutable object with elements that replace the content ofsymbols.-
Methods inherited from class pl.poznan.put.structure.formats.DefaultStrand
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, length, missingInternal, missingTerminal, originalIndex, pairs, pseudoknotOrder, sequence, sequence, strands, structure, structure, toStringWithStrands
-
Methods inherited from interface pl.poznan.put.structure.formats.Strand
begin, description, end, isSingleStrand, missingBegin, missingEnd, sequenceRY
-
-
-
-
Method Detail
-
combineStrands
public List<DotBracket> 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
public String name()
- Specified by:
namein interfaceStrand- Specified by:
namein classDefaultStrand- Returns:
- The value of the
nameattribute
-
symbols
public List<DotBracketSymbol> symbols()
- Specified by:
symbolsin interfaceDotBracket- Specified by:
symbolsin classDefaultStrand- Returns:
- The value of the
symbolsattribute
-
withCombineStrands
public final ImmutableDefaultStrand withCombineStrands(DotBracket... elements)
Copy the current immutable object with elements that replace the content ofcombineStrands.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withCombineStrands
public final ImmutableDefaultStrand withCombineStrands(Iterable<? extends DotBracket> elements)
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
thisobject
-
withName
public final ImmutableDefaultStrand withName(String value)
Copy the current immutable object by setting a value for thenameattribute. 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
thisobject
-
withSymbols
public final ImmutableDefaultStrand withSymbols(DotBracketSymbol... elements)
Copy the current immutable object with elements that replace the content ofsymbols.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSymbols
public final ImmutableDefaultStrand withSymbols(Iterable<? extends DotBracketSymbol> elements)
Copy the current immutable object with elements that replace the content ofsymbols. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of symbols elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableDefaultStrandthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:combineStrands,name,symbols.
-
of
public static ImmutableDefaultStrand of(String name, List<DotBracketSymbol> symbols)
Construct a new immutableDefaultStrandinstance.- Parameters:
name- The value for thenameattributesymbols- The value for thesymbolsattribute- Returns:
- An immutable DefaultStrand instance
-
of
public static ImmutableDefaultStrand of(String name, Iterable<? extends DotBracketSymbol> symbols)
Construct a new immutableDefaultStrandinstance.- Parameters:
name- The value for thenameattributesymbols- The value for thesymbolsattribute- Returns:
- An immutable DefaultStrand instance
-
copyOf
public static ImmutableDefaultStrand copyOf(DefaultStrand instance)
Creates an immutable copy of aDefaultStrandvalue. 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 DefaultStrand instance
-
builder
public static ImmutableDefaultStrand.Builder builder()
Creates a builder forImmutableDefaultStrand.ImmutableDefaultStrand.builder() .addCombineStrands|addAllCombineStrands(pl.poznan.put.structure.formats.DotBracket) //combineStrandselements .name(String) // requiredname.addSymbols|addAllSymbols(pl.poznan.put.structure.DotBracketSymbol) //symbolselements .build();- Returns:
- A new ImmutableDefaultStrand builder
-
-