Class IdRanges
java.lang.Object
com.pnfsoftware.jeb.core.units.code.IdRanges
A collection of var-id ranges.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int varid, int bitsize) Add a full variable range.voidAdd a full variable range.voidAdd a partial variable range.voidaddAll(Collection<? extends IVariable> vars) Add variables.voidaddAll(Collection<? extends IVariable> vars, IdRanges exclusions) Add variables excluding variables present in another range collection.voidaddAll(Collection<? extends IVariable> vars, Collection<? extends IVariable> exclusions) Add variables excluding selected variables.intbsize()Get the total bit range size.voidclear()Clear all ranges.voidcollectBits(List<Integer> r) Collect bit ids.voidCollect variable ids.booleancontainsVarFull(int varid) Determine whether a full variable range is present.booleancontainsVarFull(int varid, int bitsize) Determine whether a full variable range is present.booleancontainsVarPart(IVariable var) Determine whether any part of a variable is present.booleangetBits()Get all bit ids.Generate a list (modifiable copy) containing the variable ids stored in this object.inthashCode()booleanhasIntersection(IdRanges other) Check if there is common range between current range and the other range.intersection(IdRanges other) Return common range between current range and the other range.booleanisEmpty()Determine whether this collection is empty.voidremove(int varId) Remove a variable by id.voidRemove a variable.intsize()Provide the number of accessed variables.toString()
-
Constructor Details
-
IdRanges
public IdRanges()Create an empty range collection. -
IdRanges
Create a copy of a range collection.- Parameters:
o- source range collection
-
-
Method Details
-
clear
public void clear()Clear all ranges. -
bsize
public int bsize()Get the total bit range size.- Returns:
- total bit size
-
size
public int size()Provide the number of accessed variables.- Returns:
- accessed variable count
-
isEmpty
public boolean isEmpty()Determine whether this collection is empty.- Returns:
- true if empty
-
remove
Remove a variable.- Parameters:
var- variable
-
remove
public void remove(int varId) Remove a variable by id.- Parameters:
varId- variable id
-
addAll
public void addAll(Collection<? extends IVariable> vars, Collection<? extends IVariable> exclusions) Add variables excluding selected variables.- Parameters:
vars- variables to addexclusions- variables to exclude
-
addAll
Add variables excluding variables present in another range collection.- Parameters:
vars- variables to addexclusions- ranges to exclude
-
addAll
Add variables.- Parameters:
vars- variables to add
-
add
Add a full variable range.- Parameters:
var- variable to add
-
add
Add a partial variable range.- Parameters:
var- variable to addbeg- range startlen- range length
-
add
public void add(int varid, int bitsize) Add a full variable range.- Parameters:
varid- variable idbitsize- variable bit size
-
containsVarPart
Determine whether any part of a variable is present.- Parameters:
var- variable- Returns:
- true if any part is present
-
containsVarFull
public boolean containsVarFull(int varid, int bitsize) Determine whether a full variable range is present.- Parameters:
varid- variable idbitsize- variable bit size- Returns:
- true if the full range is present
-
containsVarFull
public boolean containsVarFull(int varid) Determine whether a full variable range is present.- Parameters:
varid- variable id- Returns:
- true if the full range is present
-
getVarIds
Generate a list (modifiable copy) containing the variable ids stored in this object. Not all variables may be accessed fully.- Returns:
- variable ids
-
collectVarIds
Collect variable ids.- Parameters:
r- output collection
-
getBits
Get all bit ids.- Returns:
- bit ids
-
collectBits
Collect bit ids.- Parameters:
r- output list
-
intersection
Return common range between current range and the other range.- Parameters:
other- other range- Returns:
- intersection
-
hasIntersection
Check if there is common range between current range and the other range.- Parameters:
other- other range- Returns:
- true if there is a non empty intersection
-
hashCode
public int hashCode() -
equals
-
toString
-