mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 06:14:25 +02:00
make Type & Entry destroyable
This commit is contained in:
parent
24fbf87a2b
commit
a07a800470
@ -29,6 +29,14 @@ public class EntryArray extends OffsetBlockArray<Entry> implements JSONConvert<J
|
||||
public EntryArray(IntegerArray offsets, IntegerItem itemCount, IntegerItem itemStart){
|
||||
super(offsets, itemCount, itemStart);
|
||||
}
|
||||
public void destroy(){
|
||||
for(Entry entry:listItems()){
|
||||
if(entry!=null){
|
||||
entry.setNull(true);
|
||||
}
|
||||
}
|
||||
clearChildes();
|
||||
}
|
||||
public boolean hasComplexEntry(){
|
||||
Entry first = iterator(true).next();
|
||||
if(first==null){
|
||||
|
@ -43,6 +43,14 @@ public class TypeBlockArray extends BlockArray<TypeBlock>
|
||||
public TypeBlockArray(){
|
||||
super();
|
||||
}
|
||||
public void destroy(){
|
||||
for(TypeBlock typeBlock:listItems()){
|
||||
if(typeBlock!=null){
|
||||
typeBlock.destroy();
|
||||
}
|
||||
}
|
||||
clearChildes();
|
||||
}
|
||||
public void sort(){
|
||||
sort(this);
|
||||
}
|
||||
|
@ -32,6 +32,10 @@
|
||||
this.specFlagsArray = new SpecFlagsArray(header.getEntryCount());
|
||||
addChild(specFlagsArray);
|
||||
}
|
||||
public void destroy(){
|
||||
setParent(null);
|
||||
getSpecFlagsArray().clear();
|
||||
}
|
||||
public SpecFlag getSpecFlag(int id){
|
||||
return getSpecFlagsArray().getFlag(id);
|
||||
}
|
||||
|
@ -52,6 +52,11 @@ public class TypeBlock extends Chunk<TypeHeader>
|
||||
addChild(entryOffsets);
|
||||
addChild(mEntryArray);
|
||||
}
|
||||
public void destroy(){
|
||||
getEntryArray().destroy();
|
||||
setId(0);
|
||||
setParent(null);
|
||||
}
|
||||
public boolean removeNullEntries(int startId){
|
||||
startId = 0x0000ffff & startId;
|
||||
EntryArray entryArray = getEntryArray();
|
||||
|
@ -53,6 +53,10 @@ public class SpecTypePair extends BlockContainer<Block>
|
||||
public SpecTypePair(){
|
||||
this(new SpecBlock(), new TypeBlockArray());
|
||||
}
|
||||
public void destroy(){
|
||||
getSpecBlock().destroy();
|
||||
getTypeBlockArray().destroy();
|
||||
}
|
||||
public Entry getAnyEntry(String name){
|
||||
for(TypeBlock typeBlock:listTypeBlocks()){
|
||||
Entry entry =typeBlock.searchByEntryName(name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user