Package org.jjazz.phrasetransform.api
Class PhraseTransformChain
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<PhraseTransform>
,Collection<PhraseTransform>
,List<PhraseTransform>
,RandomAccess
A chain of PhraseTransforms.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a chain which directly reuse the specified PhraseTransforms. -
Method Summary
Modifier and TypeMethodDescriptionPerform a deep clone of this chain : PhraseTransforms are cloned too.static PhraseTransformChain
Create a PhraseTransformChain instance from a save string.static String
saveAsString
(PhraseTransformChain chain) Save the chain as a string.transform
(SizedPhrase inPhrase, SongPartContext context) Run all the transforms in the chain.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
PhraseTransformChain
public PhraseTransformChain() -
PhraseTransformChain
Create a chain which directly reuse the specified PhraseTransforms.- Parameters:
pts
- The PhraseTransforms to be added in this chain (no copy is done).- See Also:
-
-
Method Details
-
deepClone
Perform a deep clone of this chain : PhraseTransforms are cloned too.- Returns:
-
transform
Run all the transforms in the chain.- Parameters:
inPhrase
-context
-- Returns:
- Throws:
IllegalStateException
- If a transformed phrase has a different beat range than inPhrase.
-
saveAsString
Save the chain as a string.Example: "[uniqueId1#prop1=value1,prop2=value2|uniqueId2#|uniqueId3#prop1=value1]"
- Parameters:
chain
-- Returns:
- See Also:
-
loadFromString
Create a PhraseTransformChain instance from a save string.- Parameters:
s
-- Returns:
- Throws:
ParseException
- See Also:
-