Package edu.wisc.game.svg
Class Composite
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
String>
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
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,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields inherited from class edu.wisc.game.sql.ImageObject
file, key
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionHow many distinct concrete Composite ImageObjects does this Composite object describe? The result is based on the number of wildcards in this object.For the CGS' FEATURE commandgetSvg()
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
If this is a wildcard description, generates a "concrete" (non-wildcard) desription of a matching composite objectstatic void
setNeedFeatures
(boolean x) 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, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode
-
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
-
setNeedFeatures
public static void setNeedFeatures(boolean x) -
getAllFeatures
For the CGS' FEATURE command -
main
- Throws:
IOException
-