Interface DatatypeFilter
- All Known Implementing Classes:
HomogeneousAggregate
,MetaTypeFilter
,SizeRestrictedFilter
public interface DatatypeFilter
A filter selecting a specific class of data-type.
A test of whether data-type belongs to its class can be performed by calling
the filter() method.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Make a copy of this filtervoid
Encode this filter and its configuration to a streamstatic boolean
extractPrimitives
(DataType dt, int max, DataType filler, ArrayList<DataType> res) Extract an ordered list of primitive data-types making up the given data-type The primitive data-types are passed back in an ArrayList.boolean
Test whether the given data-type belongs to this filter's data-type classboolean
Test if the given filter is configured and performs identically to thisstatic DatatypeFilter
restoreFilterXml
(XmlPullParser parser) Instantiate a filter from the given stream.void
restoreXml
(XmlPullParser parser) Configure details of the data-type class being filtered from the given stream
-
Method Details
-
clone
DatatypeFilter clone()Make a copy of this filter- Returns:
- the new copy
-
isEquivalent
Test if the given filter is configured and performs identically to this- Parameters:
op
- is the given filter- Returns:
- true if the two filters are equivalent
-
filter
Test whether the given data-type belongs to this filter's data-type class- Parameters:
dt
- is the given data-type to test- Returns:
- true if the data-type is in the class, false otherwise
-
encode
Encode this filter and its configuration to a stream- Parameters:
encoder
- is the stream encoder- Throws:
IOException
- for problems writing to the stream
-
restoreXml
Configure details of the data-type class being filtered from the given stream- Parameters:
parser
- is the given stream decoder- Throws:
XmlParseException
- if there are problems with the stream
-
extractPrimitives
Extract an ordered list of primitive data-types making up the given data-type The primitive data-types are passed back in an ArrayList. If the given data-type is already primitive, it is passed back as is. Otherwise if it is composite, its components are recursively listed. If a filler data-type is provided, it is used to fill holes in structures. If a maximum number of extracted primitives is exceeded, or if no filler is provided and a hole is encountered, or if a non-primitive non-composite data-type is encountered, false is returned.- Parameters:
dt
- is the given data-type to extract primitives frommax
- is the maximum number of primitives to extract before giving upfiller
- is the data-type to use as filler (or null)res
- will hold the list of primitives- Returns:
- true if all primitives were extracted
-
restoreFilterXml
Instantiate a filter from the given stream.- Parameters:
parser
- is the given stream decoder- Returns:
- the new data-type filter instance
- Throws:
XmlParseException
- for problems reading the stream
-