Package edu.wisc.game.svg
Class Composite
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,String>
public class Composite extends ImageObject
The description of a single composite ImageObject, or a family
of such objects, obtained by parsing its name
(which may contain wildcards). Unlike other ImageObject,
Composite ones are dynamically generated, because
they are drawn from a large space.
A Composite object may be a "concrete" one (has no wildcards, and describes exactly one ImageObject), or a "family" one (has wildcards that match a group of objects). The sample() method can be used to randomly draw a concrete object from a family.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Composite.Generator
A tool for drawing concrete ImageObjects from a family defined by a Composite object, or a union of such families.Nested classes/interfaces inherited from class edu.wisc.game.sql.ImageObject
ImageObject.PickFromList
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description BigInteger
familySize()
How many distinct concrete Composite ImageObjects does this Composite object describe? The result is based on the number of wildcards in this object.String
getSvg()
The SVG code for the image, if available.static boolean
isCompositeName(String name)
boolean
isWild()
Does the name contain wildcards, thus describing a family of Composite images, rather than a single "concrete" image?static void
main(String[] argv)
Composite
sample(Random random)
If this is a wildcard description, generates a "concrete" (non-wildcard) desription of a matching composite objectString
toString()
Methods inherited from class edu.wisc.game.sql.ImageObject
clearTable, enlist, getKey, listProperties, listProperties, obtainImageObjectPlain, obtainImageObjectPlain, obtainImageObjectPlain, obtainImageObjects, symbol
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
Composite
Constructs a concrete or "family" Composite object based on a name string.- Parameters:
name
- E.g. "/composite/h/d=???/b=123/gq/gq/gq"
-
-
Method Details
-
isWild
public boolean isWild()Does the name contain wildcards, thus describing a family of Composite images, rather than a single "concrete" image? -
getSvg
Description copied from class:ImageObject
The SVG code for the image, if available. It is mandatory for dynamically generated ImageObjects (/composite). For static ones, it may or may not be null.- Overrides:
getSvg
in classImageObject
-
toString
- Overrides:
toString
in classAbstractMap<String,String>
-
familySize
How many distinct concrete Composite ImageObjects does this Composite object describe? The result is based on the number of wildcards in this object. BigInteger is used because the number can be combinatorially large. -
sample
If this is a wildcard description, generates a "concrete" (non-wildcard) desription of a matching composite object -
isCompositeName
-
main
- Throws:
IOException
-