public class AqdefObjectModel extends Object
Provides methods to
getXXX, putXXX,
removeXXX, filterXXX)forEachXXX
Use AqdefParser to read AQDEF content and AqdefWriter to
write this object model as AQDEF content.
AqdefParser,
AqdefWriter| Constructor and Description |
|---|
AqdefObjectModel() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
void |
filterCharacteristics(AqdefObjectModel.CharacteristicPredicate predicate)
Removes all characteristics that do not match the given predicate.
|
void |
filterCharacteristics(AqdefObjectModel.PartEntries part,
AqdefObjectModel.CharacteristicOfSinglePartPredicate predicate)
Removes all characteristics of the given part that do not match the given predicate.
|
void |
filterGroups(AqdefObjectModel.GroupPredicate predicate)
Removes all groups that do not match the given predicate.
|
void |
filterGroups(AqdefObjectModel.PartEntries part,
AqdefObjectModel.GroupOfSinglePartPredicate predicate)
Removes all groups of the given part that do not match the given predicate.
|
void |
filterParts(AqdefObjectModel.PartPredicate predicate)
Removes all parts that do not match the given predicate.
|
void |
filterValues(AqdefObjectModel.PartEntries part,
AqdefObjectModel.CharacteristicEntries characteristic,
AqdefObjectModel.ValueOfSingleCharacteristicPredicate predicate)
Removes all values of the given characteristic that do not match the given predicate.
|
void |
filterValues(AqdefObjectModel.PartEntries part,
AqdefObjectModel.ValueOfSinglePartPredicate predicate)
Removes all values of the given part that do not match the given predicate.
|
void |
filterValues(AqdefObjectModel.ValuePredicate predicate)
Removes all values that do not match the given predicate.
|
Set<CharacteristicIndex> |
findCharacteristicIndexesForPart(PartIndex partIndex,
AqdefObjectModel.CharacteristicOfSinglePartPredicate predicate) |
PartIndex |
findPartIndexForCharacteristic(int characteristicIndex)
Finds part index to which the given characteristic index belongs.
|
void |
forEachCharacteristic(AqdefObjectModel.CharacteristicConsumer consumer)
Iterates through all characteristics of all parts
|
void |
forEachCharacteristic(AqdefObjectModel.PartEntries part,
AqdefObjectModel.CharacteristicOfSinglePartConsumer consumer)
Iterates through all characteristics of the given part.
|
void |
forEachGroup(AqdefObjectModel.GroupConsumer consumer)
Iterates through all logical groups of all parts
|
void |
forEachGroup(AqdefObjectModel.PartEntries part,
AqdefObjectModel.GroupOfSinglePartConsumer consumer)
Iterates through all logical groups of the given part.
|
void |
forEachPart(AqdefObjectModel.PartConsumer consumer)
Iterates through all parts
|
void |
forEachValue(AqdefObjectModel.PartEntries part,
AqdefObjectModel.CharacteristicEntries characteristic,
AqdefObjectModel.ValueOfSingleCharacteristicConsumer consumer)
Iterates through all values of the given characteristic.
|
void |
forEachValue(AqdefObjectModel.PartEntries part,
AqdefObjectModel.ValueOfSinglePartConsumer consumer)
Iterates through all values of the given part.
|
void |
forEachValue(AqdefObjectModel.ValueConsumer consumer)
Iterates through all values.
|
Object |
getAnyValueOf(KKey key)
Finds value of the given K-key from any part / characteristic / value.
|
int |
getCharacteristicCount()
Returns total number of characteristics of all parts in this object model
|
AqdefObjectModel.CharacteristicEntries |
getCharacteristicEntries(CharacteristicIndex characteristicIndex) |
AqdefObjectModel.CharacteristicEntries |
getCharacteristicEntries(int partIndex,
int characteristicIndex) |
List<CharacteristicIndex> |
getCharacteristicIndexes(PartIndex partIndex)
Returns indexes of all characteristics of a part with the given index.
|
AqdefHierarchy |
getHierarchy() |
AqdefObjectModel.PartEntries |
getPartEntries(int index) |
AqdefObjectModel.PartEntries |
getPartEntries(PartIndex index) |
List<PartIndex> |
getPartIndexes()
Returns indexes of all parts in this object model.
|
int |
getValueCount()
Returns total number of values of all parts and characteristics in this object model
|
List<AqdefObjectModel.ValueEntries> |
getValueEntries(CharacteristicIndex characteristicIndex) |
AqdefObjectModel.ValueEntries |
getValueEntries(int partIndex,
int characteristicIndex,
int valueIndex) |
AqdefObjectModel.ValueEntries |
getValueEntries(ValueIndex valueIndex) |
List<ValueIndex> |
getValueIndexes()
Returns indexes of all values in this object model.
|
List<ValueIndex> |
getValueIndexes(CharacteristicIndex characteristicIndex)
Returns indexes of all values of a characteristics with the given index.
|
List<AqdefObjectModel.ValueSet> |
getValueSets(PartIndex partIndex) |
int |
hashCode() |
void |
normalize()
Normalize the AQDEF content.
|
void |
putCharacteristicEntries(AqdefObjectModel.CharacteristicEntries newCharacteristicEntries) |
void |
putCharacteristicEntry(KKey key,
CharacteristicIndex characteristicIndex,
Object value) |
void |
putGroupEntry(KKey key,
GroupIndex groupIndex,
Object value) |
void |
putHierarchyEntry(KKey kKey,
Integer nodeIndex,
Object value) |
void |
putPartEntries(AqdefObjectModel.PartEntries newPartEntries) |
void |
putPartEntry(KKey key,
PartIndex index,
Object value) |
void |
putValueEntries(AqdefObjectModel.ValueEntries newValueEntries) |
void |
putValueEntry(KKey key,
ValueIndex valueIndex,
Object value) |
void |
setHierarchy(AqdefHierarchy hierarchy) |
public void putPartEntries(AqdefObjectModel.PartEntries newPartEntries)
public void putCharacteristicEntry(KKey key, CharacteristicIndex characteristicIndex, Object value)
public void putCharacteristicEntries(AqdefObjectModel.CharacteristicEntries newCharacteristicEntries)
public void putGroupEntry(KKey key, GroupIndex groupIndex, Object value)
public void putValueEntry(KKey key, ValueIndex valueIndex, Object value)
public void putValueEntries(AqdefObjectModel.ValueEntries newValueEntries)
public List<PartIndex> getPartIndexes()
public AqdefObjectModel.PartEntries getPartEntries(int index)
public AqdefObjectModel.PartEntries getPartEntries(PartIndex index)
public List<CharacteristicIndex> getCharacteristicIndexes(PartIndex partIndex)
public AqdefObjectModel.CharacteristicEntries getCharacteristicEntries(int partIndex, int characteristicIndex)
public AqdefObjectModel.CharacteristicEntries getCharacteristicEntries(CharacteristicIndex characteristicIndex)
public List<ValueIndex> getValueIndexes(CharacteristicIndex characteristicIndex)
public List<ValueIndex> getValueIndexes()
public AqdefObjectModel.ValueEntries getValueEntries(int partIndex, int characteristicIndex, int valueIndex)
public AqdefObjectModel.ValueEntries getValueEntries(ValueIndex valueIndex)
public List<AqdefObjectModel.ValueEntries> getValueEntries(CharacteristicIndex characteristicIndex)
public List<AqdefObjectModel.ValueSet> getValueSets(PartIndex partIndex)
public PartIndex findPartIndexForCharacteristic(int characteristicIndex)
You should call this method only after this AqdefObjectModel is fully created.
characteristicIndex - public Set<CharacteristicIndex> findCharacteristicIndexesForPart(PartIndex partIndex, AqdefObjectModel.CharacteristicOfSinglePartPredicate predicate)
public void forEachPart(AqdefObjectModel.PartConsumer consumer)
consumer - public void forEachCharacteristic(AqdefObjectModel.CharacteristicConsumer consumer)
consumer - public void forEachCharacteristic(AqdefObjectModel.PartEntries part, AqdefObjectModel.CharacteristicOfSinglePartConsumer consumer)
forEachPart(PartConsumer).
model.forEachPart(part -> {
// do something with the part
model.forEachCharacteristic(part, characteristic -> {
// do something with the characteristic
});
})
part - consumer - public void forEachGroup(AqdefObjectModel.GroupConsumer consumer)
consumer - public void forEachGroup(AqdefObjectModel.PartEntries part, AqdefObjectModel.GroupOfSinglePartConsumer consumer)
forEachCharacteristic(PartEntries, CharacteristicOfSinglePartConsumer)part - consumer - public void forEachValue(AqdefObjectModel.ValueConsumer consumer)
consumer - public void forEachValue(AqdefObjectModel.PartEntries part, AqdefObjectModel.ValueOfSinglePartConsumer consumer)
forEachPart(PartConsumer).
model.forEachPart(part -> {
// do something with the part
model.forEachValue(part, (characteristic, value) -> {
// do something with the value
});
})
part - consumer - public void forEachValue(AqdefObjectModel.PartEntries part, AqdefObjectModel.CharacteristicEntries characteristic, AqdefObjectModel.ValueOfSingleCharacteristicConsumer consumer)
forEachCharacteristic(CharacteristicConsumer).
model.forEachCharacteristic(part, characteristic -> {
// do something with the characteristic
model.forEachValue(part, characteristic, value -> {
// do something with the value
});
})
part - characteristic - consumer - public void filterParts(AqdefObjectModel.PartPredicate predicate)
predicate - public void filterCharacteristics(AqdefObjectModel.CharacteristicPredicate predicate)
predicate - public void filterCharacteristics(AqdefObjectModel.PartEntries part, AqdefObjectModel.CharacteristicOfSinglePartPredicate predicate)
part - predicate - public void filterGroups(AqdefObjectModel.GroupPredicate predicate)
predicate - public void filterGroups(AqdefObjectModel.PartEntries part, AqdefObjectModel.GroupOfSinglePartPredicate predicate)
part - predicate - public void filterValues(AqdefObjectModel.ValuePredicate predicate)
predicate - public void filterValues(AqdefObjectModel.PartEntries part, AqdefObjectModel.ValueOfSinglePartPredicate predicate)
part - predicate - public void filterValues(AqdefObjectModel.PartEntries part, AqdefObjectModel.CharacteristicEntries characteristic, AqdefObjectModel.ValueOfSingleCharacteristicPredicate predicate)
part - characteristic - predicate - public Object getAnyValueOf(KKey key)
There is no guarantee from which part / characteristic / value this K-key value will be taken (whether from the first or other).
key - any K-key of part / characteristic / valueIllegalArgumentException - if the K-key is not for part / characteristic / value lavel.public void normalize()
public int getCharacteristicCount()
public int getValueCount()
public AqdefHierarchy getHierarchy()
public void setHierarchy(AqdefHierarchy hierarchy)
Copyright © 2018. All rights reserved.