Class ImmutableConflictGraph
- java.lang.Object
-
- pl.poznan.put.structure.pseudoknots.ConflictGraph
-
- pl.poznan.put.structure.pseudoknots.ImmutableConflictGraph
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableConflictGraph extends ConflictGraph
Immutable implementation ofConflictGraph.Use the builder to create immutable instances:
ImmutableConflictGraph.builder(). Use the static factory method to create immutable instances:ImmutableConflictGraph.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableConflictGraph.BuilderBuilds instances of typeImmutableConflictGraph.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableConflictGraph.Builderbuilder()Creates a builder forImmutableConflictGraph.protected Map<Region,Set<Region>>conflicts()static ImmutableConflictGraphcopyOf(ConflictGraph instance)Creates an immutable copy of aConflictGraphvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableConflictGraphthat have equal attribute values.inthashCode()Computes a hash code from attributes:regions.static ImmutableConflictGraphof(Iterable<? extends Region> regions)Construct a new immutableConflictGraphinstance.static ImmutableConflictGraphof(List<Region> regions)Construct a new immutableConflictGraphinstance.protected List<Region>regions()StringtoString()Prints the immutable valueConflictGraphwith attribute values.ImmutableConflictGraphwithRegions(Iterable<? extends Region> elements)Copy the current immutable object with elements that replace the content ofregions.ImmutableConflictGraphwithRegions(Region... elements)Copy the current immutable object with elements that replace the content ofregions.-
Methods inherited from class pl.poznan.put.structure.pseudoknots.ConflictGraph
conflictCliques, conflictsWith, hasConflicts, hasConflicts, isConflicting, regionsWithConflicts, removeRegion, simplified
-
-
-
-
Method Detail
-
regions
protected List<Region> regions()
- Specified by:
regionsin classConflictGraph- Returns:
- The value of the
regionsattribute
-
withRegions
public final ImmutableConflictGraph withRegions(Region... elements)
Copy the current immutable object with elements that replace the content ofregions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withRegions
public final ImmutableConflictGraph withRegions(Iterable<? extends Region> elements)
Copy the current immutable object with elements that replace the content ofregions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of regions elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableConflictGraphthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:regions.
-
toString
public String toString()
Prints the immutable valueConflictGraphwith attribute values.
-
conflicts
protected Map<Region,Set<Region>> conflicts()
Returns a lazily initialized value of the
conflictsattribute. 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:
conflictsin classConflictGraph- Returns:
- A lazily initialized value of the
conflictsattribute
-
of
public static ImmutableConflictGraph of(List<Region> regions)
Construct a new immutableConflictGraphinstance.- Parameters:
regions- The value for theregionsattribute- Returns:
- An immutable ConflictGraph instance
-
of
public static ImmutableConflictGraph of(Iterable<? extends Region> regions)
Construct a new immutableConflictGraphinstance.- Parameters:
regions- The value for theregionsattribute- Returns:
- An immutable ConflictGraph instance
-
copyOf
public static ImmutableConflictGraph copyOf(ConflictGraph instance)
Creates an immutable copy of aConflictGraphvalue. 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 ConflictGraph instance
-
builder
public static ImmutableConflictGraph.Builder builder()
Creates a builder forImmutableConflictGraph.ImmutableConflictGraph.builder() .addRegions|addAllRegions(pl.poznan.put.structure.pseudoknots.Region) //regionselements .build();- Returns:
- A new ImmutableConflictGraph builder
-
-